Repository navigation
Expand file tree
/
Copy pathServer2019_MemberServer.ps1
More file actions
3526 lines (3151 loc) · 170 KB
/
Copy pathServer2019_MemberServer.ps1
File metadata and controls
3526 lines (3151 loc) · 170 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
Configuration Server2019_MemberServer {
param
(
$ComputerName
)
Import-DscResource -ModuleName 'PSDesiredStateConfiguration'
#https://github.com/dsccommunity/AuditPolicyDsc
Import-DscResource -ModuleName 'AuditPolicyDsc' -ModuleVersion 1.4.0.0
#https://github.com/dsccommunity/SecurityPolicyDsc
Import-DscResource -ModuleName 'SecurityPolicyDsc' -ModuleVersion 2.10.0.0
#####################################################################################################################################################################################
# Started from: https://github.com/NVISO-BE/posh-dsc-windows-hardening
# Adjusted by Wim van den Heijkant (Wim@fortigi.nl)
# Corrected a large number of errors
# Added a number of aditional settings based on CIS baseline check using CIS baseline scanner
# Added a lot of references and settings to Azure Security Center recomendation
#
# This gives us a score of 93% procent on CIS Microsoft Windows Server 2019 Benchmark v1.2.1 - Level 1 Member Server
######################################################################################################################################################################################
Node $ComputerName {
######################################################################################################################################################################################
# Added by me.
######################################################################################################################################################################################
WindowsFeature 'Telnet-Client' {
Name = 'Telnet-Client'
Ensure = 'Absent'
}
WindowsFeature 'SMB1' {
Name = 'FS-SMB1'
Ensure = 'Absent'
}
######################################################################################################################################################################################
# CIS & Security Center Standards | Adjustments
######################################################################################################################################################################################
# Password policy is determined by Group Policy
<#AccountPolicy AccountPolicies
{
Name = 'PasswordPolicies'
# 1.1.1 (CIS Baseline Level 1) Ensure 'Enforce password history' is set to '24 or more password(s)'
Enforce_password_history = 8
# 1.1.2 (CIS Baseline Level 1) Ensure 'Maximum password age' is set to '60 or fewer days, but not 0'
Maximum_Password_Age = 180
# 1.1.3 (CIS Baseline Level 1) Ensure 'Minimum password age' is set to '1 or more day(s)'
Minimum_Password_Age = 1
# 1.1.4 (CIS Baseline Level 1) Ensure 'Minimum password length' is set to '14 or more character(s)'
Minimum_Password_Length = 12
# 1.1.5 (CIS Baseline Level 1) Ensure 'Password must meet complexity requirements' is set to 'Enabled'
Password_must_meet_complexity_requirements = 'Enabled'
# 1.1.6 (CIS Baseline Level 1) Ensure 'Store passwords using reversible encryption' is set to 'Disabled'
Store_passwords_using_reversible_encryption = 'Disabled'
# 1.2.1 (CIS Baseline Level 1) Ensure 'Account lockout duration' is set to '15 or more minute(s)'
Account_lockout_duration = 15
# 1.2.2 (CIS Baseline Level 1) Ensure 'Account lockout threshold' is set to '10 or fewer invalid logon attempt(s), but not 0'
Account_lockout_threshold = 10
# 1.2.3 (CIS Baseline Level 1) Ensure 'Reset account lockout counter after' is set to '15 or more minute(s)'
Reset_account_lockout_counter_after = 15
}
#>
# 2.2.21 (CIS Baseline Level 1) Ensure 'Deny access to this computer from the network' is set to 'Guests, Local account and member of Administrators group' (MS only)
# Adjusted; Allowed Administrators to connect to this computer from the network
UserRightsAssignment Denyaccesstothiscomputerfromthenetwork {
Policy = 'Deny_access_to_this_computer_from_the_network'
Identity = @('Guests', 'Local account')
Force = $True
}
# 18.9.102.2 (CIS Baseline Level 1) Ensure 'Configure Automatic Updates' is set to 'Enabled'
# Adjusted; Disabeld automatic windows update installation to allow Azure Automation Update management to manage windows updates.
Registry 'NoAutoUpdate' {
Force = $True
Ensure = 'Present'
Key = 'HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU'
ValueName = 'NoAutoUpdate'
ValueType = 'DWord'
ValueData = '1'
}
SecurityOption AccountSecurityOptions {
# 2.3.1.1 (CIS Baseline Level 1) Ensure 'Accounts: Administrator account status' is set to 'Disabled' (MS only)
# Adjusted; Local Admin is not disabeld by DSC due to incompatiblity with our Azure DevOps Pipeline.
# 2.3.1.5 (CIS Baseline Level 1) Configure 'Accounts: Rename administrator account'
# Adjusted; Rename of Admin Account is not required because it is default in Azure VMs
# 2.3.7.6 (CIS Baseline Level 2) Ensure 'Interactive logon: Number of previous logons to cache (in case domain controller is not available)' is set to '4 or fewer logon(s)' (MS only)
# Adjusted; Set to 0. Disables logon caching, completly
# 2.3.11.6 (CIS Baseline Level 1) Ensure 'Network security: Force logoff when logon hours expire' is set to 'Enabled'
#Adjusted; Gave me unexected issues, could not get it to work.
# 2.3.7.4 (CIS Baseline Level 1) Configure 'Interactive logon: Message text for users attempting to log on'
#Adjusted to; 'This system is restricted to authorized users. Individuals who attempt unauthorized access will be prosecuted. If you are unauthorized terminate access now. Click OK to indicate your acceptance of this information.'
Name = 'AccountSecurityOptions'
# 2.3.1.1 (CIS Baseline Level 1) Ensure 'Accounts: Administrator account status' is set to 'Disabled' (MS only)
#Accounts_Administrator_account_status = 'Disabled'
# 2.3.1.2 (CIS Baseline Level 1) Ensure 'Accounts: Block Microsoft accounts' is set to 'Users can't add or log on with Microsoft accounts'
Accounts_Block_Microsoft_accounts = 'Users cant add or log on with Microsoft accounts'
# 2.3.1.3 (CIS Baseline Level 1) Ensure 'Accounts: Guest account status' is set to 'Disabled' (MS only)
Accounts_Guest_account_status = 'Disabled'
# 2.3.1.4 (CIS Baseline Level 1) Ensure 'Accounts: Limit local account use of blank passwords to console logon only' is set to 'Enabled'
Accounts_Limit_local_account_use_of_blank_passwords_to_console_logon_only = 'Enabled'
# 2.3.1.5 (CIS Baseline Level 1) Configure 'Accounts: Rename administrator account'
#Accounts_Rename_administrator_account = 'User_Adm' # WARNING! Any value different from Administrator
# 2.3.1.6 (CIS Baseline Level 1) Configure 'Accounts: Rename guest account'
Accounts_Rename_guest_account = 'User_Guest' # WARNING! Any value different from Guest
# 2.3.2.1 (CIS Baseline Level 1) Ensure 'Audit: Force audit policy subcategory settings (Windows Vista or later) to override audit policy category settings' is set to 'Enabled'
Audit_Force_audit_policy_subcategory_settings_Windows_Vista_or_later_to_override_audit_policy_category_settings = 'Enabled'
# 2.3.2.2 (CIS Baseline Level 1) Ensure 'Audit: Shut down system immediately if unable to log security audits' is set to 'Disabled'
Audit_Shut_down_system_immediately_if_unable_to_log_security_audits = 'Disabled'
# 2.3.4.1 (CIS Baseline Level 1) Ensure 'Devices: Allowed to format and eject removable media' is set to 'Administrators'
Devices_Allowed_to_format_and_eject_removable_media = 'Administrators'
# 2.3.4.2 (CIS Baseline Level 1) Ensure 'Devices: Prevent users from installing printer drivers' is set to 'Enabled'
Devices_Prevent_users_from_installing_printer_drivers = 'Enabled'
# 2.3.6.1 (CIS Baseline Level 1) Ensure 'Domain member: Digitally encrypt or sign secure channel data (always)' is set to 'Enabled'
Domain_member_Digitally_encrypt_or_sign_secure_channel_data_always = 'Enabled'
# 2.3.6.2 (CIS Baseline Level 1) Ensure 'Domain member: Digitally encrypt secure channel data (when possible)' is set to 'Enabled'
Domain_member_Digitally_encrypt_secure_channel_data_when_possible = 'Enabled'
# 2.3.6.3 (CIS Baseline Level 1) Ensure 'Domain member: Digitally sign secure channel data (when possible)' is set to 'Enabled'
Domain_member_Digitally_sign_secure_channel_data_when_possible = 'Enabled'
# 2.3.6.4 (CIS Baseline Level 1) Ensure 'Domain member: Disable machine account password changes' is set to 'Disabled'
Domain_member_Disable_machine_account_password_changes = 'Disabled'
# 2.3.6.5 (CIS Baseline Level 1) Ensure 'Domain member: Maximum machine account password age' is set to '30 or fewer days, but not 0'
Domain_member_Maximum_machine_account_password_age = '30'
# 2.3.6.6 (CIS Baseline Level 1) Ensure 'Domain member: Require strong (Windows 2000 or later) session key' is set to 'Enabled'
Domain_member_Require_strong_Windows_2000_or_later_session_key = 'Enabled'
# 2.3.7.1 (CIS Baseline Level 1) Ensure 'Interactive logon: Do not display last user name' is set to 'Enabled'
Interactive_logon_Do_not_display_last_user_name = 'Enabled'
# 2.3.7.2 (CIS Baseline Level 1) Ensure 'Interactive logon: Do not require CTRL+ALT+DEL' is set to 'Disabled'
Interactive_logon_Do_not_require_CTRL_ALT_DEL = 'Disabled'
# 2.3.7.3 (CIS Baseline Level 1) Ensure 'Interactive logon: Machine inactivity limit' is set to '900 or fewer second(s), but not 0'
Interactive_logon_Machine_inactivity_limit = '900'
# 2.3.7.4 (CIS Baseline Level 1) Configure 'Interactive logon: Message text for users attempting to log on'
Interactive_logon_Message_text_for_users_attempting_to_log_on = 'This system is restricted to authorized users. Individuals who attempt unauthorized access will be prosecuted. If you are unauthorized terminate access now. Click OK to indicate your acceptance of this information.'
# 2.3.7.5 (CIS Baseline Level 1) Configure 'Interactive logon: Message title for users attempting to log on'
#Interactive_logon_Message_title_for_users_attempting_to_log_on = '<Logon Warning>'
Interactive_logon_Message_title_for_users_attempting_to_log_on = 'Logon Warning'
# 2.3.7.6 (CIS Baseline Level 2) Ensure 'Interactive logon: Number of previous logons to cache (in case domain controller is not available)' is set to '4 or fewer logon(s)' (MS only)
Interactive_logon_Number_of_previous_logons_to_cache_in_case_domain_controller_is_not_available = '0'
# 2.3.7.7 (CIS Baseline Level 1) Ensure 'Interactive logon: Prompt user to change password before expiration' is set to 'between 5 and 14 days'
Interactive_logon_Prompt_user_to_change_password_before_expiration = '14'
# 2.3.7.8 (CIS Baseline Level 1) Ensure 'Interactive logon: Require Domain Controller Authentication to unlock workstation' is set to 'Enabled' (MS only)
Interactive_logon_Require_Domain_Controller_authentication_to_unlock_workstation = 'Enabled'
# 2.3.7.9 (CIS Baseline Level 1) Ensure 'Interactive logon: Smart card removal behavior' is set to 'Lock Workstation' or higher
Interactive_logon_Smart_card_removal_behavior = 'Lock Workstation'
# 2.3.8.1 (CIS Baseline Level 1) Ensure 'Microsoft network client: Digitally sign communications (always)' is set to 'Enabled'
Microsoft_network_client_Digitally_sign_communications_always = 'Enabled'
# 2.3.8.2 (CIS Baseline Level 1) Ensure 'Microsoft network client: Digitally sign communications (if server agrees)' is set to 'Enabled'
Microsoft_network_client_Digitally_sign_communications_if_server_agrees = 'Enabled'
# 2.3.8.3 (CIS Baseline Level 1) Ensure 'Microsoft network client: Send unencrypted password to third-party SMB servers' is set to 'Disabled'
Microsoft_network_client_Send_unencrypted_password_to_third_party_SMB_servers = 'Disabled'
# 2.3.9.1 (CIS Baseline Level 1) Ensure 'Microsoft network server: Amount of idle time required before suspending session' is set to '15 or fewer minute(s), but not 0'
Microsoft_network_server_Amount_of_idle_time_required_before_suspending_session = '15'
# 2.3.9.2 (CIS Baseline Level 1) Ensure 'Microsoft network server: Digitally sign communications (always)' is set to 'Enabled'
Microsoft_network_server_Digitally_sign_communications_always = 'Enabled'
# 2.3.9.3 (CIS Baseline Level 1) Ensure 'Microsoft network server: Digitally sign communications (if client agrees)' is set to 'Enabled'
Microsoft_network_server_Digitally_sign_communications_if_client_agrees = 'Enabled'
# 2.3.9.4 (CIS Baseline Level 1) Ensure 'Microsoft network server: Disconnect clients when logon hours expire' is set to 'Enabled'
Microsoft_network_server_Disconnect_clients_when_logon_hours_expire = 'Enabled'
# 2.3.9.5 (CIS Baseline Level 1) Ensure 'Microsoft network server: Server SPN target name validation level' is set to 'Accept if provided by client' or higher (MS only)
Microsoft_network_server_Server_SPN_target_name_validation_level = 'Required from client'
# 2.3.10.1 (CIS Baseline Level 1) Ensure 'Network access: Allow anonymous SID/Name translation' is set to 'Disabled'
Network_access_Allow_anonymous_SID_Name_translation = 'Disabled'
# 2.3.10.2 (CIS Baseline Level 1) Ensure 'Network access: Do not allow anonymous enumeration of SAM accounts' is set to 'Enabled' (MS only)
Network_access_Do_not_allow_anonymous_enumeration_of_SAM_accounts = 'Enabled'
# 2.3.10.3 (CIS Baseline Level 1) Ensure 'Network access: Do not allow anonymous enumeration of SAM accounts and shares' is set to 'Enabled' (MS only)
Network_access_Do_not_allow_anonymous_enumeration_of_SAM_accounts_and_shares = 'Enabled'
# 2.3.10.4 (CIS Baseline Level 2) Ensure 'Network access: Do not allow storage of passwords and credentials for network authentication' is set to 'Enabled'
Network_access_Do_not_allow_storage_of_passwords_and_credentials_for_network_authentication = 'Enabled'
# 2.3.10.5 (CIS Baseline Level 1) Ensure 'Network access: Let Everyone permissions apply to anonymous users' is set to 'Disabled'
Network_access_Let_Everyone_permissions_apply_to_anonymous_users = 'Disabled'
# 2.3.10.7 (CIS Baseline Level 1) Configure 'Network access: Named Pipes that can be accessed anonymously' (MS only)
# 2.3.10.8 (CIS Baseline Level 1) Configure 'Network access: Remotely accessible registry paths'
# Commented out because of bug in SecurityPolicyDSC Module https://github.com/dsccommunity/SecurityPolicyDSC/issues/83
#Network_access_Remotely_accessible_registry_paths = 'System\CurrentControlSet\Control\ProductOptions, System\CurrentControlSet\Control\Server Applications, SOFTWARE\Microsoft\Windows NT\CurrentVersion'
# 2.3.10.9 (CIS Baseline Level 1) Configure 'Network access: Remotely accessible registry paths and sub-paths'
# Commented out because of bug in SecurityPolicyDSC Module https://github.com/dsccommunity/SecurityPolicyDSC/issues/83
#Network_access_Remotely_accessible_registry_paths_and_subpaths = 'System\CurrentControlSet\Control\Print\Printers, System\CurrentControlSet\Services\Eventlog, Software\Microsoft\OLAP Server, Software\Microsoft\Windows NT\CurrentVersion\Print, Software\Microsoft\Windows NT\CurrentVersion\Windows, System\CurrentControlSet\Control\ContentIndex, System\CurrentControlSet\Control\Terminal Server, System\CurrentControlSet\Control\Terminal Server\UserConfig, System\CurrentControlSet\Control\Terminal Server\DefaultUserConfiguration, Software\Microsoft\Windows NT\CurrentVersion\Perflib, System\CurrentControlSet\Services\SysmonLog'
# 2.3.10.10 (CIS Baseline Level 1) Ensure 'Network access: Restrict anonymous access to Named Pipes and Shares' is set to 'Enabled'
Network_access_Restrict_anonymous_access_to_Named_Pipes_and_Shares = 'Enabled'
# 2.3.10.11 (CIS Baseline Level 1) Ensure 'Network access: Restrict clients allowed to make remote calls to SAM' is set to 'Administrators: Remote Access: Allow' (MS only)
#Network_access_Restrict_clients_allowed_to_make_remote_calls_to_SAM = 'Administrators: Remote Access: Allow'
Network_access_Restrict_clients_allowed_to_make_remote_calls_to_SAM = @(
MSFT_RestrictedRemoteSamSecurityDescriptor {
Permission = 'Allow'
Identity = 'Administrators'
}
)
# 2.3.10.12 (CIS Baseline Level 1) Ensure 'Network access: Shares that can be accessed anonymously' is set to 'None'
Network_access_Shares_that_can_be_accessed_anonymously = ''
# 2.3.10.13 (CIS Baseline Level 1) Ensure 'Network access: Sharing and security model for local accounts' is set to 'Classic - local users authenticate as themselves'
Network_access_Sharing_and_security_model_for_local_accounts = 'Classic - local users authenticate as themselves'
# 2.3.11.1 (CIS Baseline Level 1) Ensure 'Network security: Allow Local System to use computer identity for NTLM' is set to 'Enabled'
Network_security_Allow_Local_System_to_use_computer_identity_for_NTLM = 'Enabled'
# 2.3.11.2 (CIS Baseline Level 1) Ensure 'Network security: Allow LocalSystem NULL session fallback' is set to 'Disabled'
Network_security_Allow_LocalSystem_NULL_session_fallback = 'Disabled'
# 2.3.11.3 (CIS Baseline Level 1) Ensure 'Network Security: Allow PKU2U authentication requests to this computer to use online identities' is set to 'Disabled'
Network_security_Allow_PKU2U_authentication_requests_to_this_computer_to_use_online_identities = 'Disabled'
# 2.3.11.4 (CIS Baseline Level 1) Ensure 'Network security: Configure encryption types allowed for Kerberos' is set to 'AES128_HMAC_SHA1, AES256_HMAC_SHA1, Future encryption types'
Network_security_Configure_encryption_types_allowed_for_Kerberos = 'AES128_HMAC_SHA1', 'AES256_HMAC_SHA1', 'FUTURE'
# 2.3.11.5 (CIS Baseline Level 1) Ensure 'Network security: Do not store LAN Manager hash value on next password change' is set to 'Enabled'
Network_security_Do_not_store_LAN_Manager_hash_value_on_next_password_change = 'Enabled'
# 2.3.11.6 (CIS Baseline Level 1) Ensure 'Network security: Force logoff when logon hours expire' is set to 'Enabled'
#Network_security_Force_logoff_when_logon_hours_expire = 'Enabled'
# 2.3.11.7 (CIS Baseline Level 1) Ensure 'Network security: LAN Manager authentication level' is set to 'Send NTLMv2 response only. Refuse LM & NTLM'
Network_security_LAN_Manager_authentication_level = 'Send NTLMv2 responses only. Refuse LM & NTLM'
# 2.3.11.8 (CIS Baseline Level 1) Ensure 'Network security: LDAP client signing requirements' is set to 'Negotiate signing' or higher
Network_security_LDAP_client_signing_requirements = 'Negotiate signing'
# 2.3.11.9 (CIS Baseline Level 1) Ensure 'Network security: Minimum session security for NTLM SSP based (including secure RPC) clients' is set to 'Require NTLMv2 session security, Require 128-bit encryption'
Network_security_Minimum_session_security_for_NTLM_SSP_based_including_secure_RPC_clients = 'Both options checked'
# 2.3.11.10 (CIS Baseline Level 1) Ensure 'Network security: Minimum session security for NTLM SSP based (including secure RPC) servers' is set to 'Require NTLMv2 session security, Require 128-bit encryption'
Network_security_Minimum_session_security_for_NTLM_SSP_based_including_secure_RPC_servers = 'Both options checked'
# 2.3.13.1 (CIS Baseline Level 1) Ensure 'Shutdown: Allow system to be shut down without having to log on' is set to 'Disabled'
Shutdown_Allow_system_to_be_shut_down_without_having_to_log_on = 'Disabled'
# 2.3.15.1 (CIS Baseline Level 1) Ensure 'System objects: Require case insensitivity for non-Windows subsystems' is set to 'Enabled'
System_objects_Require_case_insensitivity_for_non_Windows_subsystems = 'Enabled'
# 2.3.15.2 (CIS Baseline Level 1) Ensure 'System objects: Strengthen default permissions of internal system objects (e.g. Symbolic Links)' is set to 'Enabled'
System_objects_Strengthen_default_permissions_of_internal_system_objects_eg_Symbolic_Links = 'Enabled'
# 2.3.17.1 (CIS Baseline Level 1) Ensure 'User Account Control: Admin Approval Mode for the Built-in Administrator account' is set to 'Enabled'
User_Account_Control_Admin_Approval_Mode_for_the_Built_in_Administrator_account = 'Enabled'
# 2.3.17.2 (CIS Baseline Level 1) Ensure 'User Account Control: Allow UIAccess applications to prompt for elevation without using the secure desktop' is set to 'Disabled'
User_Account_Control_Allow_UIAccess_applications_to_prompt_for_elevation_without_using_the_secure_desktop = 'Disabled'
# 2.3.17.3 (CIS Baseline Level 1) Ensure 'User Account Control: Behavior of the elevation prompt for administrators in Admin Approval Mode' is set to 'Prompt for consent on the secure desktop'
User_Account_Control_Behavior_of_the_elevation_prompt_for_administrators_in_Admin_Approval_Mode = 'Prompt for consent on the secure desktop'
# 2.3.17.4 (CIS Baseline Level 1) Ensure 'User Account Control: Behavior of the elevation prompt for standard users' is set to 'Automatically deny elevation requests'
User_Account_Control_Behavior_of_the_elevation_prompt_for_standard_users = 'Automatically deny elevation request'
# 2.3.17.5 (CIS Baseline Level 1) Ensure 'User Account Control: Detect application installations and prompt for elevation' is set to 'Enabled'
User_Account_Control_Detect_application_installations_and_prompt_for_elevation = 'Enabled'
# 2.3.17.6 (CIS Baseline Level 1) Ensure 'User Account Control: Only elevate UIAccess applications that are installed in secure locations' is set to 'Enabled'
User_Account_Control_Only_elevate_UIAccess_applications_that_are_installed_in_secure_locations = 'Enabled'
# 2.3.17.7 (CIS Baseline Level 1) Ensure 'User Account Control: Run all administrators in Admin Approval Mode' is set to 'Enabled'
User_Account_Control_Run_all_administrators_in_Admin_Approval_Mode = 'Enabled'
# 2.3.17.8 (CIS Baseline Level 1) Ensure 'User Account Control: Switch to the secure desktop when prompting for elevation' is set to 'Enabled'
User_Account_Control_Switch_to_the_secure_desktop_when_prompting_for_elevation = 'Enabled'
# 2.3.17.9 (CIS Baseline Level 1) Ensure 'User Account Control: Virtualize file and registry write failures to per-user locations' is set to 'Enabled'
User_Account_Control_Virtualize_file_and_registry_write_failures_to_per_user_locations = 'Enabled'
}
######################################################################################################################################################################################
# CIS Baseline Level 1
# Azure Security Center Baseline
######################################################################################################################################################################################
#Security Center: 90007-Enabled Cached Logon Credential
Registry 'EnabledCachedLogonCredential' {
Force = $True
Ensure = 'Present'
Key = 'HKEY_LOCAL_MACHINE\Software\Microsoft\Windows Nt\CurrentVersion\Winlogon'
ValueName = 'CachedLogonsCount'
ValueType = 'String'
ValueData = '0'
}
#AZ-WIN-00130
#Ensure 'Allow Cortana above lock screen' is set to 'Disabled'
Registry 'AllowCortanaAboveLockScreenDisabled' {
Force = $True
Ensure = 'Present'
Key = 'HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search'
ValueName = 'AllowCortanaAboveLock'
ValueType = 'Dword'
ValueData = '0'
}
#AZ-WIN-00131
#Ensure 'Allow Cortana' is set to 'Disabled'
Registry 'AllowCortanaDisabled' {
Force = $True
Ensure = 'Present'
Key = 'HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search'
ValueName = 'AllowCortana'
ValueType = 'Dword'
ValueData = '0'
}
#AZ-WIN-00133
#Ensure 'Allow search and Cortana to use location' is set to 'Disabled'
Registry 'AllowCortanaToUseLocation' {
Force = $True
Ensure = 'Present'
Key = 'HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search'
ValueName = 'AllowSearchToUseLocation'
ValueType = 'Dword'
ValueData = '0'
}
#AZ-WIN-00155
#System settings: Use Certificate Rules on Windows Executables for Software Restriction Policies
#https://www.stigviewer.com/stig/windows_2003_member_server/2014-04-02/finding/V-4446
Registry 'AuthenticodeEnabled' {
Force = $True
Ensure = 'Present'
Key = 'HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\Safer\CodeIdentifiers'
ValueName = 'AuthenticodeEnabled'
ValueType = 'Dword'
ValueData = '1'
}
# CceId: CCE-36063-6
# DataSource: Registry Policy
# Ensure 'Windows Firewall: Private: Settings: Apply local connection security rules' is set to 'Yes (default)'
Registry 'AllowLocalIPsecPolicyMerge1' {
Force = $True
Ensure = 'Present'
Key = 'HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\WindowsFirewall\PrivateProfile'
ValueName = 'AllowLocalIPsecPolicyMerge'
ValueType = 'DWord'
ValueData = '1'
}
# CceId: CCE-38040-2
# DataSource: Registry Policy
# Ensure 'Windows Firewall: Domain: Settings: Apply local connection security rules' is set to 'Yes (default)'
Registry 'AllowLocalIPsecPolicyMergeDomain' {
Force = $True
Ensure = 'Present'
Key = 'HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile'
ValueName = 'AllowLocalIPsecPolicyMerge'
ValueType = 'DWord'
ValueData = '1'
}
# CceId: CCE-36000-8
# DataSource: Registry Policy
# Ensure 'Disallow WinRM from storing RunAs credentials' is set to 'Enabled'
Registry 'DisableRunAs' {
Force = $True
Ensure = 'Present'
Key = 'HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\WinRM\Service'
ValueName = 'DisableRunAs'
ValueType = 'DWord'
ValueData = '1'
}
# Control no: AZ-WIN-00088
# DataSource: Registry Policy
# Windows Firewall: Domain: Allow unicast response
Registry 'DisableUnicastResponsesToMulticastBroadcastDomain' {
Force = $True
Ensure = 'Present'
Key = 'HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\WindowsFirewall\DomainProfile'
ValueName = 'DisableUnicastResponsesToMulticastBroadcast'
ValueType = 'DWord'
ValueData = '0'
}
# Control no: AZ-WIN-00089
# DataSource: Registry Policy
# Windows Firewall: Private: Allow unicast response
Registry 'DisableUnicastResponsesToMulticastBroadcastPrivate' {
Force = $True
Ensure = 'Present'
Key = 'HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\WindowsFirewall\PrivateProfile'
ValueName = 'DisableUnicastResponsesToMulticastBroadcast'
ValueType = 'DWord'
ValueData = '0'
}
# Control no: AZ-WIN-00090
# DataSource: Registry Policy
# Windows Firewall: Public: Allow unicast response
Registry 'DisableUnicastResponsesToMulticastBroadcastPublic' {
Force = $True
Ensure = 'Present'
Key = 'HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\WindowsFirewall\PublicProfile'
ValueName = 'DisableUnicastResponsesToMulticastBroadcast'
ValueType = 'DWord'
ValueData = '1'
}
# Control no: AZ-WIN-00120
# DataSource: Registry Policy
# Devices: Allow undock without having to log on
Registry 'UndockWithoutLogon' {
Force = $True
Ensure = 'Present'
Key = 'HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System'
ValueName = 'UndockWithoutLogon'
ValueType = 'DWord'
ValueData = '0'
}
# Control no: AZ-WIN-00152
# DataSource: Registry Policy
# Specify the interval to check for definition updates
Registry 'SignatureUpdateInterval' {
Force = $True
Ensure = 'Present'
Key = 'HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Microsoft Antimalware\Signature Updates'
ValueName = 'SignatureUpdateInterval'
ValueType = 'DWord'
ValueData = '8'
}
# Control No: AZ-WIN-00119 & AZ-WIN-00184
# DataSource: Security Policy
# Bypass traverse checking
UserRightsAssignment Bypasstraversechecking {
Policy = 'Bypass_traverse_checking'
Identity = @('Administrators', 'Authenticated Users', 'Backup Operators', 'Local Service', 'Network Service')
Force = $True
}
#AZ-WIN-00185
#Increase a process working set
UserRightsAssignment IncreaseAProcessWorkingSet {
Policy = 'Increase_a_process_working_set'
Identity = @('Administrators', 'Local Service')
Force = $True
}
# 2.2.1 (CIS Baseline Level 1) Ensure 'Access Credential Manager as a trusted caller' is set to 'No One'
UserRightsAssignment AccessCredentialManagerasatrustedcaller {
Policy = 'Access_Credential_Manager_as_a_trusted_caller'
Identity = ''
Force = $True
}
# 2.2.3 (CIS Baseline Level 1) Ensure 'Access this computer from the network' is set to 'Administrators, Authenticated Users' (MS only)
UserRightsAssignment Accessthiscomputerfromthenetwork {
Policy = 'Access_this_computer_from_the_network'
Identity = @('Administrators', 'Authenticated Users')
Force = $True
}
# 2.2.4 (CIS Baseline Level 1) Ensure 'Act as part of the operating system' is set to 'No One'
UserRightsAssignment Actaspartoftheoperatingsystem {
Policy = 'Act_as_part_of_the_operating_system'
Identity = ''
Force = $True
}
# 2.2.6 (CIS Baseline Level 1) Ensure 'Adjust memory quotas for a process' is set to 'Administrators, LOCAL SERVICE, NETWORK SERVICE'
UserRightsAssignment Adjustmemoryquotasforaprocess {
Policy = 'Adjust_memory_quotas_for_a_process'
Identity = @('Administrators', 'LOCAL SERVICE', 'NETWORK SERVICE')
Force = $True
}
# 2.2.7 (CIS Baseline Level 1) Ensure 'Allow log on locally' is set to 'Administrators'
# CceId: CCE-37659-0
# DataSource: Security Policy
# Ensure 'Allow log on locally' is set to 'Administrators'
UserRightsAssignment Allowlogonlocally {
Policy = 'Allow_log_on_locally'
Identity = 'Administrators'
Force = $True
}
# 2.2.9 (CIS Baseline Level 1) Ensure 'Allow log on through Remote Desktop Services' is set to 'Administrators, Remote Desktop Users' (MS only)
UserRightsAssignment AllowlogonthroughRemoteDesktopServices {
Policy = 'Allow_log_on_through_Remote_Desktop_Services'
Identity = @('Administrators', 'Remote Desktop Users')
Force = $True
}
# 2.2.10 (CIS Baseline Level 1) Ensure 'Back up files and directories' is set to 'Administrators'
UserRightsAssignment Backupfilesanddirectories {
Policy = 'Back_up_files_and_directories'
Identity = 'Administrators'
Force = $True
}
# 2.2.11 (CIS Baseline Level 1) Ensure 'Change the system time' is set to 'Administrators, LOCAL SERVICE'
UserRightsAssignment Changethesystemtime {
Policy = 'Change_the_system_time'
Identity = @('Administrators', 'LOCAL SERVICE')
Force = $True
}
# 2.2.12 (CIS Baseline Level 1) Ensure 'Change the time zone' is set to 'Administrators, LOCAL SERVICE'
UserRightsAssignment Changethetimezone {
Policy = 'Change_the_time_zone'
Identity = @('Administrators', 'LOCAL SERVICE')
Force = $True
}
# 2.2.13 (CIS Baseline Level 1) Ensure 'Create a pagefile' is set to 'Administrators'
UserRightsAssignment Createapagefile {
Policy = 'Create_a_pagefile'
Identity = 'Administrators'
Force = $True
}
# 2.2.14 (CIS Baseline Level 1) Ensure 'Create a token object' is set to 'No One'
UserRightsAssignment Createatokenobject {
Policy = 'Create_a_token_object'
Identity = ''
Force = $True
}
# 2.2.15 (CIS Baseline Level 1) Ensure 'Create global objects' is set to 'Administrators, LOCAL SERVICE, NETWORK SERVICE, SERVICE'
UserRightsAssignment Createglobalobjects {
Policy = 'Create_global_objects'
Identity = @('Administrators', 'LOCAL SERVICE', 'NETWORK SERVICE', 'SERVICE')
Force = $True
}
# 2.2.16 (CIS Baseline Level 1) Ensure 'Create permanent shared objects' is set to 'No One'
UserRightsAssignment Createpermanentsharedobjects {
Policy = 'Create_permanent_shared_objects'
Identity = ''
Force = $True
}
# 2.2.18 (CIS Baseline Level 1) Ensure 'Create symbolic links' is set to 'Administrators, NT VIRTUAL MACHINE\Virtual Machines' (MS only)
UserRightsAssignment Createsymboliclinks {
Policy = 'Create_symbolic_links'
Identity = @('Administrators', 'NT VIRTUAL MACHINE\Virtual Machines')
Force = $True
}
# 2.2.19 (CIS Baseline Level 1) Ensure 'Debug programs' is set to 'Administrators'
UserRightsAssignment Debugprograms {
Policy = 'Debug_programs'
Identity = 'Administrators'
Force = $True
}
# 2.2.22 (CIS Baseline Level 1) Ensure 'Deny log on as a batch job' to include 'Guests'
UserRightsAssignment Denylogonasabatchjob {
Policy = 'Deny_log_on_as_a_batch_job'
Identity = 'Guests'
Force = $True
}
# 2.2.23 (CIS Baseline Level 1) Ensure 'Deny log on as a service' to include 'Guests'
UserRightsAssignment Denylogonasaservice {
Policy = 'Deny_log_on_as_a_service'
Identity = 'Guests'
Force = $True
}
# 2.2.24 (CIS Baseline Level 1) Ensure 'Deny log on locally' to include 'Guests'
UserRightsAssignment Denylogonlocally {
Policy = 'Deny_log_on_locally'
Identity = 'Guests'
Force = $True
}
# 2.2.26 (CIS Baseline Level 1) Ensure 'Deny log on through Remote Desktop Services' is set to 'Guests, Local account' (MS only)
UserRightsAssignment DenylogonthroughRemoteDesktopServices {
Policy = 'Deny_log_on_through_Remote_Desktop_Services'
Identity = @('Guests', 'Local account')
Force = $True
}
# 2.2.28 (CIS Baseline Level 1) Ensure 'Enable computer and user accounts to be trusted for delegation' is set to 'No One' (MS only)
UserRightsAssignment Enablecomputeranduseraccountstobetrustedfordelegation {
Policy = 'Enable_computer_and_user_accounts_to_be_trusted_for_delegation'
Identity = ''
Force = $True
}
# 2.2.29 (CIS Baseline Level 1) Ensure 'Force shutdown from a remote system' is set to 'Administrators'
UserRightsAssignment Forceshutdownfromaremotesystem {
Policy = 'Force_shutdown_from_a_remote_system'
Identity = 'Administrators'
Force = $True
}
# 2.2.30 (CIS Baseline Level 1) Ensure 'Generate security audits' is set to 'LOCAL SERVICE, NETWORK SERVICE'
UserRightsAssignment Generatesecurityaudits {
Policy = 'Generate_security_audits'
Identity = @('LOCAL SERVICE', 'NETWORK SERVICE')
Force = $True
}
# 2.2.33 (CIS Baseline Level 1) Ensure 'Increase scheduling priority' is set to 'Administrators'
# CceId: CCE-38326-5
# DataSource: Security Policy
# Ensure 'Increase scheduling priority' is set to 'Administrators'
UserRightsAssignment Increaseschedulingpriority {
Policy = 'Increase_scheduling_priority'
Identity = 'Administrators'
Force = $True
}
# 2.2.34 (CIS Baseline Level 1) Ensure 'Load and unload device drivers' is set to 'Administrators'
UserRightsAssignment Loadandunloaddevicedrivers {
Policy = 'Load_and_unload_device_drivers'
Identity = 'Administrators'
Force = $True
}
# 2.2.35 (CIS Baseline Level 1) Ensure 'Lock pages in memory' is set to 'No One'
UserRightsAssignment Lockpagesinmemory {
Policy = 'Lock_pages_in_memory'
Identity = ''
Force = $True
}
# 2.2.38 (CIS Baseline Level 1) Ensure 'Manage auditing and security log' is set to 'Administrators' (MS only)
UserRightsAssignment Manageauditingandsecuritylog {
Policy = 'Manage_auditing_and_security_log'
Identity = 'Administrators'
Force = $True
}
# 2.2.39 (CIS Baseline Level 1) Ensure 'Modify an object label' is set to 'No One'
UserRightsAssignment Modifyanobjectlabel {
Policy = 'Modify_an_object_label'
Identity = ''
Force = $True
}
# 2.2.40 (CIS Baseline Level 1) Ensure 'Modify firmware environment values' is set to 'Administrators'
UserRightsAssignment Modifyfirmwareenvironmentvalues {
Policy = 'Modify_firmware_environment_values'
Identity = 'Administrators'
Force = $True
}
# 2.2.41 (CIS Baseline Level 1) Ensure 'Perform volume maintenance tasks' is set to 'Administrators'
UserRightsAssignment Performvolumemaintenancetasks {
Policy = 'Perform_volume_maintenance_tasks'
Identity = 'Administrators'
Force = $True
}
# 2.2.42 (CIS Baseline Level 1) Ensure 'Profile single process' is set to 'Administrators'
UserRightsAssignment Profilesingleprocess {
Policy = 'Profile_single_process'
Identity = 'Administrators'
Force = $True
}
# 2.2.43 (CIS Baseline Level 1) Ensure 'Profile system performance' is set to 'Administrators, NT SERVICE\WdiServiceHost'
UserRightsAssignment Profilesystemperformance {
Policy = 'Profile_system_performance'
Identity = @('Administrators', 'NT SERVICE\WdiServiceHost')
Force = $True
}
# 2.2.44 (CIS Baseline Level 1) Ensure 'Replace a process level token' is set to 'LOCAL SERVICE, NETWORK SERVICE'
UserRightsAssignment Replaceaprocessleveltoken {
Policy = 'Replace_a_process_level_token'
Identity = @('LOCAL SERVICE', 'NETWORK SERVICE')
Force = $True
}
# 2.2.45 (CIS Baseline Level 1) Ensure 'Restore files and directories' is set to 'Administrators'
UserRightsAssignment Restorefilesanddirectories {
Policy = 'Restore_files_and_directories'
Identity = 'Administrators'
Force = $True
}
# 2.2.46 (CIS Baseline Level 1) Ensure 'Shut down the system' is set to 'Administrators'
# CceId: CCE-38328-1
# DataSource: Security Policy
# Ensure 'Shut down the system' is set to 'Administrators'
UserRightsAssignment Shutdownthesystem {
Policy = 'Shut_down_the_system'
Identity = 'Administrators'
Force = $True
}
# 2.2.48 (CIS Baseline Level 1) Ensure 'Take ownership of files or other objects' is set to 'Administrators'
UserRightsAssignment Takeownershipoffilesorotherobjects {
Policy = 'Take_ownership_of_files_or_other_objects'
Identity = 'Administrators'
Force = $True
}
# 9.1.1 (CIS Baseline Level 1) Ensure 'Windows Firewall: Domain: Firewall state' is set to 'On (recommended)'
# CceId: CCE-36062-8
Registry 'EnableFirewallDomain' {
Key = 'HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile'
ValueName = 'EnableFirewall'
ValueType = 'DWord'
ValueData = '1'
}
# 9.1.2 (CIS Baseline Level 1) Ensure 'Windows Firewall: Domain: Inbound connections' is set to 'Block (default)'
Registry 'DefaultInboundActionDomain' {
Key = 'HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile'
ValueName = 'DefaultInboundAction'
ValueType = 'DWord'
ValueData = '1'
}
# 9.1.3 (CIS Baseline Level 1) Ensure 'Windows Firewall: Domain: Outbound connections' is set to 'Allow (default)'
# CCE-36146-9
Registry 'DefaultOutboundActionDomain' {
Key = 'HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile'
ValueName = 'DefaultOutboundAction'
ValueType = 'DWord'
ValueData = '0'
}
# 9.1.4 (CIS Baseline Level 1) Ensure 'Windows Firewall: Domain: Settings: Display a notification' is set to 'No'
# CceId: CCE-38041-0
# DataSource: Registry Policy
# Windows Firewall: Domain: Display a notification
Registry 'DisableNotificationsDomain' {
Key = 'HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile'
ValueName = 'DisableNotifications'
ValueType = 'DWord'
ValueData = '1'
}
# 9.1.5 (CIS Baseline Level 1) Ensure 'Windows Firewall: Domain: Logging: Name' is set to '%SYSTEMROOT%\System32\logfiles\firewall\domainfw.log'
Registry 'LogFilePathDomain' {
Force = $True
Ensure = 'Present'
Key = 'HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile\Logging'
ValueName = 'LogFilePath'
ValueType = 'String'
ValueData = '%SystemRoot%\System32\logfiles\firewall\domainfw.log'
}
# 9.1.6 (CIS Baseline Level 1) Ensure 'Windows Firewall: Domain: Logging: Size limit (KB)' is set to '16,384 KB or greater'
Registry 'LogFileSizeDomain' {
Force = $True
Ensure = 'Present'
Key = 'HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile\Logging'
ValueName = 'LogFileSize'
ValueType = 'DWord'
ValueData = '16384'
}
# 9.1.7 (CIS Baseline Level 1) Ensure 'Windows Firewall: Domain: Logging: Log dropped packets' is set to 'Yes'
Registry 'LogDroppedPacketsDomain' {
Force = $True
Ensure = 'Present'
Key = 'HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile\Logging'
ValueName = 'LogDroppedPackets'
ValueType = 'DWord'
ValueData = '1'
}
# 9.1.8 (CIS Baseline Level 1) Ensure 'Windows Firewall: Domain: Logging: Log successful connections' is set to 'Yes'
Registry 'LogSuccessfulConnectionsDomain' {
Force = $True
Ensure = 'Present'
Key = 'HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile\Logging'
ValueName = 'LogSuccessfulConnections'
ValueType = 'DWord'
ValueData = '1'
}
# 9.2.1 (CIS Baseline Level 1) Ensure 'Windows Firewall: Private: Firewall state' is set to 'On (recommended)'
Registry 'EnableFirewallPrivate' {
Force = $True
Ensure = 'Present'
Key = 'HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile'
ValueName = 'EnableFirewall'
ValueType = 'DWord'
ValueData = '1'
}
# 9.2.2 (CIS Baseline Level 1) Ensure 'Windows Firewall: Private: Inbound connections' is set to 'Block (default)'
Registry 'DefaultInboundActionPrivate' {
Force = $True
Ensure = 'Present'
Key = 'HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile'
ValueName = 'DefaultInboundAction'
ValueType = 'DWord'
ValueData = '1'
}
# 9.2.3 (CIS Baseline Level 1) Ensure 'Windows Firewall: Private: Outbound connections' is set to 'Allow (default)'
Registry 'DefaultOutboundActionPrivate' {
Force = $True
Ensure = 'Present'
Key = 'HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile'
ValueName = 'DefaultOutboundAction'
ValueType = 'DWord'
ValueData = '0'
}
# 9.2.4 (CIS Baseline Level 1) Ensure 'Windows Firewall: Private: Settings: Display a notification' is set to 'No'
# CceId: CCE-37621-0
# DataSource: Registry Policy
# Windows Firewall: Private: Display a notification
Registry 'DisableNotificationsPrivate' {
Force = $True
Ensure = 'Present'
Key = 'HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile'
ValueName = 'DisableNotifications'
ValueType = 'DWord'
ValueData = '1'
}
# 9.2.5 (CIS Baseline Level 1) Ensure 'Windows Firewall: Private: Logging: Name' is set to '%SYSTEMROOT%\System32\logfiles\firewall\privatefw.log'
Registry 'LogFilePathPrivate' {
Force = $True
Ensure = 'Present'
Key = 'HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile\Logging'
ValueName = 'LogFilePath'
ValueType = 'String'
ValueData = '%SystemRoot%\System32\logfiles\firewall\privatefw.log'
}
# 9.2.6 (CIS Baseline Level 1) Ensure 'Windows Firewall: Private: Logging: Size limit (KB)' is set to '16,384 KB or greater'
Registry 'LogFileSizePrivate' {
Force = $True
Ensure = 'Present'
Key = 'HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile\Logging'
ValueName = 'LogFileSize'
ValueType = 'DWord'
ValueData = '16384'
}
# 9.2.7 (CIS Baseline Level 1) Ensure 'Windows Firewall: Private: Logging: Log dropped packets' is set to 'Yes'
Registry 'LogDroppedPacketsPrivate' {
Force = $True
Ensure = 'Present'
Key = 'HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile\Logging'
ValueName = 'LogDroppedPackets'
ValueType = 'DWord'
ValueData = '1'
}
# 9.2.8 (CIS Baseline Level 1) Ensure 'Windows Firewall: Private: Logging: Log successful connections' is set to 'Yes'
Registry 'LogSuccessfulConnectionsPrivate' {
Force = $True
Ensure = 'Present'
Key = 'HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PrivateProfile\Logging'
ValueName = 'LogSuccessfulConnections'
ValueType = 'DWord'
ValueData = '1'
}
# 9.3.1 (CIS Baseline Level 1) Ensure 'Windows Firewall: Public: Firewall state' is set to 'On (recommended)'
Registry 'EnableFirewallPublic' {
Force = $True
Ensure = 'Present'
Key = 'HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile'
ValueName = 'EnableFirewall'
ValueType = 'DWord'
ValueData = '1'
}
# 9.3.2 (CIS Baseline Level 1) Ensure 'Windows Firewall: Public: Inbound connections' is set to 'Block (default)'
Registry 'DefaultInboundActionPublic' {
Force = $True
Ensure = 'Present'
Key = 'HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile'
ValueName = 'DefaultInboundAction'
ValueType = 'DWord'
ValueData = '1'
}
# 9.3.3 (CIS Baseline Level 1) Ensure 'Windows Firewall: Public: Outbound connections' is set to 'Allow (default)'
Registry 'DefaultOutboundActionPublic' {
Force = $True
Ensure = 'Present'
Key = 'HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile'
ValueName = 'DefaultOutboundAction'
ValueType = 'DWord'
ValueData = '0'
}
# 9.3.4 (CIS Baseline Level 1) Ensure 'Windows Firewall: Public: Settings: Display a notification' is set to 'No'
# CceId: CCE-38043-6
# DataSource: Registry Policy
# Windows Firewall: Public: Display a notification
Registry 'DisableNotificationsPublic' {
Force = $True
Ensure = 'Present'
Key = 'HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile'
ValueName = 'DisableNotifications'
ValueType = 'DWord'
ValueData = '1'
}
# 9.3.5 (CIS Baseline Level 1) Ensure 'Windows Firewall: Public: Settings: Apply local firewall rules' is set to 'No'
# CceId: CCE-37861-2
# DataSource: Registry Policy
# Ensure 'Windows Firewall: Public: Settings: Apply local firewall rules' is set to 'No'
Registry 'AllowLocalPolicyMerge' {
Force = $True
Ensure = 'Present'
Key = 'HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile'
ValueName = 'AllowLocalPolicyMerge'
ValueType = 'DWord'
ValueData = '0'
}
# 9.3.6 (CIS Baseline Level 1) Ensure 'Windows Firewall: Public: Settings: Apply local connection security rules' is set to 'No'
# CceId: CCE-36268-1
# DataSource: Registry Policy
# Ensure 'Windows Firewall: Public: Settings: Apply local connection security rules' is set to 'No'
Registry 'AllowLocalIPsecPolicyMerge' {
Force = $True
Ensure = 'Present'
Key = 'HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile'
ValueName = 'AllowLocalIPsecPolicyMerge'
ValueType = 'DWord'
ValueData = '0'
}
# 9.3.7 (CIS Baseline Level 1) Ensure 'Windows Firewall: Public: Logging: Name' is set to '%SYSTEMROOT%\System32\logfiles\firewall\publicfw.log'
Registry 'LogFilePathPublic' {
Force = $True
Ensure = 'Present'
Key = 'HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\WindowsFirewall\PublicProfile\Logging'
ValueName = 'LogFilePath'
ValueType = 'String'
ValueData = '%SystemRoot%\System32\logfiles\firewall\publicfw.log'
}
# 9.3.8 (CIS Baseline Level 1) Ensure 'Windows Firewall: Public: Logging: Size limit (KB)' is set to '16,384 KB or greater'
Registry 'LogFileSizePublic' {
Force = $True
Ensure = 'Present'
Key = 'HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile\Logging'
ValueName = 'LogFileSize'
ValueType = 'Dword'
ValueData = '16384'
}
# 9.3.9 (CIS Baseline Level 1) Ensure 'Windows Firewall: Public: Logging: Log dropped packets' is set to 'Yes'
Registry 'LogDroppedPacketsPublic' {
Force = $True
Ensure = 'Present'
Key = 'HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile\Logging'
ValueName = 'LogDroppedPackets'
ValueType = 'DWord'
ValueData = '1'
}
# 9.3.10 (CIS Baseline Level 1) Ensure 'Windows Firewall: Public: Logging: Log successful connections' is set to 'Yes'
Registry 'LogSuccessfulConnectionsPublic' {
Force = $True
Ensure = 'Present'
Key = 'HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\PublicProfile\Logging'
ValueName = 'LogSuccessfulConnections'
ValueType = 'DWord'
ValueData = '1'
}
# 17.1.1 (CIS Baseline Level 1) Ensure 'Audit Credential Validation' is set to 'Success and Failure'
AuditPolicySubcategory "Audit Credential Validation (Succes)" {
Name = 'Credential Validation'
Ensure = 'Present'
AuditFlag = 'Success'
}
AuditPolicySubcategory "Audit Credential Validation (Failure)" {
Name = 'Credential Validation'
Ensure = 'Present'
AuditFlag = 'Failure'
}
# 17.2.1 (CIS Baseline Level 1) Ensure 'Audit Application Group Management' is set to 'Success and Failure'
AuditPolicySubcategory 'Audit Application Group Management (Success)' {
Name = 'Application Group Management'
Ensure = 'Present'
AuditFlag = 'Success'
}
AuditPolicySubcategory 'Audit Application Group Management (Failure)' {
Name = 'Application Group Management'
Ensure = 'Present'
AuditFlag = 'Failure'
}
# 17.2.2 (CIS Baseline Level 1) Ensure 'Audit Computer Account Management' is set to 'Success and Failure'
AuditPolicySubcategory 'Audit Computer Account Management (Success)' {
Name = 'Computer Account Management'
Ensure = 'Present'
AuditFlag = 'Success'
}
AuditPolicySubcategory 'Audit Computer Account Management (Failure)' {
Name = 'Computer Account Management'
Ensure = 'Present'
AuditFlag = 'Failure'
}
AuditPolicySubcategory 'Audit Distribution Group Management' {
Name = 'Distribution Group Management'
Ensure = 'Present'
AuditFlag = 'Success'
}
# 17.2.4 (CIS Baseline Level 1) Ensure 'Audit Other Account Management Events' is set to 'Success and Failure'
AuditPolicySubcategory 'Audit Other Account Management Events (Success)' {
Name = 'Other Account Management Events'
Ensure = 'Present'
AuditFlag = 'Success'