-
Notifications
You must be signed in to change notification settings - Fork 32
/
section18.yml
3800 lines (3531 loc) · 124 KB
/
section18.yml
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
---
- name: "18.1.1.1 | PATCH | Ensure Prevent enabling lock screen camera is set to Enabled"
ansible.windows.win_regedit:
path: HKLM:\Software\Policies\Microsoft\Windows\Personalization
name: NoLockScreenCamera
data: 1
type: dword
when:
- win22cis_rule_18_1_1_1
tags:
- level1-domaincontroller
- level1-memberserver
- rule_18.1.1.1
- patch
- camera
- name: "18.1.1.2 | PATCH | Ensure Prevent enabling lock screen slide show is set to Enabled"
ansible.windows.win_regedit:
path: HKLM:\Software\Policies\Microsoft\Windows\Personalization
name: NoLockScreenSlideshow
data: 1
type: dword
when:
- win22cis_rule_18_1_1_2
tags:
- level1-domaincontroller
- level1-memberserver
- rule_18.1.1.2
- patch
- lockscreen
- name: "18.1.2.2 | PATCH | Ensure Allow users to enable online speech recognition services is set to Disabled"
ansible.windows.win_regedit:
path: HKLM:\Software\Policies\Microsoft\InputPersonalization
name: "AllowInputPersonalization"
data: "0"
type: dword
when:
- win22cis_rule_18_1_2_2
tags:
- level1-domaincontroller
- level1-memberserver
- rule_18.1.2.2
- patch
- onlinespeech
- name: "18.1.3 | PATCH | Ensure Allow Online Tips is set to Disabled"
ansible.windows.win_regedit:
path: HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer
name: AllowOnlineTips
data: 0
type: dword
when:
- win22cis_rule_18_1_3
tags:
- level2-domaincontroller
- level2-memberserver
- rule_18.1.3
- patch
- onlinetips
- name: "18.3.1 | PATCH | Ensure LAPS AdmPwd GPO Extension / CSE is installed MS only | Member Server"
ansible.windows.win_regedit:
path: HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\GPExtensions\{D76B9641-3288-4f75-942D-087DE603E3EA}
name: DllName
data: C:\Program Files\LAPS\CSE\AdmPwd.dll
type: string
when:
- win22cis_rule_18_3_1
- win2022cis_is_domain_member
tags:
- level1-memberserver
- rule_18.3.1
- patch
- laps
- gpo
- name: "18.3.2 | PATCH | Ensure Do not allow password expiration time longer than required by policy is set to Enabled MS only | Member Server"
ansible.windows.win_regedit:
path: HKLM:\SOFTWARE\Policies\Microsoft Services\AdmPwd
name: PwdExpirationProtectionEnabled
data: 1
type: dword
when:
- win22cis_rule_18_3_2
- win2022cis_is_domain_member
tags:
- level1-memberserver
- rule_18.3.2
- patch
- accounts
- name: "18.3.3 | PATCH | Ensure Enable Local Admin Password Management is set to Enabled MS only | Member Server"
ansible.windows.win_regedit:
path: HKLM:\SOFTWARE\Policies\Microsoft Services\AdmPwd
name: AdmPwdEnabled
data: 1
type: dword
when:
- win22cis_rule_18_3_3
- win2022cis_is_domain_member
tags:
- level1-memberserver
- rule_18.3.3
- patch
- accounts
- admin
- name: "18.3.4 | PATCH | Ensure Password Settings: Password Complexity is set to Enabled: Large letters + small letters + numbers + special characters MS only | Member Server"
ansible.windows.win_regedit:
path: HKLM:\SOFTWARE\Policies\Microsoft Services\AdmPwd
name: PasswordComplexity
data: 4
type: dword
when:
- win22cis_rule_18_3_4
- win2022cis_is_domain_member
tags:
- level1-memberserver
- rule_18.3.4
- patch
- accounts
- name: "18.3.5 | PATCH | Ensure Password Settings Password Length is set to Enabled 15 or more MS only | Member Server"
block:
- name: "18.3.5 | AUDIT | Ensure Password Settings Password Length is set to Enabled 15 or more MS only | Warning Check For Variable Standards | Member Server"
ansible.builtin.debug:
msg:
- "Warning!! You have an invalid password length set for win22cis_laps_password_length please read"
- "the notes for the variable and make the necessary change to the variable to be in compliance."
when: win22cis_laps_password_length < 15
- name: "18.3.5 | AUDIT | Ensure Password Settings Password Length is set to Enabled 15 or more MS only | Warn Count | Member Server"
ansible.builtin.import_tasks:
file: warning_facts.yml
vars:
warn_control_id: '18.3.5'
when: win22cis_laps_password_length < 15
- name: "18.3.5 | PATCH | Ensure Password Settings Password Length is set to Enabled 15 or more MS only. | Set Variable | Member Server"
ansible.windows.win_regedit:
path: HKLM:\SOFTWARE\Policies\Microsoft Services\AdmPwd
name: PasswordLength
data: "{{ win22cis_laps_password_length }}"
type: dword
when: win22cis_laps_password_length >= 15
when:
- win22cis_rule_18_3_5
- win2022cis_is_domain_member
tags:
- level1-memberserver
- rule_18.3.5
- patch
- accounts
- name: "18.3.6 | PATCH | Ensure Password Settings Password Age Days is set to Enabled 30 or fewer MS only | Member Server"
block:
- name: "18.3.6 | AUDIT | Ensure Password Settings Password Age Days is set to Enabled 30 or fewer MS only | Warning Check For Variable Standards | Member Server"
ansible.builtin.debug:
msg:
- "Warning!! You have an invalid Password Age Days set for win22cis_laps_password_age_days please read"
- "the notes for the variable and make the necessary change to the variable to be in compliance."
when: win22cis_laps_password_age_days > 30
- name: "18.3.6 | AUDIT | Ensure Password Settings Password Age Days is set to Enabled 30 or fewer MS only | Warn Count | Member Server"
ansible.builtin.import_tasks:
file: warning_facts.yml
vars:
warn_control_id: '18.3.6'
when: win22cis_laps_password_age_days > 30
- name: "18.3.6 | PATCH | Ensure Password Settings Password Age Days is set to Enabled 30 or fewer MS only | Set Variable | Member Server"
ansible.windows.win_regedit:
path: HKLM:\SOFTWARE\Policies\Microsoft Services\AdmPwd
name: PasswordAgeDays
data: "{{ win22cis_laps_password_age_days }}"
type: dword
when: win22cis_laps_password_age_days <= 30
when:
- win22cis_rule_18_3_6
- win2022cis_is_domain_member
tags:
- level1-memberserver
- rule_18.3.6
- patch
- accounts
- name: "18.4.1 | PATCH | Ensure Apply UAC restrictions to local accounts on network logons is set to Enabled MS only | Member Server"
ansible.windows.win_regedit:
path: HKLM:\Software\Microsoft\Windows\Currentversion\Policies\System
name: LocalAccountTokenFilterPolicy
data: 0
type: dword
when:
- win22cis_rule_18_4_1
- win2022cis_is_domain_member
tags:
- level1-memberserver
- rule_18.4.1
- patch
- uac
- name: "18.4.2 | PATCH | Ensure Configure RPC packet level privacy setting for incoming connections is set to Enabled"
ansible.windows.win_regedit:
path: HKLM:\SYSTEM\CurrentControlSet\Control\Print
name: RpcAuthnLevelPrivacyEnabled
data: 1
type: dword
notify: change_requires_reboot
when:
- win22cis_rule_18_4_2
tags:
- level1-domaincontroller
- level1-memberserver
- rule_18.4.2
- patch
- RPC
- name: "18.4.3 | PATCH | Ensure Configure SMB v1 client driver is set to Enabled Disable driver recommended"
ansible.windows.win_regedit:
path: HKLM:\SYSTEM\CurrentControlSet\Services\mrxsmb10
name: Start
data: 4
type: dword
when:
- win22cis_rule_18_4_3
tags:
- level1-domaincontroller
- level1-memberserver
- rule_18.4.3
- patch
- smb
- name: "18.4.4 | PATCH | Ensure Configure SMB v1 server is set to Disabled"
ansible.windows.win_regedit:
path: HKLM:\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters
name: SMB1
data: 0
type: dword
state: present
notify: change_requires_reboot
when:
- win22cis_rule_18_4_4
tags:
- level1-domaincontroller
- level1-memberserver
- rule_18.4.4
- patch
- smb
- name: "18.4.5 | PATCH | Ensure Enable Structured Exception Handling Overwrite Protection SEHOP is set to Enabled"
ansible.windows.win_regedit:
path: HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\kernel
name: DisableExceptionChainValidation
data: 0
type: dword
state: present
when:
- win22cis_rule_18_4_5
tags:
- level1-domaincontroller
- level1-memberserver
- rule_18.4.5
- patch
- sehop
- name: "18.4.6 | PATCH | Ensure 'NetBT NodeType configuration' is set to 'Enabled: P-node recommended'"
ansible.windows.win_regedit:
path: HKLM:\SYSTEM\CurrentControlSet\Services\NetBT\Parameters
state: present
value: NodeType
data: "{{ win22cis_netbt_nodetype }}"
datatype: dword
when:
- win22cis_rule_18_4_6
tags:
- level1-domaincontroller
- level1-memberserver
- rule_18.4.6
- patch
- netbt
- name: "18.4.7 | PATCH | Ensure WDigest Authentication is set to Disabled"
ansible.windows.win_regedit:
path: HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\Wdigest
state: present
value: UseLogonCredential
data: 0
datatype: dword
when:
- win22cis_rule_18_4_7
tags:
- level1-domaincontroller
- level1-memberserver
- rule_18.4.7
- patch
- wdigest
- name: "18.5.1 | PATCH | Ensure MSS AutoAdminLogon Enable Automatic Logon not recommended is set to Disabled"
ansible.windows.win_regedit:
path: HKLM:\Software\Microsoft\Windows Nt\Currentversion\Winlogon
state: present
name: AutoAdminLogon
data: 0
type: string
when:
- win22cis_rule_18_5_1
tags:
- level1-domaincontroller
- level1-memberserver
- rule_18.5.1
- patch
- mss
- logon
- name: "18.5.2 | PATCH | Ensure MSS DisableIPSourceRouting IPv6 IP source routing protection level protects against packet spoofing is set to Enabled Highest protection source routing is completely disabled"
ansible.windows.win_regedit:
path: HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters
state: present
value: DisableIPSourceRouting
data: 2
datatype: dword
when:
- win22cis_rule_18_5_2
tags:
- level1-domaincontroller
- level1-memberserver
- rule_18.5.2
- patch
- mss
- iprouting
- name: "18.5.3 | PATCH | Ensure MSS DisableIPSourceRouting IPv6 IP source routing protection level protects against packet spoofing is set to Enabled Highest protection source routing is completely disabled"
ansible.windows.win_regedit:
path: HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters
state: present
value: DisableIPSourceRouting
data: 2
datatype: dword
when:
- win22cis_rule_18_5_3
tags:
- level1-domaincontroller
- level1-memberserver
- rule_18.5.3
- patch
- mss
- iprouting
- name: "18.5.4 | PATCH | Ensure MSS EnableICMPRedirect Allow ICMP redirects to override OSPF generated routes is set to Disabled"
ansible.windows.win_regedit:
path: HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters
state: present
value: EnableICMPRedirect
data: 0
datatype: dword
when:
- win22cis_rule_18_5_4
tags:
- level1-domaincontroller
- level1-memberserver
- rule_18.5.4
- patch
- mss
- icmps
- name: "18.5.5 | PATCH | Ensure MSS KeepAliveTime How often keep-alive packets are sent in milliseconds is set to Enabled 300000 or 5 minutes recommended"
ansible.windows.win_regedit:
path: HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters
state: present
value: KeepAliveTime
data: 300000
datatype: dword
when:
- win22cis_rule_18_5_5
tags:
- level2-domaincontroller
- level2-memberserver
- rule_18.5.5
- patch
- mss
- keepalive
- name: "18.5.6 | PATCH | Ensure MSS NoNameReleaseOnDemand Allow the computer to ignore NetBIOS name release requests except from WINS servers is set to Enabled"
ansible.windows.win_regedit:
path: HKLM:\System\Currentcontrolset\Services\Netbt\Parameters
state: present
name: NoNameReleaseOnDemand
data: 1
type: dword
when:
- win22cis_rule_18_5_6
tags:
- level1-domaincontroller
- level1-memberserver
- rule_18.5.6
- patch
- mss
- noname
- name: "18.5.7 | PATCH | Ensure MSS PerformRouterDiscovery Allow IRDP to detect and configure Default Gateway addresses could lead to DoS is set to Disabled"
ansible.windows.win_regedit:
path: HKLM:\System\Currentcontrolset\Services\Tcpip\Parameters
state: present
name: PerformRouterDiscovery
data: 0
type: dword
when:
- win22cis_rule_18_5_7
tags:
- level2-domaincontroller
- level2-memberserver
- rule_18.5.7
- patch
- mss
- name: "18.5.8 | PATCH | Ensure MSS SafeDllSearchMode Enable Safe DLL search mode recommended is set to Enabled"
ansible.windows.win_regedit:
path: HKLM:\System\Currentcontrolset\Control\Session Manager
name: SafeDllSearchMode
data: 1
type: dword
state: present
when:
- win22cis_rule_18_5_8
tags:
- level1-domaincontroller
- level1-memberserver
- rule_18.5.8
- patch
- mss
- name: "18.5.9 | PATCH | Ensure MSS ScreenSaverGracePeriod The time in seconds before the screen saver grace period expires 0 recommended is set to Enabled 5 or fewer seconds"
block:
- name: "18.5.9 | AUDIT | Ensure MSS ScreenSaverGracePeriod The time in seconds before the screen saver grace period expires 0 recommended is set to Enabled 5 or fewer seconds | Warning Check For Variable Standards."
ansible.builtin.debug:
msg:
- "Warning!! You have an invalid time set for win22cis_screen_saver_grace_period please read"
- "the notes for the variable and make the necessary change to the variable to be in compliance."
when: win22cis_screen_saver_grace_period > 5
- name: "18.5.9 | PATCH | Ensure MSS ScreenSaverGracePeriod The time in seconds before the screen saver grace period expires 0 recommended is set to Enabled 5 or fewer seconds | Set Warn Count."
ansible.builtin.import_tasks:
file: warning_facts.yml
vars:
warn_control_id: '18.5.9'
when: win22cis_screen_saver_grace_period > 5
- name: "18.5.9 | PATCH | Ensure MSS ScreenSaverGracePeriod The time in seconds before the screen saver grace period expires 0 recommended is set to Enabled 5 or fewer seconds | Set Variable."
ansible.windows.win_regedit:
path: HKLM:\Software\Microsoft\Windows Nt\Currentversion\Winlogon
name: ScreenSaverGracePeriod
data: "{{ win22cis_screen_saver_grace_period }}"
type: string
state: present
when: win22cis_screen_saver_grace_period <= 5
when:
- win22cis_rule_18_5_9
tags:
- level1-domaincontroller
- level1-memberserver
- rule_18.5.9
- patch
- mss
- name: "18.5.10 | PATCH | Ensure MSS TcpMaxDataRetransmissions IPv6 How many times unacknowledged data is retransmitted is set to Enabled 3"
ansible.windows.win_regedit:
path: HKLM:\System\Currentcontrolset\Services\Tcpip6\Parameters
name: TcpMaxDataRetransmissions
data: 3
type: dword
when:
- win22cis_rule_18_5_10
tags:
- level2-domaincontroller
- level2-memberserver
- rule_18.5.10
- patch
- mss
- name: "18.5.11 | PATCH | Ensure MSS TcpMaxDataRetransmissions How many times unacknowledged data is retransmitted is set to Enabled 3"
ansible.windows.win_regedit:
path: HKLM:\System\Currentcontrolset\Services\Tcpip\Parameters
name: TcpMaxDataRetransmissions
data: 3
type: dword
when:
- win22cis_rule_18_5_11
tags:
- level2-domaincontroller
- level2-memberserver
- rule_18.5.11
- patch
- mss
- name: "18.5.12 | PATCH | Ensure MSS WarningLevel Percentage threshold for the security event log at which the system will generate a warning is set to Enabled 90 or less"
block:
- name: "18.5.12 | AUDIT | Ensure MSS WarningLevel Percentage threshold for the security event log at which the system will generate a warning is set to Enabled 90 or less | Warning Check For Variable Standards."
ansible.builtin.debug:
msg:
- "Warning!! You have an invalid percentage set for win22cis_log_threshold_audit_event please read"
- "the notes for the variable and make the necessary change to the variable to be in compliance."
when: win22cis_log_threshold_audit_event > 90
- name: "18.5.12 | AUDIT | Ensure MSS WarningLevel Percentage threshold for the security event log at which the system will generate a warning is set to Enabled 90 or less | Warn Count."
ansible.builtin.import_tasks:
file: warning_facts.yml
vars:
warn_control_id: '18.5.12'
when: win22cis_log_threshold_audit_event > 90
- name: "18.5.12 | PATCH | Ensure MSS WarningLevel Percentage threshold for the security event log at which the system will generate a warning is set to Enabled 90 or less | Set Variable."
ansible.windows.win_regedit:
path: HKLM:\System\Currentcontrolset\Services\Eventlog\Security
name: WarningLevel
data: "{{ win22cis_log_threshold_audit_event }}"
type: dword
when: win22cis_log_threshold_audit_event <= 90
when:
- win22cis_rule_18_5_12
tags:
- level1-domaincontroller
- level1-memberserver
- rule_18.5.12
- patch
- mss
- name: "18.6.4.1 | PATCH | Ensure Configure DNS over HTTPS (DoH) name resolution is set to Enabled: Allow DoH or higher"
block:
- name: "18.6.4.1 | AUDIT | Ensure Configure DNS over HTTPS (DoH) name resolution is set to Enabled: Allow DoH or higher. | Warning Check For Variable Standards."
ansible.builtin.debug:
msg:
- "Warning!! You have an invalid setting for win22cis_doh_policy. Please read"
- "the notes for the variable and make the necessary change to the variable to be in compliance."
when:
- win22cis_doh_policy != 2
- win22cis_doh_policy != 3
- name: "18.6.4.1 | AUDIT | Ensure Configure DNS over HTTPS (DoH) name resolution is set to Enabled: Allow DoH or higher. | Warn Count."
ansible.builtin.import_tasks:
file: warning_facts.yml
vars:
warn_control_id: '18.6.4.1'
when:
- win22cis_doh_policy != 2
- win22cis_doh_policy != 3
- name: "18.6.4.1 | AUDIT | Ensure Configure DNS over HTTPS (DoH) name resolution is set to Enabled: Allow DoH or higher. | Set Variable."
ansible.windows.win_regedit:
path: HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\DNSClient
name: DoHPolicy
data: "{{ win22cis_doh_policy }}"
type: dword
when: win22cis_doh_policy == 2 or win22cis_doh_policy == 3
when:
- win22cis_rule_18_6_4_1
tags:
- level1-corporate-enterprise-environment
- rule_18.6.4.1
- automated
- patch
- dns-over-https
- name: "18.6.4.2 | PATCH | Ensure 'Configure NetBIOS settings' is set to 'Enabled: Disable NetBIOS name resolution on public networks'"
block:
- name: "18.6.4.2 | AUDIT | Ensure 'Configure NetBIOS settings' is set to 'Enabled: Disable NetBIOS name resolution on public networks'. | Warning Check For Variable Standards."
ansible.builtin.debug:
msg:
- "Warning!! You have an invalid setting for win22cis_enable_netbios_policy. Please read"
- "the notes for the variable and make the necessary change to the variable to be in compliance."
when:
- win22cis_enable_netbios_policy != 2
- win22cis_enable_netbios_policy != 0
- name: "18.6.4.2 | AUDIT | Ensure 'Configure NetBIOS settings' is set to 'Enabled: Disable NetBIOS name resolution on public networks'. | Warn Count."
ansible.builtin.import_tasks:
file: warning_facts.yml
vars:
warn_control_id: '18.6.4.2'
when:
- win22cis_enable_netbios_policy != 2
- win22cis_enable_netbios_policy != 0
- name: "18.6.4.2 | PATCH | Ensure 'Configure NetBIOS settings' is set to 'Enabled: Disable NetBIOS name resolution on public networks'. | Set Variable."
ansible.windows.win_regedit:
path: HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\DNSClient
name: EnableNetbios
data: "{{ win22cis_enable_netbios_policy }}"
type: dword
when: win22cis_enable_netbios_policy == 2 or win22cis_enable_netbios_policy == 0
when:
- win22cis_rule_18_6_4_2
tags:
- level1-corporate-enterprise-environment
- rule_18.6.4.2
- automated
- patch
- netbios
- name: "18.6.4.3 | PATCH | Ensure Turn off multicast name resolution is set to Enabled"
ansible.windows.win_regedit:
path: HKLM:\Software\Policies\Microsoft\Windows NT\DNSClient
name: EnableMulticast
data: 0
type: dword
when:
- win22cis_rule_18_6_4_3
tags:
- level1-corporate-enterprise-environment
- rule_18.6.4.3
- automated
- patch
- dns
- name: "18.6.5.1 | PATCH | Ensure Enable Font Providers is set to Disabled"
ansible.windows.win_regedit:
path: HKLM:\SOFTWARE\Policies\Microsoft\Windows\System
name: EnableFontProviders
data: 0
type: dword
when:
- win22cis_rule_18_6_5_1
tags:
- level2-domaincontroller
- level2-memberserver
- rule_18.6.5.1
- patch
- dns
- name: "18.6.8.1 | PATCH | Ensure Enable insecure guest logons is set to Disabled"
ansible.windows.win_regedit:
path: HKLM:\Software\Policies\Microsoft\Windows\Lanmanworkstation
name: AllowInsecureGuestAuth
data: 0
type: dword
when:
- win22cis_rule_18_6_8_1
tags:
- level1-domaincontroller
- level1-memberserver
- rule_18.6.8.1
- patch
- fonts
- name: "18.6.9.1 | PATCH | Ensure Turn on Mapper I/O LLTDIO driver is set to Disabled"
block:
- name: "18.6.9.1 | PATCH | Ensure Turn on Mapper IO LLTDIO driver is set to Disabled | AllowLLTDIOOndomain"
ansible.windows.win_regedit:
path: HKLM:\Software\Policies\Microsoft\Windows\Lltd
name: AllowLLTDIOOndomain
data: 0
type: dword
- name: "18.6.9.1 | PATCH | Ensure Turn on Mapper IO LLTDIO driver is set to Disabled | AllowLLTDIOOnPublicNet"
ansible.windows.win_regedit:
path: HKLM:\Software\Policies\Microsoft\Windows\Lltd
name: AllowLLTDIOOnPublicNet
data: 0
type: dword
- name: "18.6.9.1 | PATCH | Ensure Turn on Mapper IO LLTDIO driver is set to Disabled | EnableLLTDIO"
ansible.windows.win_regedit:
path: HKLM:\Software\Policies\Microsoft\Windows\Lltd
name: EnableLLTDIO
data: 0
type: dword
- name: "18.6.9.1 | PATCH | Ensure Turn on Mapper IO LLTDIO driver is set to Disabled | ProhibitLLTDIOOnPrivateNet"
ansible.windows.win_regedit:
path: HKLM:\Software\Policies\Microsoft\Windows\Lltd
name: ProhibitLLTDIOOnPrivateNet
data: 0
type: dword
when:
- win22cis_rule_18_6_9_1
tags:
- level2-domaincontroller
- level2-memberserver
- rule_18.6.9.1
- patch
- mapper
- drivers
- name: "18.6.9.2 | PATCH | Ensure Turn on Responder RSPNDR driver is set to Disabled"
block:
- name: "18.6.9.2 | PATCH | Ensure Turn on Responder RSPNDR driver is set to Disabled | AllowRspndrOnDomain"
ansible.windows.win_regedit:
path: HKLM:\Software\Policies\Microsoft\Windows\Lltd
name: AllowRspndrOnDomain
data: 0
type: dword
- name: "18.6.9.2 | PATCH | Ensure Turn on Responder RSPNDR driver is set to Disabled | AllowRspndrOnPublicNet"
ansible.windows.win_regedit:
path: HKLM:\Software\Policies\Microsoft\Windows\Lltd
name: AllowRspndrOnPublicNet
data: 0
type: dword
- name: "18.6.9.2 | PATCH | Ensure Turn on Responder RSPNDR driver is set to Disabled | EnableRspndr"
ansible.windows.win_regedit:
path: HKLM:\Software\Policies\Microsoft\Windows\Lltd
name: EnableRspndr
data: 0
type: dword
- name: "18.6.9.2 | PATCH | Ensure Turn on Responder RSPNDR driver is set to Disabled | ProhibitRspndrOnPrivateNet"
ansible.windows.win_regedit:
path: HKLM:\Software\Policies\Microsoft\Windows\Lltd
name: ProhibitRspndrOnPrivateNet
data: 0
type: dword
when:
- win22cis_rule_18_6_9_2
tags:
- level2-domaincontroller
- level2-memberserver
- rule_18.6.9.2
- patch
- rspndr
- driver
- name: "18.6.10.2 | PATCH | Ensure Turn off Microsoft Peer-to-Peer Networking Services is set to Enabled"
ansible.windows.win_regedit:
path: HKLM:\Software\Policies\Microsoft\Peernet
name: Disabled
data: 1
type: dword
when:
- win22cis_rule_18_6_10_2
tags:
- level2-domaincontroller
- level2-memberserver
- rule_18.6.10.2
- patch
- p2p
- name: "18.6.11.2 | PATCH | Ensure Prohibit installation and configuration of Network Bridge on your DNS domain network is set to Enabled"
ansible.windows.win_regedit:
path: HKLM:\Software\Policies\Microsoft\Windows\Network Connections
name: NC_AllowNetBridge_NLA
data: 0
type: dword
when:
- win22cis_rule_18_6_11_2
tags:
- level1-domaincontroller
- level1-memberserver
- rule_18.6.11.2
- patch
- networkconnections
- name: "18.6.11.3 | PATCH | Ensure Prohibit use of Internet Connection Sharing on your DNS domain network is set to Enabled"
ansible.windows.win_regedit:
path: HKLM:\SOFTWARE\Policies\Microsoft\Windows\Network Connections
name: NC_ShowSharedAccessUI
data: 0
type: dword
when:
- win22cis_rule_18_5_11_3
tags:
- level1-domaincontroller
- level1-memberserver
- rule_18.6.11.3
- patch
- networkconnections
- name: "18.6.11.4 | PATCH | Ensure Require domain users to elevate when setting a networks location is set to Enabled"
ansible.windows.win_regedit:
path: HKLM:\Software\Policies\Microsoft\Windows\Network Connections
name: NC_StdDomainUserSetLocation
data: 1
type: dword
when:
- win22cis_rule_18_6_11_4
tags:
- level1-domaincontroller
- level1-memberserver
- rule_18.6.11.4
- patch
- networkconnections
- name: "18.6.14.1 | PATCH | Ensure Hardened UNC Paths is set to Enabled with Require Mutual Authentication and Require Integrity set for all NETLOGON and SYSVOL shares"
block:
- name: "18.6.14.1 | PATCH | Ensure Hardened UNC Paths is set to Enabled with Require Mutual Authentication and Require Integrity set for all NETLOGON shares"
ansible.windows.win_regedit:
path: HKLM:\Software\Policies\Microsoft\Windows\Networkprovider\Hardenedpaths
name: "\\\\*\\NETLOGON"
data: "RequireMutualAuthentication=1, RequireIntegrity=1"
type: string
- name: "18.6.14.1 | PATCH | Ensure Hardened UNC Paths is set to Enabled with Require Mutual Authentication and Require Integrity set for all SYSVOL shares"
ansible.windows.win_regedit:
path: HKLM:\Software\Policies\Microsoft\Windows\Networkprovider\Hardenedpaths
name: "\\\\*\\SYSVOL"
data: "RequireMutualAuthentication=1, RequireIntegrity=1"
type: string
when:
- win22cis_rule_18_6_14_1
tags:
- level1-domaincontroller
- level1-memberserver
- rule_18.6.14.1
- patch
- paths
- unc
- name: "18.6.19.2.1 | PATCH | Disable IPv6 Ensure TCPIP6 Parameter DisabledComponents is set to 0xff 255"
ansible.windows.win_regedit:
path: HKLM:\System\CurrentControlSet\Services\TCPIP6\Parameters
name: DisabledComponents
data: 255
type: dword
when:
- win22cis_rule_18_6_19_2_1
tags:
- level2-domaincontroller
- level2-memberserver
- rule_18.6.19.2.1
- patch
- ipv6
- name: "18.6.20.1 | PATCH | Ensure Configuration of wireless settings using Windows Connect Now is set to Disabled"
block:
- name: "18.6.20.1 | PATCH | Ensure Configuration of wireless settings using Windows Connect Now is set to Disabled | EnableRegistrars"
ansible.windows.win_regedit:
path: HKLM:\Software\Policies\Microsoft\Windows\Wcn\Registrars
name: EnableRegistrars
data: 0
type: dword
- name: "18.6.20.1 | PATCH | Ensure Configuration of wireless settings using Windows Connect Now is set to Disabled | DisableUPnPRegistrar"
ansible.windows.win_regedit:
path: HKLM:\Software\Policies\Microsoft\Windows\Wcn\Registrars
name: DisableUPnPRegistrar
data: 0
type: dword
- name: "18.6.20.1 | PATCH | Ensure Configuration of wireless settings using Windows Connect Now is set to Disabled | DisableInBand802DOT11Registrar"
ansible.windows.win_regedit:
path: HKLM:\Software\Policies\Microsoft\Windows\Wcn\Registrars
name: DisableInBand802DOT11Registrar
data: 0
type: dword
- name: "18.6.20.1 | PATCH | Ensure Configuration of wireless settings using Windows Connect Now is set to Disabled | DisableFlashConfigRegistrar"
ansible.windows.win_regedit:
path: HKLM:\Software\Policies\Microsoft\Windows\Wcn\Registrars
name: DisableFlashConfigRegistrar
data: 0
type: dword
- name: "18.6.20.1 | PATCH | Ensure Configuration of wireless settings using Windows Connect Now is set to Disabled | DisableWPDRegistrar"
ansible.windows.win_regedit:
path: HKLM:\Software\Policies\Microsoft\Windows\Wcn\Registrars
name: DisableWPDRegistrar
data: 0
type: dword
when:
- win22cis_rule_18_6_20_1
tags:
- level2-domaincontroller
- level2-memberserver
- rule_18.6.20.1
- patch
- wireless
- name: "18.6.20.2 | PATCH | Ensure Prohibit access of the Windows Connect Now wizards is set to Enabled"
ansible.windows.win_regedit:
path: HKLM:\Software\Policies\Microsoft\Windows\Wcn\Ui
name: DisableWcnUi
data: 1
type: dword
when:
- win22cis_rule_18_6_20_2
tags:
- level2-domaincontroller
- level2-memberserver
- rule_18.6.20.2
- patch
- connectnow
- name: "18.6.21.1 | PATCH | Ensure Minimize the number of simultaneous connections to the Internet or a Windows Domain is set to Enabled"
ansible.windows.win_regedit:
path: HKLM:\Software\Policies\Microsoft\Windows\Wcmsvc\Grouppolicy
name: fMinimizeConnections
data: 3
type: dword
when:
- win22cis_rule_18_6_21_1
tags:
- level1-domaincontroller
- level1-memberserver
- rule_18.6.21.1
- patch
- gpo
- name: "18.6.21.2 | PATCH | Ensure Prohibit connection to non-domain networks when connected to domain authenticated network is set to Enabled MS only | Member Server"
ansible.windows.win_regedit:
path: HKLM:\Software\Policies\Microsoft\Windows\Wcmsvc\Grouppolicy
name: fBlockNonDomain
data: 1
type: dword
when:
- win22cis_rule_18_6_21_2
- win2022cis_is_domain_member
tags:
- level2-memberserver
- rule_18.6.21.2
- patch
- gpo
- name: "18.7.1 | PATCH | Ensure Allow Print Spooler to accept client connections is set to Disabled"
ansible.windows.win_regedit:
path: HKLM:\Software\Policies\Microsoft\Windows NT\Printers
name: RegisterSpoolerRemoteRpcEndPoint
data: 2
type: dword
when:
- win22cis_rule_18_7_1
tags:
- level1-domaincontroller
- level2-memberserver
- rule_18.7.1
- patch
- printers
- name: "18.7.2 | PATCH | Ensure Configure Redirection Guard is set to Enabled Redirection Guard Enabled"
ansible.windows.win_regedit:
path: HKLM:\Software\Policies\Microsoft\Windows NT\Printers
name: RedirectionguardPolicy
data: 1
type: dword
when:
- win22cis_rule_18_7_2
tags:
- level1-domaincontroller
- level1-memberserver
- rule_18.7.2
- patch
- printers
- name: "18.7.3 | PATCH | Ensure Configure RPC connection settings Protocol to use for outgoing RPC connections is set to Enabled RPC over TCP"
ansible.windows.win_regedit:
path: HKLM:\Software\Policies\Microsoft\Windows NT\Printers\RPC
name: RpcUseNamedPipeProtocol
data: 0
type: dword
when:
- win22cis_rule_18_7_3
tags:
- level1-domaincontroller
- level1-memberserver
- rule_18.7.3
- patch
- printers
- name: "18.7.4 | PATCH | Ensure Configure RPC connection settings Use authentication for outgoing RPC connections is set to Enabled: Default"
ansible.windows.win_regedit:
path: HKLM:\Software\Policies\Microsoft\Windows NT\Printers\RPC
name: RpcAuthentication
data: 0
type: dword
when:
- win22cis_rule_18_7_4
tags:
- level1-domaincontroller
- level1-memberserver
- rule_18.7.4
- patch
- printers
- name: "18.7.5 | PATCH | Ensure Configure RPC connection settings Use authentication for outgoing RPC connections is set to Enabled: Default"
ansible.windows.win_regedit:
path: HKLM:\Software\Policies\Microsoft\Windows NT\Printers\RPC
name: RpcProtocols
data: 5
type: dword
when:
- win22cis_rule_18_7_5
tags:
- level1-domaincontroller
- level1-memberserver
- rule_18.7.5
- patch
- printers
- name: "18.7.6 | PATCH | Ensure Configure RPC listener settings Authentication protocol to use for incoming RPC connections is set to Enabled Negotiate or higher"
block:
- name: "18.7.6 | AUDIT | Ensure 'Configure RPC listener settings: Authentication protocol to use for incoming RPC connections:' is set to 'Enabled: Negotiate' or higher. | Warning Check For Variable Standards."
ansible.builtin.debug:
msg:
- "Warning!! You have an invalid setting for win22cis_force_kerberos_for_rpc. Please read"
- "the notes for the variable and make the necessary change to the variable to be in compliance."
when:
- win22cis_force_kerberos_for_rpc != 0
- win22cis_force_kerberos_for_rpc != 1
- name: "18.7.6 | AUDIT | Ensure 'Configure RPC listener settings: Authentication protocol to use for incoming RPC connections:' is set to 'Enabled: Negotiate' or higher. | Warn Count."