Skip to content

Commit 1654464

Browse files
authored
Merge pull request #27 from dev-sec/new_windows_cis_profile
New windows cis profile for win2012r2 and 2016
2 parents 23dbee8 + 6e7d411 commit 1654464

20 files changed

+10740
-535
lines changed

.gitignore

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
vendor/
2+
*.bak
3+
*.lock
4+
.envrc
5+
6+
.vagrant
7+
*~
8+
*#
9+
.#*
10+
\#*#
11+
.*.sw[a-z]
12+
*.un~
13+
14+
# Bundler
15+
Gemfile.lock
16+
gems.locked
17+
bin/*
18+
.bundle/*

.rubocop.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ MethodLength:
2020
NumericLiterals:
2121
MinDigits: 10
2222
Metrics/BlockLength:
23-
Max: 35
23+
Max: 80
2424
Metrics/CyclomaticComplexity:
2525
Max: 10
2626
Metrics/PerceivedComplexity:

README.md

Lines changed: 130 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,150 @@
1-
windows-baseline
2-
================
1+
# windows-baseline
2+
3+
[![Build Status](http://img.shields.io/travis/dev-sec/windows-baseline.svg)](http://travis-ci.org/dev-sec/windows-baseline)
4+
[![Supermarket](https://img.shields.io/badge/InSpec%20Profile-Windows%20Baseline-brightgreen.svg)](https://supermarket.chef.io/tools/windows-baseline)
35

46
This Baseline ensures, that all hardening projects keep the same quality.
57

68
- https://github.com/dev-sec/chef-windows-hardening
9+
- https://github.com/dev-sec/ansible-windows-hardening
10+
11+
## Description
12+
13+
This [InSpec](https://github.com/chef/inspec) compliance profile is inspired by [CIS](https://downloads.cisecurity.org/) Windows 2012R2 and 2016 Benchmark and implements such rules in an automated way to provide security best-practice tests around Windows Servers in a production environment.
14+
15+
__Implements:__
16+
17+
* CIS Microsoft Windows Server 2012 R2 Benchmark v2.3.0 - 03-30-2018
18+
* CIS Microsoft Windows Server 2016 RTM (Release 1607) Benchmark v1.1.0 - 10-31-2018
19+
20+
InSpec is an open-source run-time framework and rule language used to specify compliance, security, and policy requirements for testing any node in your infrastructure.
21+
22+
## Requirements
23+
24+
* at least [InSpec](http://inspec.io/) Version 3.0.0
25+
* WinRM activated (for inspec remote usage)
26+
27+
### Platform
28+
29+
- Windows 2012R2
30+
- Windows 2016
31+
- Windows 2019
32+
33+
## Attributes
34+
35+
We use a yml attribute file to steer the configuration, the following options are available:
36+
37+
* `level_1_or_2`
38+
define which CIS Benchmark Level (1 or 2) you want to execute
39+
40+
* `ms_or_dc`
41+
define if you want to execute the profile in the context of a Memeber Server (MS) or Domain Controler (DC)
42+
43+
* `password_history_size`
44+
define password history size
45+
46+
* `maximum_password_age`
47+
define MaximumPasswordAge
48+
49+
* `se_network_logon_right`
50+
define which users are allowed to access this computer from the network
51+
52+
* `se_interactive_logon_right`
53+
define which users are allowed to log on locally
54+
55+
* `se_remote_interactive_logon_right`
56+
define which users are allowed to log on through Remote Desktop Services
57+
58+
* `se_backup_privilege`
59+
define which users are allowed to backup files and directories
60+
61+
* `se_systemtime_privilege`
62+
define which users are allowed to change system time
63+
64+
* `se_time_zone_privilege`
65+
define which users are allowed to change system time zone
766

8-
## Standalone Usage
67+
* `se_create_symbolic_link_privilege`
68+
define which users are allowed to create symbolic links
969

10-
This Compliance Profile requires [InSpec](https://github.com/chef/inspec) for execution:
70+
* `se_deny_network_logon_right`
71+
define which users are not allowed to access this computer from the network
72+
73+
* `se_deny_remote_interactive_logon_right`
74+
define which users are not allowed to log on through Remote Desktop Services
75+
76+
* `se_enable_delegation_privilege`
77+
define which users are allowed to enable computer and user accounts to be trusted
78+
79+
* `se_impersonate_privilege`
80+
define which users are allowed to impersonate a client after authentication
81+
82+
* `se_load_driver_privilege`
83+
define which users are allowed to impersonate a client after authentication
84+
85+
* `se_batch_logon_right`
86+
define which users are allowed to log on as a batch job
87+
88+
* `se_security_privilege`
89+
define which users are allowed to manage auditing and security logs
90+
91+
* `se_assign_primary_token_privilege`
92+
define which users are allowed to replace a process level token
93+
94+
* `se_restore_privilege`
95+
define which users are allowed to restore files and directories
96+
97+
* `hklm_null_session_pipes`
98+
define named pipes that can be accessed anonymously
99+
100+
## Usage
101+
102+
InSpec makes it easy to run your tests wherever you need. More options listed here: [InSpec cli](http://inspec.io/docs/reference/cli/)
11103

12104
```
105+
# run profile locally and directly from Github
106+
$ inspec exec https://github.com/dev-sec/windows-baseline
107+
108+
# run profile locally
13109
$ git clone https://github.com/dev-sec/windows-baseline
14110
$ inspec exec windows-baseline
15-
```
16111
17-
You can also execute the profile directly from Github:
112+
# run profile on remote host via WinRM
113+
inspec exec windows-baseline -t winrm://<ip-address>:5985 --user=<username> --password=<password>
18114
115+
# run profile on remote host via WinRM and define attribute value
116+
inspec exec windows-baseline -t winrm://<ip-address>:5985 --user=<username> --password=<password> --attrs sample_attributes.yml
117+
118+
# run profile direct from inspec supermarket
119+
inspec supermarket exec dev-sec/windows-baseline -t winrm://<ip-address>:5985 --user=<username> --password=<password>
19120
```
20-
$ inspec exec https://github.com/dev-sec/windows-baseline
21121

22-
# run test on remote windows host on WinRM
23-
$ inspec exec test.rb -t winrm://Administrator@windowshost --password 'your-password'
122+
### Run individual controls
123+
124+
In order to verify individual controls, just provide the control ids to InSpec:
125+
126+
```
127+
inspec exec windows-baseline --controls 'windows-001'
24128
```
25129

26-
## License and Author
130+
## ToDo
27131

28-
* Copyright 2015-2016, Chef Software, Inc
29-
* Copyright 2016, The Hardening Framework Team
132+
- adjust the inspec attributes according to the profile (Member Server or Domain Controller), because for the Domain Controller some attributes are different from a Memeber Server
30133

31-
Licensed under the Apache License, Version 2.0 (the "License");
32-
you may not use this file except in compliance with the License.
33-
You may obtain a copy of the License at
134+
## Contributors + Kudos
34135

35-
http://www.apache.org/licenses/LICENSE-2.0
136+
* Patrick Muench [atomic111](https://github.com/atomic111)
137+
* Torsten Löbner [TLoebner](https://github.com/TLoebner)
138+
* Karsten Mueller [karstenmueller](https://github.com/karstenmueller)
139+
140+
## License and Author
36141

37-
Unless required by applicable law or agreed to in writing, software
38-
distributed under the License is distributed on an "AS IS" BASIS,
39-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
40-
See the License for the specific language governing permissions and
41-
limitations under the License.
142+
| | |
143+
| ------ | --- |
144+
| **Author:** | Patrick Muench <patrick.muench1111@gmail.com> |
145+
| **Author:** | Torsten Loebner <loebnert@googlemail.com> |
146+
| **Copyright:** | 2019 SVA System Vertrieb Alexander GmbH |
147+
| **Copyright:** | 2019 Lichtblick SE |
148+
| **Copyright:** | 2015-2016, Chef Software, Inc |
149+
| **Copyright:** | DevSec Hardening Framework Team |
150+
| **License:** | Apache License Version 2.0 |

controls/access_config.rb

Lines changed: 0 additions & 102 deletions
This file was deleted.

0 commit comments

Comments
 (0)