Repository navigation
Expand file tree
/
Copy pathIndex.html
More file actions
1760 lines (1667 loc) · 95 KB
/
Copy pathIndex.html
File metadata and controls
1760 lines (1667 loc) · 95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&family=Roboto+Mono:wght@400;500&display=swap" rel="stylesheet">
<style>
:root{
/* Palette Google Workspace (Material) — mêmes noms de variables qu'avant */
--encre:#202124; /* texte principal */
--papier:#f8f9fa; /* fond application */
--ligne:#dadce0; /* bordures */
--texte:#202124;
--sourdine:#5f6368; /* texte secondaire */
--bleu:#1a73e8; /* action principale */
--bleu-fonce:#174ea6;
--bleu-f:#e8f0fe;
--conforme:#188038; --conforme-f:#e6f4ea;
--echec:#d93025; --echec-f:#fce8e6;
--verif:#b06000; --verif-f:#fef7e0;
--manuel:#5f6368; --manuel-f:#f1f3f4;
--erreur:#681da8; --erreur-f:#f3e8fd;
--skip:#80868b; --skip-f:#f1f3f4;
--acier:#1a73e8; /* alias historique -> bleu Google */
--accepte:#1967d2; --accepte-f:#e8f0fe;
--police:'Google Sans Text','Google Sans',Roboto,'Helvetica Neue',Arial,sans-serif;
--police-titre:'Google Sans',Roboto,'Helvetica Neue',Arial,sans-serif;
--ombre-1:0 1px 2px rgba(60,64,67,.30),0 1px 3px 1px rgba(60,64,67,.15);
--ombre-2:0 1px 3px rgba(60,64,67,.30),0 4px 8px 3px rgba(60,64,67,.15);
}
*{box-sizing:border-box}
body{margin:0;background:var(--papier);color:var(--texte);
font-family:var(--police);font-size:14px;line-height:1.5;
min-height:100vh;display:flex;flex-direction:column}
h1,h2,h3{font-family:var(--police-titre);font-weight:500;margin:0}
.mono{font-family:'Roboto Mono',monospace}
button{font-family:var(--police)}
button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,
.lien-bandeau:focus-visible{outline:2px solid var(--bleu);outline-offset:2px}
/* ---- Bandeau (barre d'application blanche, façon console d'admin) ---- */
header{background:#fff;color:var(--texte);padding:12px 24px;border-bottom:1px solid var(--ligne);
display:flex;align-items:center;gap:20px;flex-wrap:wrap;position:sticky;top:0;z-index:5}
header .eyebrow{font-size:11px;letter-spacing:.8px;text-transform:uppercase;
color:var(--sourdine);display:block;margin-bottom:1px;font-weight:500}
header h1{font-size:20px;color:var(--texte);display:flex;align-items:center;gap:10px}
.chip-version{background:#f1f3f4;border-radius:100px;padding:2px 10px;
font-family:'Roboto Mono',monospace;font-size:11px;font-weight:400;color:var(--sourdine)}
header .droite{margin-left:auto;display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.langue{display:flex;border:1px solid var(--ligne);border-radius:100px;overflow:hidden;background:#fff}
.langue button{background:transparent;color:var(--sourdine);border:0;padding:6px 12px;cursor:pointer;
font-size:12px;font-weight:500;transition:all .15s}
.langue button + button{border-left:1px solid var(--ligne)}
.langue button.actif{background:var(--bleu);color:#fff;font-weight:700}
.profil{display:flex;border:1px solid var(--ligne);border-radius:100px;overflow:hidden;background:#fff}
.profil button{background:transparent;color:var(--sourdine);border:0;padding:8px 18px;cursor:pointer;
font-size:13px;font-weight:500}
.profil button + button{border-left:1px solid var(--ligne)}
.profil button.actif{background:var(--bleu-f);color:var(--accepte)}
#btnLancer{background:var(--bleu);color:#fff;border:0;border-radius:100px;
padding:10px 24px;font-family:var(--police-titre);font-weight:500;font-size:14px;cursor:pointer;
box-shadow:none;transition:background .15s,box-shadow .15s}
#btnLancer:hover:not(:disabled){background:var(--bleu-fonce);box-shadow:var(--ombre-1)}
#btnLancer:disabled{background:#f1f3f4;color:#9aa0a6;cursor:default}
#btnArreter{background:#fff;color:var(--echec);border:1px solid var(--ligne);border-radius:100px;
padding:9px 20px;font-family:var(--police-titre);font-weight:500;font-size:13px;cursor:pointer;display:none}
#btnArreter:hover:not(:disabled){background:var(--echec-f)}
#btnArreter:disabled{opacity:.6;cursor:default}
.opt{display:flex;align-items:center;gap:8px;color:var(--sourdine);font-size:13px;cursor:pointer;user-select:none}
.opt input{accent-color:var(--bleu);width:16px;height:16px;cursor:pointer}
.opt input:disabled{cursor:default}
.lien-bandeau{background:transparent;border:0;color:var(--bleu);cursor:pointer;
font-size:13.5px;font-weight:500;text-decoration:none;padding:8px 12px;border-radius:100px}
.lien-bandeau:hover{background:#f6fafe}
/* ---- Corps ---- */
main{display:grid;grid-template-columns:296px 1fr;gap:0;flex:1}
@media(max-width:900px){main{grid-template-columns:1fr}}
aside{padding:24px 20px;background:var(--papier)}
@media(min-width:901px){aside .colle{position:sticky;top:83px}}
/* Anneau de conformité (progress circulaire Material) */
.tampon{width:168px;height:168px;margin:2px auto 16px;position:relative}
.tampon svg{width:100%;height:100%}
.tampon .valeur{position:absolute;inset:0;display:flex;flex-direction:column;
align-items:center;justify-content:center;text-align:center}
.tampon .valeur .pct{font-family:var(--police-titre);font-weight:500;font-size:36px;color:var(--texte)}
.tampon .valeur .lib{font-size:10px;letter-spacing:.4px;color:var(--sourdine);max-width:112px;margin-top:2px}
.anneau-fond{fill:none;stroke:#e8eaed;stroke-width:8}
.anneau-val{fill:none;stroke:var(--conforme);stroke-width:8;stroke-linecap:round;
transition:stroke-dashoffset .5s ease, stroke .3s}
.anneau-ext{fill:none;stroke:transparent;stroke-width:0}
.barre{height:4px;background:#e8eaed;border-radius:2px;overflow:hidden;margin:6px 0 4px}
.barre i{display:block;height:100%;width:0;background:var(--bleu);transition:width .3s}
.barre.indeterminee i{width:100%!important;background:repeating-linear-gradient(
-45deg,var(--bleu),var(--bleu) 8px,#8ab4f8 8px,#8ab4f8 16px);
background-size:200% 100%;animation:defile 1.2s linear infinite}
@keyframes defile{to{background-position:-32px 0}}
.avancement{font-size:12px;color:var(--sourdine)}
.chrono{font-family:'Roboto Mono',monospace;font-size:11.5px;color:var(--sourdine);
margin-top:8px;display:none}
.chrono b{font-weight:500;color:var(--texte)}
.compteurs{margin:18px 0 8px;display:flex;flex-direction:column;gap:3px}
.compteurs button{display:flex;justify-content:space-between;align-items:center;width:100%;
border:0;background:transparent;border-radius:100px;padding:8px 14px;
cursor:pointer;font:inherit;font-size:13px;color:var(--texte)}
.compteurs button:hover{background:#f1f3f4}
.compteurs button.actif{background:var(--bleu-f);color:var(--accepte);font-weight:500}
.compteurs .pastille{width:9px;height:9px;border-radius:50%;display:inline-block;margin-right:10px;vertical-align:-1px}
.compteurs .n{font-family:'Roboto Mono',monospace;font-weight:500}
.meta{border-top:1px solid var(--ligne);margin-top:16px;padding-top:14px;
font-size:12.5px;color:var(--sourdine);display:flex;flex-direction:column;gap:5px}
.meta b{color:var(--texte);font-weight:500}
#btnExport{margin-top:16px;width:100%;background:var(--bleu);color:#fff;border:0;
border-radius:100px;padding:11px;font-family:var(--police-titre);font-weight:500;font-size:14px;
cursor:pointer;display:none;transition:background .15s,box-shadow .15s}
#btnExport:hover:not(:disabled){background:var(--bleu-fonce);box-shadow:var(--ombre-1)}
#btnExport:disabled{background:#f1f3f4;color:#9aa0a6;cursor:default}
#btnEmail{margin-top:8px;width:100%;background:#fff;color:var(--bleu);
border:1px solid var(--ligne);border-radius:100px;padding:10px;
font-family:var(--police-titre);font-weight:500;font-size:14px;cursor:pointer;display:none}
#btnEmail:hover:not(:disabled){background:#f6fafe}
#btnEmail:disabled{opacity:.6;cursor:default}
#btnReinit{margin-top:8px;width:100%;background:transparent;color:var(--sourdine);
border:0;border-radius:100px;padding:9px;font:inherit;font-size:13px;font-weight:500;
cursor:pointer;display:none}
#btnReinit:hover{background:#f1f3f4;color:var(--texte)}
#lienRapport{display:none;margin-top:10px;font-size:13px}
#lienRapport a{color:var(--bleu);font-weight:500;text-decoration:none}
#lienRapport a:hover{text-decoration:underline}
/* ---- Zone registre ---- */
section.registre{padding:20px 24px;overflow-x:auto}
.avertissements{background:var(--verif-f);border:1px solid #fde293;border-left:4px solid #f9ab00;
border-radius:8px;padding:12px 16px;margin-bottom:16px;font-size:13px;color:#3c4043;display:none}
.accueil{max-width:640px;margin:60px auto;text-align:center;color:var(--sourdine)}
.accueil h2{color:var(--texte);font-size:22px;margin-bottom:10px}
.accueil .etapes{display:flex;gap:14px;justify-content:center;margin-top:26px;flex-wrap:wrap}
.accueil .etape{border:1px solid var(--ligne);border-radius:8px;padding:14px 16px;width:186px;
background:#fff;text-align:left;font-size:12.5px}
.accueil .etape b{display:block;font-size:11px;letter-spacing:.5px;text-transform:uppercase;
color:var(--bleu);margin-bottom:5px;font-weight:500}
/* ---- Panneau de collecte (carte Material) ---- */
.collecte{background:#fff;border:1px solid var(--ligne);border-radius:8px;
padding:16px 20px;margin-bottom:16px;display:none;max-width:780px}
.collecte h3{font-size:14.5px;margin-bottom:10px;display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.collecte h3 .mono{font-size:11.5px;color:var(--sourdine);font-weight:400}
.etape-ligne{display:flex;align-items:baseline;gap:10px;padding:7px 0;
font-size:13px;border-bottom:1px solid #f1f3f4}
.etape-ligne:last-child{border-bottom:0}
.etape-ligne .icone{font-family:'Roboto Mono',monospace;width:16px;color:var(--sourdine);text-align:center}
.etape-ligne.cours .icone{color:var(--bleu)}
.etape-ligne.ok .icone{color:var(--conforme);font-weight:bold}
.etape-ligne.ko .icone{color:var(--echec);font-weight:bold}
.etape-ligne .lib{font-weight:500;min-width:260px}
.etape-ligne .info{color:var(--sourdine);font-size:12px;flex:1}
.etape-ligne .duree{font-family:'Roboto Mono',monospace;font-size:11.5px;color:var(--sourdine)}
.spin{display:inline-block;width:10px;height:10px;border:2px solid var(--bleu-f);
border-top-color:var(--bleu);border-radius:50%;animation:tourne .7s linear infinite;
vertical-align:-1px;margin-right:6px}
@keyframes tourne{to{transform:rotate(360deg)}}
/* Mode replié : la collecte terminée prend 1 ligne de synthèse */
.collecte.repliee #listeEtapes{display:none}
.collecte.repliee{padding:10px 18px;margin-bottom:12px}
.collecte.repliee h3{margin-bottom:0;font-size:13px;font-weight:400;color:var(--sourdine)}
.collecte .bascule{margin-left:auto;background:transparent;border:0;color:var(--bleu);
font-size:12.5px;cursor:pointer;padding:2px 8px;border-radius:4px;font-weight:500}
.collecte .bascule:hover{background:var(--bleu-f)}
.collecte .resume{font-size:12.5px;color:var(--texte);margin-left:4px}
/* ---- Tableau du registre ---- */
table#tableau{width:100%;border-collapse:collapse;display:none;background:#fff;
border:1px solid var(--ligne);border-radius:8px;overflow:hidden;box-shadow:none}
table#tableau th{background:#fff;color:var(--sourdine);font-family:var(--police-titre);
font-size:11px;font-weight:500;text-transform:uppercase;letter-spacing:.6px;
padding:12px 14px;border-bottom:1px solid var(--ligne);text-align:left;position:sticky;top:57px;z-index:2}
table#tableau td{padding:10px 14px;border-bottom:1px solid #f1f3f4;vertical-align:top;font-size:13px}
table#tableau tr.section td{background:#f8f9fa;color:var(--encre);font-family:var(--police-titre);
font-weight:500;font-size:12px;letter-spacing:.3px;padding:10px 14px;
border-top:1px solid var(--ligne);border-bottom:1px solid var(--ligne)}
table#tableau tr:hover:not(.section){background:#f8fafd}
table#tableau tr.cache{display:none}
table#tableau tr.nouveau{animation:flash .8s ease}
@keyframes flash{0%{background:#e8f0fe}100%{background:transparent}}
table#tableau tr.encours td{background:#f6fafe}
.id{font-family:'Roboto Mono',monospace;font-size:12px;font-weight:500;color:var(--bleu);width:90px}
.niveau{font-size:11.5px;color:var(--sourdine);width:50px}
.titre{font-weight:500;width:30%}
.statut{width:140px}
.constat{color:var(--texte);font-size:12.5px;line-height:1.45}
.constat details{margin-top:4px}
.constat details summary{cursor:pointer;color:var(--bleu);font-size:12px;user-select:none}
.constat details summary:hover{text-decoration:underline}
.constat details div{margin-top:4px;padding:6px 8px;background:#f8f9fa;border-radius:4px;
font-family:'Roboto Mono',monospace;font-size:11.5px;color:var(--texte);white-space:pre-wrap;word-break:break-all}
.constat details .remede{margin-top:6px;font-family:var(--police);font-size:12px;color:var(--sourdine);background:none;padding:0}
.badge{display:inline-block;padding:3px 10px;border-radius:100px;font-size:11px;
font-weight:500;letter-spacing:.3px;white-space:nowrap}
.b-CONFORME,.b-COMPLIANT{background:var(--conforme-f);color:var(--conforme)}
.b-NONCONFORME,.b-NON-COMPLIANT{background:var(--echec-f);color:var(--echec)}
.b-AVERIFIER,.b-TOREVIEW{background:var(--verif-f);color:var(--verif)}
.b-MANUEL,.b-MANUAL{background:var(--manuel-f);color:var(--manuel)}
.b-ERREUR,.b-ERROR{background:var(--erreur-f);color:var(--erreur)}
.b-HORSPROFIL,.b-OUTOFPROFILE{background:var(--skip-f);color:var(--skip)}
.b-ECARTACCEPTE,.b-ACCEPTEDDEVIATION{background:var(--accepte-f);color:var(--accepte)}
.b-attente{background:#f1f3f4;color:var(--sourdine)}
.b-cours{background:var(--bleu-f);color:var(--bleu)}
/* ---- Journal ---- */
details.journal{background:#fff;border:1px solid var(--ligne);border-radius:8px;
margin-bottom:16px;max-width:780px}
details.journal summary{padding:10px 16px;cursor:pointer;font-weight:500;font-size:12.5px;
color:var(--sourdine);user-select:none}
details.journal pre{margin:0;padding:12px 16px;max-height:160px;overflow-y:auto;
background:#202124;color:#e8eaed;font-family:'Roboto Mono',monospace;font-size:11px;
line-height:1.5;border-radius:0 0 8px 8px}
details.journal pre span.ok{color:#81c995}
details.journal pre span.err{color:#f28b82}
/* ---- Pied de page sticky ---- */
footer{background:#fff;border-top:1px solid var(--ligne);padding:10px 24px;
display:flex;align-items:center;gap:18px;font-size:12px;color:var(--sourdine);
flex-wrap:wrap;position:sticky;bottom:0;z-index:4;box-shadow:0 -1px 3px rgba(60,64,67,.08)}
footer a{color:var(--bleu);text-decoration:none}
footer a:hover{text-decoration:underline}
footer .bloc-version{display:flex;align-items:center;gap:6px;font-weight:500;color:var(--texte)}
footer .bloc-version .num{font-family:'Roboto Mono',monospace;font-size:11px;background:#f1f3f4;
padding:1px 6px;border-radius:4px;color:var(--sourdine);font-weight:normal}
footer .mention{margin-left:auto;font-size:11px;color:#80868b}
@media(max-width:900px){footer .mention{margin-left:0;width:100%}}
/* ---- Dialogue Guide ---- */
dialog#modalGuide, dialog#modalAPropos{border:0;border-radius:12px;padding:0;max-width:720px;width:90vw;
box-shadow:var(--ombre-2);background:#fff;color:var(--texte)}
dialog#modalGuide::backdrop, dialog#modalAPropos::backdrop, dialog#modalDerog::backdrop, dialog#modalEmail::backdrop{background:rgba(32,33,36,.5)}
.modal-tete{background:#fff;padding:18px 24px 14px;border-bottom:1px solid var(--ligne);
font-family:var(--police-titre);font-size:17px;font-weight:500;display:flex;align-items:center;gap:10px}
.guide-corps{padding:20px 24px;max-height:70vh;overflow-y:auto;font-size:13px;line-height:1.6}
.guide-corps h3{font-size:14px;margin:16px 0 6px;color:var(--texte)}
.guide-corps h3:first-child{margin-top:0}
.guide-corps p{margin:0 0 10px;color:var(--sourdine)}
.guide-corps table{width:100%;border-collapse:collapse;margin:8px 0 14px}
.guide-corps td{padding:6px 8px;font-size:12.5px;vertical-align:top;border-bottom:1px solid #f1f3f4}
.guide-corps td:first-child{width:130px}
.modal-pied{padding:12px 24px;border-top:1px solid var(--ligne);display:flex;justify-content:flex-end;gap:8px}
.modal-pied button.principal{background:var(--bleu);color:#fff;border:0;border-radius:100px;
padding:8px 20px;cursor:pointer;font-weight:500;font-size:13px}
.modal-pied button.principal:hover{background:var(--bleu-fonce)}
.modal-pied button.secondaire{background:transparent;color:var(--sourdine);border:1px solid var(--ligne);
border-radius:100px;padding:8px 18px;cursor:pointer;font-weight:500;font-size:13px}
.modal-pied button.secondaire:hover{background:#f1f3f4;color:var(--texte)}
/* ---- Dialogue Dérogations ---- */
dialog#modalDerog, dialog#modalEmail{border:0;border-radius:12px;padding:0;max-width:540px;width:92vw;
box-shadow:var(--ombre-2);background:#fff;color:var(--texte)}
.modal-corps{padding:18px 24px;font-size:13px;display:flex;flex-direction:column;gap:14px}
.modal-bloc{display:flex;flex-direction:column;gap:5px}
.modal-bloc .etiquette{font-size:11.5px;font-weight:500;color:var(--sourdine);text-transform:uppercase;letter-spacing:.4px}
.ctrl-ref{font-family:'Roboto Mono',monospace;color:var(--bleu);font-weight:500}
.bloc-risque{background:var(--echec-f);border-left:3px solid var(--echec);padding:8px 12px;
border-radius:0 4px 4px 0;font-size:12.5px;color:#5c100b;line-height:1.45}
.bloc-constat{background:#f8f9fa;border-left:3px solid var(--ligne);padding:8px 12px;
border-radius:0 4px 4px 0;font-family:'Roboto Mono',monospace;font-size:11.5px;color:var(--texte);
word-break:break-all;max-height:80px;overflow-y:auto}
.modal-bloc textarea{width:100%;min-height:72px;border:1px solid var(--ligne);border-radius:6px;
padding:8px 10px;font-family:inherit;font-size:13px;resize:vertical}
.modal-bloc select{border:1px solid var(--ligne);border-radius:6px;padding:8px 10px;
font-family:inherit;font-size:13px;background:#fff}
.champ-email{width:100%;border:1px solid var(--ligne);border-radius:6px;padding:8px 10px;
font-family:inherit;font-size:13px}
.cases-email{gap:8px}
.cases-email label{display:flex;align-items:center;gap:8px;cursor:pointer;font-size:13px;user-select:none}
.cases-email input{accent-color:var(--bleu);width:15px;height:15px}
.modal-erreur{color:var(--echec);font-size:12px;margin-right:auto;align-self:center;display:none}
/* ---- Lignes du registre : boutons d'action ---- */
.actions-ligne{margin-top:6px;display:flex;gap:6px;flex-wrap:wrap}
.btn-accepter{background:var(--accepte-f);color:var(--accepte);border:0;border-radius:100px;
padding:3px 10px;font-size:11px;font-weight:500;cursor:pointer;font-family:inherit}
.btn-accepter:hover{background:#d2e3fc}
.derog-info{margin-top:6px;padding:6px 10px;background:var(--accepte-f);border-left:3px solid var(--accepte);
border-radius:0 4px 4px 0;font-size:11.5px;color:#0d47a1;line-height:1.4}
.btn-revoquer{background:transparent;border:0;color:var(--echec);cursor:pointer;
font-size:11px;font-weight:500;margin-left:8px;padding:0;text-decoration:underline}
.btn-revoquer:hover{color:#b3261e}
</style>
</head>
<body>
<header>
<div>
<span class="eyebrow">CIS Benchmark v1.4 · Google Workspace Foundations</span>
<h1><span data-i18n="titreApp">Registre d'audit de conformité</span> <span class="chip-version">v<?= version ?></span></h1>
</div>
<div class="droite">
<div class="langue" role="group" aria-label="Langue / Language">
<button type="button" id="btnLangFr" class="actif" onclick="changerLangue('fr')">FR</button>
<button type="button" id="btnLangEn" onclick="changerLangue('en')">EN</button>
</div>
<button type="button" class="lien-bandeau" id="btnAPropos" onclick="ouvrirAPropos()" data-i18n="btnAPropos">À propos</button>
<button type="button" class="lien-bandeau" id="btnGuide" onclick="ouvrirGuide()" data-i18n="btnGuide">Guide</button>
<label class="opt" id="labelOptReglages" title="Lecture des réglages de confidentialité de chaque groupe (Groups Settings API). Sur un gros tenant (>2000 groupes), compter ~10 min avec 4 lots en parallèle. Si décoché, les contrôles 3.1.6.x s'appuient uniquement sur la Policy API.">
<input type="checkbox" id="optReglages" checked> <span data-i18n="optReglages">Réglages par groupe</span>
</label>
<div class="profil" role="group" aria-label="Profil d'audit">
<button type="button" id="pL1" onclick="choisirProfil('L1')" data-i18n="profilL1">Niveau 1</button>
<button type="button" id="pL2" class="actif" onclick="choisirProfil('L2')" data-i18n="profilL2">Niveaux 1+2</button>
</div>
<button type="button" id="btnArreter" onclick="demanderArret()" data-i18n="btnArreter">Arrêter</button>
<button type="button" id="btnLancer" onclick="lancerAudit()" data-i18n="btnLancer">Lancer l'audit</button>
</div>
</header>
<main>
<aside>
<div class="colle">
<div class="tampon" aria-hidden="true">
<svg viewBox="0 0 120 120">
<circle class="anneau-ext" cx="60" cy="60" r="57"/>
<circle class="anneau-fond" cx="60" cy="60" r="48"/>
<circle id="anneauVal" class="anneau-val" cx="60" cy="60" r="48"
stroke-dasharray="301.6" stroke-dashoffset="301.6"
transform="rotate(-90 60 60)"/>
</svg>
<div class="valeur">
<span class="pct" id="scorePct">—</span>
<span class="lib" data-i18n="scoreLib">Conformité résiduelle (écarts acceptés exclus)</span>
</div>
</div>
<div class="avancement" id="scoreBrut" style="text-align:center;margin:-10px 0 10px"></div>
<div class="barre" id="barreAvConteneur" role="progressbar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0" aria-describedby="txtAv"><i id="barreAv"></i></div>
<div class="avancement" id="txtAv" data-i18n="attenteLancement" role="status">En attente de lancement</div>
<div class="chrono" id="chrono"><span data-i18n="chronoEcoule">Écoulé</span> : <b id="chronoVal">00:00</b> · <span data-i18n="chronoBattement">dernier retour serveur il y a</span> <b id="battement">0 s</b></div>
<div class="compteurs" id="compteurs" role="group" aria-label="Filtrer par statut"></div>
<div class="meta" id="metaTenant"></div>
<button type="button" id="btnExport" onclick="exporterSheets()" data-i18n="btnExport">Générer le rapport Sheets</button>
<div id="lienRapport"></div>
<button type="button" id="btnEmail" onclick="ouvrirEmail()" data-i18n="btnEmail">Envoyer par e-mail…</button>
<button type="button" id="btnReinit" onclick="location.reload()" data-i18n="btnReinit">Réinitialiser (nouvel audit)</button>
</div>
</aside>
<section class="registre">
<div class="avertissements" id="avertissements"></div>
<div class="collecte" id="panneauCollecte">
<h3><span data-i18n="collecteTitre">Phase 1 — Collecte du contexte</span> <span class="mono" id="collecteEtat">démarrage…</span>
<span class="resume" id="collecteResume"></span>
<button type="button" class="bascule" id="btnBasculeCollecte" onclick="basculerCollecte()" data-i18n="btnDetails">Détails</button>
</h3>
<div id="listeEtapes"></div>
</div>
<details class="journal" id="journal" style="display:none" open>
<summary data-i18n="journalTitre">Journal d'exécution</summary>
<pre id="journalCorps"></pre>
</details>
<div class="accueil" id="accueil">
<h2 data-i18n="accueilTitre">87 contrôles, exécutés et affichés un par un</h2>
<p data-i18n="accueilDesc">Choisissez le profil (Niveau 1 seul ou complet), puis lancez l'audit avec un compte super administrateur. Chaque résultat s'inscrit au registre dès que le contrôle est terminé.</p>
<div class="etapes">
<div class="etape"><b data-i18n="etape1Titre">Phase 1</b><span data-i18n="etape1Desc">Collecte unique : politiques Cloud Identity, unités organisationnelles, super administrateurs, utilisateurs, domaines, groupes.</span></div>
<div class="etape"><b data-i18n="etape2Titre">Phase 2</b><span data-i18n="etape2Desc">Exécution des contrôles en parallèle, résultat affiché au fil de l'eau.</span></div>
<div class="etape"><b data-i18n="etape3Titre">Phase 3</b><span data-i18n="etape3Desc">Export facultatif du rapport complet en Google Sheets.</span></div>
</div>
</div>
<table id="tableau">
<thead><tr>
<th data-i18n="thId">ID</th>
<th data-i18n="thNiv">Niv.</th>
<th data-i18n="thCtrl">Contrôle</th>
<th data-i18n="thStatut">Statut</th>
<th data-i18n="thConstat">Constat</th>
</tr></thead>
<tbody id="corps"></tbody>
</table>
</section>
</main>
<footer>
<span class="bloc-version"><span data-i18n="footerNom">Registre d'audit CIS Workspace</span><span class="num" id="appVersion">v<?= version ?></span></span>
<span><span data-i18n="footerRef">Référentiel</span> : <a href="https://www.cisecurity.org/benchmark/google_workspace" target="_blank" rel="noopener">CIS Google Workspace Foundations Benchmark v1.4</a></span>
<span><span data-i18n="footerDev">Développé par</span> <a href="https://faucheux.bzh" target="_blank" rel="noopener"><b>Fabrice Faucheux</b> (faucheux.bzh)</a></span>
<button type="button" class="lien-bandeau" onclick="ouvrirGuide()" data-i18n="btnGuideFooter">Guide d'utilisation</button>
<button type="button" class="lien-bandeau" onclick="ouvrirAPropos()" data-i18n="btnAProposFooter">À propos</button>
<span class="mention" data-i18n="footerMention">Outil interne d'aide à l'évaluation, non affilié au Center for Internet Security®. Le document officiel du benchmark (PDF) est diffusé par le CIS sur son site ; il fait foi pour l'interprétation des recommandations.</span>
</footer>
<!-- Modale À propos -->
<dialog id="modalAPropos" aria-labelledby="aProposTitre">
<div class="modal-tete" id="aProposTitre" data-i18n="aProposTitre">À propos — Registre d'audit CIS Google Workspace</div>
<div class="guide-corps">
<h3 data-i18n="aProposOutilTitre">L'outil d'audit</h3>
<p data-i18n="aProposOutilDesc">Cet outil automatisé évalue la configuration d'un tenant Google Workspace contre les 86 recommandations officielles du <b>CIS Google Workspace Foundations Benchmark v1.4</b>, fournissant un état des lieux exhaustif, un calcul de conformité résiduelle et un plan d'actions priorisé.</p>
<h3 data-i18n="aProposDevTitre">Développeur</h3>
<p><b>Fabrice Faucheux</b><br>
Site web : <a href="https://faucheux.bzh" target="_blank" rel="noopener">https://faucheux.bzh</a>
</p>
<h3 data-i18n="aProposSecuTitre">Sécurité & Confidentialité</h3>
<p data-i18n="aProposSecuDesc">L'audit s'exécute entièrement dans le périmètre Google Workspace de votre organisation via Google Apps Script (exécution en lecture seule). Aucun secret, clé API ou donnée sensible n'est transféré vers des serveurs tiers.</p>
</div>
<div class="modal-pied">
<button type="button" class="principal" onclick="fermerAPropos()" data-i18n="btnFermer">Fermer</button>
</div>
</dialog>
<!-- Modale Guide -->
<dialog id="modalGuide" aria-labelledby="guideTitre">
<div class="modal-tete" id="guideTitre" data-i18n="guideTitre">Guide — Audit CIS Google Workspace</div>
<div class="guide-corps" id="guideCorps">
<!-- Contenu injecté dynamiquement selon la langue -->
</div>
<div class="modal-pied">
<button type="button" class="principal" onclick="fermerGuide()" data-i18n="btnFermer">Fermer</button>
</div>
</dialog>
<!-- Modale E-mail -->
<dialog id="modalEmail" aria-labelledby="emailTitre">
<div class="modal-tete" id="emailTitre" data-i18n="emailTitre">Envoyer les résultats par e-mail</div>
<div class="modal-corps">
<div class="modal-bloc">
<span class="etiquette" data-i18n="emailDestLabel">Destinataires (séparés par des virgules)</span>
<input type="text" class="champ-email" id="emailDest" placeholder="admin@domain.com, rssi@domain.com">
</div>
<div class="modal-bloc">
<span class="etiquette" data-i18n="emailObjetLabel">Objet</span>
<input type="text" class="champ-email" id="emailObjet">
</div>
<div class="modal-bloc">
<span class="etiquette" data-i18n="emailMsgLabel">Message d'accompagnement (facultatif)</span>
<textarea class="champ-email" id="emailMessage" data-i18n-ph="emailMsgPh" placeholder="Contexte, décisions attendues, échéances…"></textarea>
</div>
<div class="modal-bloc cases-email">
<label><input type="checkbox" id="emailLien" checked> <span data-i18n="emailJoindreLien">Générer le rapport Google Sheets et joindre son lien</span></label>
<label><input type="checkbox" id="emailDetails" checked> <span data-i18n="emailInclureDetails">Inclure la liste des écarts à corriger dans le corps du message</span></label>
</div>
</div>
<div class="modal-pied">
<span class="modal-erreur" id="emailErreur"></span>
<button type="button" class="secondaire" onclick="fermerEmail()" data-i18n="btnAnnuler">Annuler</button>
<button type="button" class="principal" id="emailEnvoyer" onclick="confirmerEnvoiEmail()" data-i18n="btnEnvoyer">Envoyer</button>
</div>
</dialog>
<!-- Modale Dérogation -->
<dialog id="modalDerog" aria-labelledby="modalTitre">
<div class="modal-tete" id="modalTitre" data-i18n="derogTitre">Accepter un écart en connaissance de cause</div>
<div class="modal-corps">
<div><span class="ctrl-ref" id="derogRef"></span> — <span id="derogTitreCtrl"></span></div>
<div class="modal-bloc">
<span class="etiquette" data-i18n="derogRisqueLabel">Risque assumé en acceptant cet écart</span>
<div class="bloc-risque" id="derogRisque"></div>
</div>
<div class="modal-bloc">
<span class="etiquette" data-i18n="derogConstatLabel">Constat de l'audit</span>
<div class="bloc-constat" id="derogConstat"></div>
</div>
<div class="modal-bloc">
<span class="etiquette" data-i18n="derogMotifLabel">Motif de la dérogation (obligatoire — compensations, contexte métier…)</span>
<textarea id="derogMotif" data-i18n-ph="derogMotifPh" placeholder="Ex. : transfert automatique requis par l'outil X ; mesure compensatoire : règle de routage limitée au domaine partenaire, revue trimestrielle."></textarea>
</div>
<div class="modal-bloc">
<span class="etiquette" data-i18n="derogDureeLabel">Échéance de révision</span>
<select id="derogDuree">
<option value="3" data-i18n="duree3m">Dans 3 mois</option>
<option value="6" selected data-i18n="duree6m">Dans 6 mois</option>
<option value="12" data-i18n="duree12m">Dans 12 mois</option>
<option value="0" data-i18n="dureePerm">Permanente (revue à chaque audit)</option>
</select>
</div>
</div>
<div class="modal-pied">
<span class="modal-erreur" id="derogErreur"></span>
<button type="button" class="secondaire" onclick="fermerModale()" data-i18n="btnAnnuler">Annuler</button>
<button type="button" class="principal" id="derogConfirmer" onclick="confirmerAcceptation()" data-i18n="btnAccepter">Accepter l'écart</button>
</div>
</dialog>
<script>
// =========================================================================
// DICTIONNAIRE I18N CENTRALISÉ (FRANÇAIS / ANGLAIS)
// =========================================================================
const I18N = {
fr: {
titreApp: 'Registre d\'audit de conformité',
btnAPropos: 'À propos',
btnGuide: 'Guide',
optReglages: 'Réglages par groupe',
profilL1: 'Niveau 1',
profilL2: 'Niveaux 1+2',
btnArreter: 'Arrêter',
btnLancer: 'Lancer l\'audit',
btnRelancer: 'Relancer l\'audit',
btnReprendre: 'Reprendre l\'audit',
scoreLib: 'Conformité résiduelle (écarts acceptés exclus)',
attenteLancement: 'En attente de lancement',
chronoEcoule: 'Écoulé',
chronoBattement: 'dernier retour serveur il y a',
btnExport: 'Générer le rapport Sheets',
btnEmail: 'Envoyer par e-mail…',
btnReinit: 'Réinitialiser (nouvel audit)',
collecteTitre: 'Phase 1 — Collecte du contexte',
btnDetails: 'Détails',
btnReplier: 'Replier',
journalTitre: 'Journal d\'exécution',
accueilTitre: '87 contrôles, exécutés et affichés un par un',
accueilDesc: 'Choisissez le profil (Niveau 1 seul ou complet), puis lancez l\'audit avec un compte super administrateur. Chaque résultat s\'inscrit au registre dès que le contrôle est terminé.',
etape1Titre: 'Phase 1',
etape1Desc: 'Collecte unique : politiques Cloud Identity, unités organisationnelles, super administrateurs, utilisateurs, domaines, groupes.',
etape2Titre: 'Phase 2',
etape2Desc: 'Exécution des contrôles en parallèle, résultat affiché au fil de l\'eau.',
etape3Titre: 'Phase 3',
etape3Desc: 'Export facultatif du rapport complet en Google Sheets.',
thId: 'ID',
thNiv: 'Niv.',
thCtrl: 'Contrôle',
thStatut: 'Statut',
thConstat: 'Constat',
footerNom: 'Registre d\'audit CIS Workspace',
footerRef: 'Référentiel',
footerDev: 'Développé par',
btnGuideFooter: 'Guide d\'utilisation',
btnAProposFooter: 'À propos',
footerMention: 'Outil interne d\'aide à l\'évaluation, non affilié au Center for Internet Security®. Le document officiel du benchmark (PDF) est diffusé par le CIS sur son site ; il fait foi pour l\'interprétation des recommandations.',
aProposTitre: 'À propos — Registre d\'audit CIS Google Workspace',
aProposOutilTitre: 'L\'outil d\'audit',
aProposOutilDesc: 'Cet outil automatisé évalue la configuration d\'un tenant Google Workspace contre les 86 recommandations officielles du <b>CIS Google Workspace Foundations Benchmark v1.4</b>, fournissant un état des lieux exhaustif, un calcul de conformité résiduelle et un plan d\'actions priorisé.',
aProposDevTitre: 'Développeur',
aProposSecuTitre: 'Sécurité & Confidentialité',
aProposSecuDesc: 'L\'audit s\'exécute entièrement dans le périmètre Google Workspace de votre organisation via Google Apps Script (exécution en lecture seule). Aucun secret, clé API ou donnée sensible n\'est transféré vers des serveurs tiers.',
guideTitre: 'Guide — Audit CIS Google Workspace',
btnFermer: 'Fermer',
btnAnnuler: 'Annuler',
btnEnvoyer: 'Envoyer',
btnAccepter: 'Accepter l\'écart',
emailTitre: 'Envoyer les résultats par e-mail',
emailDestLabel: 'Destinataires (séparés par des virgules)',
emailObjetLabel: 'Objet',
emailMsgLabel: 'Message d\'accompagnement (facultatif)',
emailMsgPh: 'Contexte, décisions attendues, échéances…',
emailJoindreLien: 'Générer le rapport Google Sheets et joindre son lien',
emailInclureDetails: 'Inclure la liste des écarts à corriger dans le corps du message',
derogTitre: 'Accepter un écart en connaissance de cause',
derogRisqueLabel: 'Risque assumé en acceptant cet écart',
derogConstatLabel: 'Constat de l\'audit',
derogMotifLabel: 'Motif de la dérogation (obligatoire — compensations, contexte métier…)',
derogMotifPh: 'Ex. : transfert automatique requis par l\'outil X ; mesure compensatoire : règle de routage limitée au domaine partenaire, revue trimestrielle.',
derogDureeLabel: 'Échéance de révision',
duree3m: 'Dans 3 mois',
duree6m: 'Dans 6 mois',
duree12m: 'Dans 12 mois',
dureePerm: 'Permanente (revue à chaque audit)',
statuts: {
'CONFORME': 'CONFORME',
'NON CONFORME': 'NON CONFORME',
'ÉCART ACCEPTÉ': 'ÉCART ACCEPTÉ',
'À VÉRIFIER': 'À VÉRIFIER',
'MANUEL': 'MANUEL',
'ERREUR': 'ERREUR',
'HORS PROFIL': 'HORS PROFIL'
},
sections: [
['6.', '6 — Règles d\'alertes administrateur'],
['5.', '5 — Revue des rapports'],
['4.3', '4.3 — Supervision de la sécurité'],
['4.2', '4.2 — Contrôles d\'accès'],
['4.1', '4.1 — Authentification'],
['3.1.9', '3.1.9 — Marketplace'],
['3.1.8', '3.1.8 — Services Google supplémentaires'],
['3.1.7', '3.1.7 — Sites'],
['3.1.6', '3.1.6 — Groups for Business'],
['3.1.4', '3.1.4 — Google Chat'],
['3.1.3', '3.1.3 — Gmail'],
['3.1.2.3', '3.1.2.3 — Google Drive for desktop'],
['3.1.2', '3.1.2 — Drive et Docs'],
['3.1.1', '3.1.1 — Agenda'],
['1.2', '1.2 — Annuaire'],
['1.1', '1.1 — Comptes super administrateur']
],
etapesCollecte: {
domaines: 'Domaines du tenant',
dns: 'Enregistrements DNS (SPF, DKIM, DMARC)',
unites: 'Unités organisationnelles',
admins: 'Super administrateurs',
politiques: 'Politiques Cloud Identity (réglages console)',
utilisateurs: 'Utilisateurs (admins, état 2SV)',
groupes: 'Liste des groupes',
reglages: 'Réglages de confidentialité des groupes'
},
btnAccepterEcart: 'Accepter l\'écart…',
btnRevoquer: 'Révoquer',
derogAccepteePar: 'Écart accepté par ',
derogLe: ' le ',
derogReviser: ' — à réviser le ',
derogPermanente: ' — permanente',
derogMotifPrefix: '.<br>Motif : ',
remedeRisqueCouvert: 'Risque couvert : ',
remedeRemediation: 'Remédiation : ',
remedeDetail: 'Détail',
scoreBrutSuffix: 'brut : ',
scoreBrutEcarts: ' écart(s) accepté(s)',
enCoursCollecteTxt: 'Phase 1 — collecte du contexte…',
enCoursControlesTxt: 'Phase 2 — exécution des contrôles…',
controlesTerminesTxt: 'contrôles terminés',
rapportCreeTxt: 'Rapport créé : ',
ouvrirSheetsTxt: 'ouvrir le Google Sheets'
},
en: {
titreApp: 'Compliance Audit Registry',
btnAPropos: 'About',
btnGuide: 'Guide',
optReglages: 'Per-group settings',
profilL1: 'Level 1',
profilL2: 'Levels 1+2',
btnArreter: 'Stop',
btnLancer: 'Start audit',
btnRelancer: 'Rerun audit',
btnReprendre: 'Resume audit',
scoreLib: 'Residual compliance (accepted deviations excluded)',
attenteLancement: 'Waiting to start',
chronoEcoule: 'Elapsed',
chronoBattement: 'last server heartbeat',
btnExport: 'Generate Sheets report',
btnEmail: 'Send by email…',
btnReinit: 'Reset (new audit)',
collecteTitre: 'Phase 1 — Context collection',
btnDetails: 'Details',
btnReplier: 'Collapse',
journalTitre: 'Execution log',
accueilTitre: '87 controls, executed and displayed one by one',
accueilDesc: 'Choose your profile (Level 1 only or full Level 1+2), then launch the audit with a super administrator account. Each finding is displayed as soon as evaluation completes.',
etape1Titre: 'Phase 1',
etape1Desc: 'Single collection: Cloud Identity policies, organizational units, super administrators, users, domains, groups.',
etape2Titre: 'Phase 2',
etape2Desc: 'Parallel controls execution with real-time streaming results.',
etape3Titre: 'Phase 3',
etape3Desc: 'Optional export to a complete Google Sheets report.',
thId: 'ID',
thNiv: 'Lvl.',
thCtrl: 'Control',
thStatut: 'Status',
thConstat: 'Finding',
footerNom: 'CIS Workspace Audit Registry',
footerRef: 'Framework',
footerDev: 'Developed by',
btnGuideFooter: 'User guide',
btnAProposFooter: 'About',
footerMention: 'Internal evaluation aid tool, not affiliated with the Center for Internet Security®. Official CIS benchmark documentation remains the authoritative reference.',
aProposTitre: 'About — CIS Google Workspace Audit Registry',
aProposOutilTitre: 'The Audit Tool',
aProposOutilDesc: 'This automated tool audits a Google Workspace tenant configuration against the 86 official recommendations from the <b>CIS Google Workspace Foundations Benchmark v1.4</b>, providing full inventory, residual compliance scoring, and a prioritized action plan.',
aProposDevTitre: 'Developer',
aProposSecuTitre: 'Security & Privacy',
aProposSecuDesc: 'The audit runs entirely within your organization\'s Google Workspace tenant via Google Apps Script (read-only execution). No secrets, API keys, or tenant data are ever sent to external third-party servers.',
guideTitre: 'Guide — CIS Google Workspace Audit',
btnFermer: 'Close',
btnAnnuler: 'Cancel',
btnEnvoyer: 'Send',
btnAccepter: 'Accept gap',
emailTitre: 'Send results by email',
emailDestLabel: 'Recipients (comma separated)',
emailObjetLabel: 'Subject',
emailMsgLabel: 'Cover message (optional)',
emailMsgPh: 'Context, decisions needed, deadlines…',
emailJoindreLien: 'Generate Google Sheets report and attach link',
emailInclureDetails: 'Include list of non-compliant gaps in message body',
derogTitre: 'Formally accept security deviation',
derogRisqueLabel: 'Risk assumed by accepting this gap',
derogConstatLabel: 'Audit finding',
derogMotifLabel: 'Deviation rationale (mandatory — compensatory controls, business context…)',
derogMotifPh: 'E.g.: automatic forwarding required by Tool X; compensatory control: routing rule restricted to partner domain, quarterly review.',
derogDureeLabel: 'Review deadline',
duree3m: 'In 3 months',
duree6m: 'In 6 months',
duree12m: 'In 12 months',
dureePerm: 'Permanent (reviewed at each audit)',
statuts: {
'CONFORME': 'COMPLIANT',
'NON CONFORME': 'NON-COMPLIANT',
'ÉCART ACCEPTÉ': 'ACCEPTED DEVIATION',
'À VÉRIFIER': 'TO REVIEW',
'MANUEL': 'MANUAL',
'ERREUR': 'ERROR',
'HORS PROFIL': 'OUT OF PROFILE'
},
sections: [
['6.', '6 — Administrator Alert Rules'],
['5.', '5 — Reporting Reviews'],
['4.3', '4.3 — Security Center Supervision'],
['4.2', '4.2 — Access and Data Control'],
['4.1', '4.1 — Authentication'],
['3.1.9', '3.1.9 — Google Workspace Marketplace'],
['3.1.8', '3.1.8 — Additional Google Services'],
['3.1.7', '3.1.7 — Google Sites'],
['3.1.6', '3.1.6 — Groups for Business'],
['3.1.4', '3.1.4 — Google Chat'],
['3.1.3', '3.1.3 — Gmail'],
['3.1.2.3', '3.1.2.3 — Google Drive for desktop'],
['3.1.2', '3.1.2 — Drive and Docs'],
['3.1.1', '3.1.1 — Calendar'],
['1.2', '1.2 — Directory Settings'],
['1.1', '1.1 — Super Admin Accounts']
],
etapesCollecte: {
domaines: 'Tenant domains',
dns: 'DNS records (SPF, DKIM, DMARC)',
unites: 'Organizational units',
admins: 'Super administrators',
politiques: 'Cloud Identity policies (admin settings)',
utilisateurs: 'Users (admins, 2SV enforcement)',
groupes: 'Groups list',
reglages: 'Group privacy and sharing settings'
},
btnAccepterEcart: 'Accept gap…',
btnRevoquer: 'Revoke',
derogAccepteePar: 'Gap accepted by ',
derogLe: ' on ',
derogReviser: ' — review date: ',
derogPermanente: ' — permanent',
derogMotifPrefix: '.<br>Rationale: ',
remedeRisqueCouvert: 'Mitigated risk: ',
remedeRemediation: 'Remediation: ',
remedeDetail: 'Details',
scoreBrutSuffix: 'raw: ',
scoreBrutEcarts: ' accepted gap(s)',
enCoursCollecteTxt: 'Phase 1 — context collection…',
enCoursControlesTxt: 'Phase 2 — controls execution…',
controlesTerminesTxt: 'controls completed',
rapportCreeTxt: 'Report created: ',
ouvrirSheetsTxt: 'open Google Sheets'
}
};
const GUIDE_HTML = {
fr: `
<h3>Le référentiel</h3>
<p>Cet outil vérifie automatiquement le tenant Google Workspace contre les <b>86 recommandations</b> du
<a href="https://www.cisecurity.org/benchmark/google_workspace" target="_blank" rel="noopener">CIS Google Workspace Foundations Benchmark v1.4</a>,
référentiel de configuration sécurisée publié par le Center for Internet Security. Le PDF officiel se télécharge
gratuitement depuis cette page (inscription CIS demandée) ; les identifiants affichés ici (ex. <code>3.1.3.5.2</code>)
renvoient aux sections correspondantes du document, qui détaille pour chaque point la justification, l'audit et la remédiation.</p>
<h3>Profils Niveau 1 / Niveaux 1+2</h3>
<p><b>Niveau 1</b> : socle de sécurité essentiel, applicable à la plupart des organisations avec un impact
fonctionnel limité. <b>Niveau 2</b> : durcissement pour environnements exigeants (défense en profondeur),
pouvant restreindre certains usages (ex. Drive pour ordinateur, POP/IMAP). Le sélecteur du bandeau
détermine les contrôles exécutés ; les contrôles N2 hors profil sont classés « HORS PROFIL ».</p>
<h3>Déroulé d'un audit</h3>
<p><b>Phase 1 — Collecte</b> : lecture unique du contexte (politiques Cloud Identity, utilisateurs et 2SV, domaines,
groupes). Le panneau affiche chaque étape avec son avancement. L'option « Réglages par groupe » lit la
confidentialité de chaque groupe (plus long ; décochable, les contrôles 3.1.6.x s'appuient alors sur la seule Policy API).<br>
<b>Phase 2 — Contrôles</b> : les 87 vérifications s'exécutent en parallèle, chaque résultat s'inscrit au registre dès
qu'il est connu.<br>
<b>Phase 3 — Export</b> : génération du rapport Google Sheets (synthèse, détail, plan d'actions, registre des
dérogations, politiques brutes).</p>
<h3>Lecture des statuts</h3>
<table>
<tr><td><span class="badge b-CONFORME">CONFORME</span></td><td>la configuration relevée correspond à la recommandation.</td></tr>
<tr><td><span class="badge b-NONCONFORME">NON CONFORME</span></td><td>écart avéré — à corriger (plan d'actions) ou à accepter formellement.</td></tr>
<tr><td><span class="badge b-ECARTACCEPTE">ÉCART ACCEPTÉ</span></td><td>dérogation enregistrée au registre : motif, acceptant, échéance de révision.</td></tr>
<tr><td><span class="badge b-AVERIFIER">À VÉRIFIER</span></td><td>données collectées mais jugement humain requis, ou réglage non interprétable automatiquement.</td></tr>
<tr><td><span class="badge b-MANUEL">MANUEL</span></td><td>non exposé par API (revues de tableaux de bord, règles d'alertes…) — le chemin console est indiqué.</td></tr>
<tr><td><span class="badge b-ERREUR">ERREUR</span></td><td>échec technique (droits, API non activée, réseau) — la cause est dans le constat et le journal.</td></tr>
</table>
<h3>Traiter les écarts</h3>
<p>Chaque ligne NON CONFORME propose « Accepter l'écart… » : la fenêtre présente le <b>risque assumé</b> et le
constat, puis exige un motif (mesures compensatoires, contexte métier) et une échéance de révision. Les
dérogations sont durables et partagées entre administrateurs ; révocables en un clic. Le <b>tampon</b> affiche le
score <i>résiduel</i> (écarts acceptés exclus), le score <i>brut</i> reste indiqué dessous.</p>
<h3>Bonnes pratiques d'exécution</h3>
<p>Exécuter avec un compte <b>super administrateur</b> (exigé par la Policy API). Garder l'onglet ouvert et le poste
alimenté (l'anti-veille maintient l'écran, pas le capot fermé). En cas de coupure, l'audit se suspend
automatiquement : « Reprendre l'audit » repart où il s'était arrêté.</p>
`,
en: `
<h3>The Benchmark</h3>
<p>This tool automatically audits your Google Workspace tenant against the <b>86 recommendations</b> from the
<a href="https://www.cisecurity.org/benchmark/google_workspace" target="_blank" rel="noopener">CIS Google Workspace Foundations Benchmark v1.4</a>,
the security configuration baseline published by the Center for Internet Security. The official PDF can be downloaded
freely from their website; identifiers displayed here (e.g. <code>3.1.3.5.2</code>)
refer directly to matching sections in the benchmark document with detailed rationale, audit, and remediation.</p>
<h3>Level 1 vs Levels 1+2 Profiles</h3>
<p><b>Level 1</b>: Essential security baseline, applicable to most organizations with limited user friction.
<b>Level 2</b>: Defense-in-depth hardening for demanding environments, which may restrict certain features
(e.g., Drive for desktop, POP/IMAP). The header toggle controls active checks; L2 checks outside L1 profile are tagged "OUT OF PROFILE".</p>
<h3>Audit Workflow</h3>
<p><b>Phase 1 — Collection</b>: Single read of tenant context (Cloud Identity policies, users and 2SV status, domains,
groups). The panel streams each step's progress. "Per-group settings" inspects individual group privacy (longer; optional).<br>
<b>Phase 2 — Controls</b>: All 87 checks execute in parallel, displaying results as soon as evaluated.<br>
<b>Phase 3 — Export</b>: Generates a multi-sheet Google Sheets workbook (Summary, Control Details, Action Plan, Deviation Register, Raw Policies).</p>
<h3>Status Interpretation</h3>
<table>
<tr><td><span class="badge b-COMPLIANT">COMPLIANT</span></td><td>Current configuration satisfies the CIS recommendation.</td></tr>
<tr><td><span class="badge b-NON-COMPLIANT">NON-COMPLIANT</span></td><td>Security gap detected — action required or formal acceptance.</td></tr>
<tr><td><span class="badge b-ACCEPTEDDEVIATION">ACCEPTED DEVIATION</span></td><td>Documented risk acceptance: rationale, approver, review date.</td></tr>
<tr><td><span class="badge b-TOREVIEW">TO REVIEW</span></td><td>Data collected but human judgement or manual check required.</td></tr>
<tr><td><span class="badge b-MANUAL">MANUAL</span></td><td>Not exposed via API (dashboard reviews, alert rules) — console path provided.</td></tr>
<tr><td><span class="badge b-ERROR">ERROR</span></td><td>Technical failure (permissions, disabled API, network) — see log for root cause.</td></tr>
</table>
<h3>Managing Deviations</h3>
<p>Every NON-COMPLIANT line offers "Accept gap…": the dialog displays the <b>assumed risk</b> and finding,
requiring compensatory measures and a review deadline. Deviations are persistent and shared across administrators.
The <b>circular gauge</b> displays the <i>residual</i> compliance score (accepted gaps excluded), while raw score is shown below.</p>
<h3>Execution Best Practices</h3>
<p>Run with a <b>super admin</b> account (required by Policy API). Keep the tab open and computer powered.
If interrupted, the audit pauses safely: "Resume audit" picks up exactly where it left off.</p>
`
};
const CONCURRENCE = 3;
const ORDRE_STATUTS = ['CONFORME','NON CONFORME','ÉCART ACCEPTÉ','À VÉRIFIER','MANUEL','ERREUR','HORS PROFIL'];
const CLASSE = s => 'b-' + s.normalize('NFD').replace(/[̀-ͯ]/g,'').replace(/[\s-]/g,'');
let langActuelle = localStorage.getItem('cis_lang') || 'fr';
let profil='L2', token=null, controles=[], etapes=[], file=[], actifs=0;
let resultats={}, compte={}, total=0, faits=0, enCours=false, filtre=null;
let reessayes = new Map();
let tDebut=null, tDernierRetour=null, minuteur=null, etapeEnCoursDepuis=null;
let stopDemande=false, interrompu=false, phase=null, posCollecte=null;
let cfg=null, nbGroupes=0, reglagesEtat=null, echecsConsec=0, wakeLock=null;
let derogations = {}, derogEnCours = null;
let compteCollecte = {}, compteSession = '';
const CONCURRENCE_REGLAGES = 4;
function t(cle){ return (I18N[langActuelle] && I18N[langActuelle][cle]) || (I18N.fr && I18N.fr[cle]) || cle; }
function changerLangue(nl){
langActuelle = (nl === 'en') ? 'en' : 'fr';
localStorage.setItem('cis_lang', langActuelle);
document.documentElement.lang = langActuelle;
document.getElementById('btnLangFr').classList.toggle('actif', langActuelle === 'fr');
document.getElementById('btnLangEn').classList.toggle('actif', langActuelle === 'en');
appliquerTraductions();
majCompteurs();
majScore();
if (Object.keys(resultats).length > 0 || controles.length > 0){
reconstruireTableauApresChangementLangue();
}
}
function appliquerTraductions(){
const dic = I18N[langActuelle] || I18N.fr;
document.querySelectorAll('[data-i18n]').forEach(el => {
const k = el.getAttribute('data-i18n');
if (dic[k]) el.innerHTML = dic[k];
});
document.querySelectorAll('[data-i18n-ph]').forEach(el => {
const k = el.getAttribute('data-i18n-ph');
if (dic[k]) el.placeholder = dic[k];
});
document.getElementById('guideCorps').innerHTML = GUIDE_HTML[langActuelle] || GUIDE_HTML.fr;
if (!enCours && !interrompu && faits === 0){
document.getElementById('txtAv').textContent = t('attenteLancement');
}
const btnL = document.getElementById('btnLancer');
if (!enCours && !interrompu && faits === 0) btnL.textContent = t('btnLancer');
else if (!enCours && interrompu) btnL.textContent = t('btnReprendre');
else if (!enCours && faits > 0) btnL.textContent = t('btnRelancer');
}
function reconstruireTableauApresChangementLangue(){
document.querySelectorAll('#corps tr.section').forEach(tr => {
const premierId = (tr.nextElementSibling && tr.nextElementSibling.querySelector('.id'))
? tr.nextElementSibling.querySelector('.id').textContent : '';
if (premierId) tr.querySelector('td').textContent = sectionDe(premierId);
});
Object.values(resultats).forEach(r => {
const tr = ligne(r.id);
if (tr) {
tr.querySelector('.titre').textContent = (langActuelle === 'en' && r.titreEn) ? r.titreEn : r.titre;
afficherLigne(r);
}
});
}
function msgErreur(e){
const m = e && e.message;
if (m && m !== 'undefined') return m;
return langActuelle === 'en'
? 'network error or session interrupted (computer went to sleep?)'
: 'erreur réseau ou session interrompue (mise en veille du poste ?)';
}
// ---------- Anti-veille (Screen Wake Lock) ----------
async function demanderWakeLock(){
try{
if ('wakeLock' in navigator && !wakeLock){
wakeLock = await navigator.wakeLock.request('screen');
wakeLock.addEventListener('release', () => { wakeLock = null; });
journal(langActuelle === 'en'
? 'Anti-sleep active: screen will remain awake during audit (do not close laptop lid).'
: 'Anti-veille activé : l\'écran restera allumé pendant l\'audit (ne pas fermer le capot).');
}
}catch(e){
journal(langActuelle === 'en'
? 'Anti-sleep unavailable (' + msgErreur(e) + ') — disable computer sleep mode during audit.'
: 'Anti-veille indisponible (' + msgErreur(e) + ') — désactiver la mise en veille du poste pendant l\'audit.');
}
}
function relacherWakeLock(){
try{ if (wakeLock){ wakeLock.release(); wakeLock = null; } }catch(e){}
}
document.addEventListener('visibilitychange', () => {
if (document.visibilityState === 'visible' && enCours && !wakeLock) demanderWakeLock();
});
// ---------- Journal & vitalité ----------
function journal(msg, classe){
const z = document.getElementById('journal');
z.style.display = 'block';
const corps = document.getElementById('journalCorps');
const h = new Date().toTimeString().slice(0,8);
const ligne = document.createElement('span');
if (classe) ligne.className = classe;
ligne.textContent = h + ' ' + msg + '\n';
corps.appendChild(ligne);
corps.scrollTop = corps.scrollHeight;
}
function battementRecu(){ tDernierRetour = Date.now(); }
function demarrerChrono(){
tDebut = Date.now(); tDernierRetour = Date.now();
document.getElementById('chrono').style.display = 'block';
minuteur = setInterval(() => {
const s = Math.floor((Date.now()-tDebut)/1000);
document.getElementById('chronoVal').textContent =
String(Math.floor(s/60)).padStart(2,'0') + ':' + String(s%60).padStart(2,'0');
const b = Math.floor((Date.now()-tDernierRetour)/1000);
document.getElementById('battement').textContent = b + ' s';
if (b > 0 && b % 45 === 0) journal(langActuelle === 'en'
? 'Server call still in progress (' + b + ' s without response) — normal for large tenants.'
: 'Appel serveur toujours en cours (' + b + ' s sans retour) — normal si le tenant est volumineux.');
}, 1000);
}
function arreterChrono(){ if (minuteur){ clearInterval(minuteur); minuteur=null; } }
function attenteProgrammee(ligne, secondes, message, rappel){
let restant = secondes;
const maj = () => {
if (ligne) ligne.querySelector('.info').textContent = message + (langActuelle === 'en' ? ' — resuming in ' : ' — reprise dans ') + restant + ' s';
};
maj();
const iv = setInterval(() => { restant--; if (restant > 0) maj(); else clearInterval(iv); }, 1000);
setTimeout(() => { clearInterval(iv); rappel(); }, secondes * 1000);
}
function ouvrirGuide(){ document.getElementById('modalGuide').showModal(); }
function fermerGuide(){ document.getElementById('modalGuide').close(); }
function ouvrirAPropos(){ document.getElementById('modalAPropos').showModal(); }
function fermerAPropos(){ document.getElementById('modalAPropos').close(); }
const VERSION_PAGE = (document.getElementById('appVersion').textContent || '').replace(/^v/,'');
function choisirProfil(p){
if (enCours || interrompu) return;
profil = p;
document.getElementById('pL1').classList.toggle('actif', p==='L1');
document.getElementById('pL2').classList.toggle('actif', p==='L2');
}
function sectionDe(id){
const liste = (I18N[langActuelle] && I18N[langActuelle].sections) || I18N.fr.sections;
for (const [pre, lib] of liste) if (id.startsWith(pre)) return lib;
return langActuelle === 'en' ? 'Other' : 'Autres';
}
// ---------- Lancement ----------
function lancerAudit(){
if (enCours) return;
if (interrompu && token){ reprendre(); return; }
enCours = true;
stopDemande = false; interrompu = false; phase = null; posCollecte = null;