Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

complete CIS 2012r2 level 1 standard #11

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

complete CIS 2012r2 level 1 standard #11

wants to merge 3 commits into from

Conversation

MattTunny
Copy link
Contributor

Not sure if you guys want to add this as a complete cis standard? I think it might be easier to group them via versions since a lot of settings are different e.g 2008/2012/2016. I also added all the testing for each setting with InSpec, I haven't added them to the other repo since this might not be the direction you want to go?

If so happy to start working on more versions

@chris-rock chris-rock requested a review from grdnrio March 7, 2017 10:26
SeCreateSymbolicLinkPrivilege = *S-1-5-32-544
[Version]
signature="$CHICAGO$"
Revision=1
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is awesome. We spent some time building some tooling around managing local security policy with Chef using secedit. The objective was to make it as modular / flexible as possible and separate tooling to a hardening cookbook. It's rough and ready but there is- https://github.com/grdnrio/windows-security-policy

You'll see that we're building the inf file dynamically. Would appreciate your feedback on it. Also would be great to collaborate.

Copy link
Member

@chris-rock chris-rock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MattTunny This is awesome work and I appreciate all the hard work you put into that PR. I see some parts that we need to improve before the merge:

  • add additional documentation (via InSpec tests and possible attributes)
  • split the big recipe into multiple smaller components

Could you also please sign-off your commits?

@@ -1,8 +1,7 @@
name 'base-win2012-hardening'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there is no need to update that file. We updated the name of the cookbook. We should bump the version to 1.x though since this is adding a lot of new features

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -0,0 +1,571 @@
#
# Cookbook Name:: base-win2012-hardening
# Recipe:: CIS_2012r2_L1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Be aware that all code is licensed under Apache 2

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

# unless ENV['TEST_KITCHEN']

# NTLM Hardening -- This settings breaks WinRM
if node['NTLM_Harden'] == true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to update the parameters in our README.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah i'll remove it for now and add it as a seperate recipe

end
end

# Winlogon Settings
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am thinking about different recipes for each component, like winlogon.rb, lsa.rb what do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah thats a better way, i'll split them all out

action :create
end

# Setting this on breaks test-kitchen - Federal Information Processing Standards.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This highlights that we need to reference that to the specific standard. I propose to do that in a approved InSpec benchmark https://github.com/dev-sec/windows-baseline

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah agree

# found at http://inspec.io/docs/reference/resources/

# WinLogon Tests
describe registry_key('HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon') do
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is okay to have integration tests here. For improved user experience, we should move most tests to https://github.com/dev-sec/windows-baseline. This allows users to run the same tests easily against production environments

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, i'll start a pull request on breaking apart the tests in line with new ones added in here

- https://github.com/dev-sec/windows-hardening-benchmark

- name: CIS_2012r2_L1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like we should merge this and add the tests to https://github.com/dev-sec/windows-baseline

end

# LSA tests
describe registry_key('HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa') do
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we may want to use controls and add references to the specific cis benchmarks. Like

control 'lsa-1' do
  impact 1.0

  title 'LSA Network access'
  desc 'Do not allow anonymous enumeration of SAM accounts and shares' to `Enabled`'

  tag cis: '2.3.11.3'
  ...
  tag remediation: 'https://github.com/dev-sec/chef-windows-hardening'

  ref 'CIS Windows 2012 R2', url: 'https://benchmarks.cisecurity.org/tools2/windows/CIS_Microsoft_Windows_Server_2012_R2_Benchmark_v1.1.0.pdf'

  describe registry_key()
     ...
  end
end

Further examples are available here: https://github.com/chef/inspec/blob/master/examples/profile/controls/meta.rb

@chris-rock
Copy link
Member

@MattTunny anything we can help you with?

@MattTunny
Copy link
Contributor Author

nah all good, been really busy at work, will be able to do all these changes on the weekend hopefully

@chris-rock
Copy link
Member

@MattTunny have a look at #16, this uses the flexible security policy generation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants