Skip to content

Commit 6830f1d

Browse files
committed
add attributes for cis implementation
Signed-off-by: Patrick Münch <[email protected]>
1 parent c85aaf6 commit 6830f1d

File tree

5 files changed

+36
-18
lines changed

5 files changed

+36
-18
lines changed

attributes/account.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# Attributes:: account
55

66
# define which accounts should be disabled
7-
default['account_status']['names'] = ['Administrator', 'Guest']
7+
default['account_status']['names'] = %w[Administrator Guest]
88
default['account_status']['active_yes_no'] = 'no'
99

1010
# define the new account names for Administrator and Guest

attributes/default.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
default['windows_hardening']['smbv1']['disable'] = true
99

1010
# apply MS or DC configuration, possible values MS or DC
11-
default['default']['ms_or_dc'] = 'MS'
11+
default['windows_hardening']['ms_or_dc'] = 'MS'
1212

1313
# apply Level 1 or 2 configuration, possible values 1 or 2
14-
default['default']['level_1_or_2'] = 1
14+
default['windows_hardening']['level_1_or_2'] = 1

attributes/firewall.rb

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# encoding: utf-8
2+
3+
# Cookbook Name:: windows-hardening
4+
# Attributes:: firewall
5+
6+
# set this value if you want to activate Firewall
7+
default['firewall']['activate'] = false
8+
9+
# set this value if you want to add firewall rules
10+
default['firewall']['rules_on'] = false
11+
12+
# add some simply firewall rule, but it is recommended to apply this with an overlay cookbook
13+
# its an array of hashes like, [{'name':'rdp','local_port': 3389,'protocol': 'TCP', 'action': 'allow'},{'name':'winrm','local_port': 5985,'protocol': 'TCP', 'action': 'allow'}]
14+
default['firwall']['rules'] = []

attributes/interactive_login.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# encoding: utf-8
2+
3+
# Cookbook Name:: windows-hardening
4+
# Attributes:: interactive_login
5+
6+
# set this value if you want to harden terminal services
7+
default['interactive_login']['LegalNoticeText'] = ''
8+
default['interactive_login']['LegalNoticeCaption'] = ''

attributes/sec_policy.rb

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -142,22 +142,22 @@
142142
# Ensure \'Deny log on as a batch job\' to include \'Guests\'
143143
# tag 'CIS Microsoft Windows Server 2012 R2 Benchmark v2.3.0 - 03-30-2018': '2.2.18'
144144
# tag 'CIS Microsoft Windows Server 2016 RTM (Release 1607) Benchmark v1.1.0 - 10-31-2018': '2.2.22'
145-
default['security_policy']['rights']['SeDenyServiceLogonRight'] = '*S-1-5-32-546'
145+
default['security_policy']['rights']['SeDenyBatchLogonRight'] = '*S-1-5-32-546'
146146

147147
# Ensure \'Deny log on as a service\' to include \'Guests\'
148148
# tag 'CIS Microsoft Windows Server 2012 R2 Benchmark v2.3.0 - 03-30-2018': '2.2.19'
149149
# tag 'CIS Microsoft Windows Server 2016 RTM (Release 1607) Benchmark v1.1.0 - 10-31-2018': '2.2.23'
150-
default['security_policy']['rights']['SeDenyInteractiveLogonRight'] = '*S-1-5-32-546'
150+
default['security_policy']['rights']['SeDenyServiceLogonRight'] = '*S-1-5-32-546'
151151

152152
# Ensure \'Deny log on locally\' to include \'Guests\'
153153
# tag 'CIS Microsoft Windows Server 2012 R2 Benchmark v2.3.0 - 03-30-2018': '2.2.20'
154154
# tag 'CIS Microsoft Windows Server 2016 RTM (Release 1607) Benchmark v1.1.0 - 10-31-2018': '2.2.24'
155-
default['security_policy']['rights']['SeMachineAccountPrivilege'] = '*S-1-5-32-546'
155+
default['security_policy']['rights']['SeDenyInteractiveLogonRight'] = '*S-1-5-32-546'
156156

157157
# Configure \'Deny log on through Remote Desktop Services\'
158158
# tag 'CIS Microsoft Windows Server 2012 R2 Benchmark v2.3.0 - 03-30-2018': '2.2.21'
159159
# tag 'CIS Microsoft Windows Server 2016 RTM (Release 1607) Benchmark v1.1.0 - 10-31-2018': ['2.2.25', '2.2.26']
160-
default['security_policy']['rights']['SeMachineAccountPrivilege'] = '*S-1-5-32-546'
160+
default['security_policy']['rights']['SeDenyRemoteInteractiveLogonRight'] = '*S-1-5-32-546'
161161

162162
# Configure \'Enable computer and user accounts to be trusted for delegation\'
163163
# tag 'CIS Microsoft Windows Server 2012 R2 Benchmark v2.3.0 - 03-30-2018': '2.2.22'
@@ -197,9 +197,7 @@
197197
# Ensure \'Log on as a batch job\' is set to \'Administrators\' (DC only)
198198
# tag 'CIS Microsoft Windows Server 2012 R2 Benchmark v2.3.0 - 03-30-2018': '2.2.29'
199199
# tag 'CIS Microsoft Windows Server 2016 RTM (Release 1607) Benchmark v1.1.0 - 10-31-2018': '2.2.36'
200-
if ((node['default']['ms_or_dc'] == 'DC') && (node['default']['level_1_or_2'] == 2))
201-
default['security_policy']['rights']['SeBatchLogonRight'] = '*S-1-5-32-544, *S-1-5-32-551'
202-
end
200+
default['security_policy']['rights']['SeBatchLogonRight'] = '*S-1-5-32-544, *S-1-5-32-551' if node['windows_hardening']['ms_or_dc'] == 'DC' && node['windows_hardening']['level_1_or_2'] == 2
203201

204202
# Configure \'Manage auditing and security log\'
205203
# tag 'CIS Microsoft Windows Server 2012 R2 Benchmark v2.3.0 - 03-30-2018': '2.2.30'
@@ -249,17 +247,15 @@
249247
# Ensure \'Synchronize directory service data\' is set to \'No One\' (DC only)
250248
# tag 'CIS Microsoft Windows Server 2012 R2 Benchmark v2.3.0 - 03-30-2018': '2.2.39'
251249
# tag 'CIS Microsoft Windows Server 2016 RTM (Release 1607) Benchmark v1.1.0 - 10-31-2018': '2.2.47'
252-
if node['default']['ms_or_dc'] == 'DC'
253-
default['security_policy']['rights']['SeSyncAgentPrivilege'] = ''
254-
end
250+
251+
default['security_policy']['rights']['SeSyncAgentPrivilege'] = '' if node['windows_hardening']['ms_or_dc'] == 'DC'
255252

256253
# Ensure \'Take ownership of files or other objects\' is set to \'Administrators\'
257254
# tag 'CIS Microsoft Windows Server 2012 R2 Benchmark v2.3.0 - 03-30-2018': '2.2.40'
258255
# tag 'CIS Microsoft Windows Server 2016 RTM (Release 1607) Benchmark v1.1.0 - 10-31-2018': '2.2.48'
259256
default['security_policy']['rights']['SeTakeOwnershipPrivilege'] = '*S-1-5-32-544'
260257

261-
#
262-
263-
264-
265-
default['security_policy']['rights']['SeMachineAccountPrivilege'] = '*S-1-5-32-544'
258+
# Ensure \'Network access: Allow anonymous SID/Name translation\' is set to \'Disabled\'
259+
# tag 'CIS Microsoft Windows Server 2012 R2 Benchmark v2.3.0 - 03-30-2018': '2.3.10.1'
260+
# tag 'CIS Microsoft Windows Server 2016 RTM (Release 1607) Benchmark v1.1.0 - 10-31-2018': '2.3.10.1'
261+
default['security_policy']['access']['LSAAnonymousNameLookup'] = 0

0 commit comments

Comments
 (0)