|
1 | | -windows-baseline |
2 | | -================ |
| 1 | +# windows-baseline |
| 2 | + |
| 3 | +[](http://travis-ci.org/dev-sec/windows-baseline) |
| 4 | +[](https://supermarket.chef.io/tools/windows-baseline) |
3 | 5 |
|
4 | 6 | This Baseline ensures, that all hardening projects keep the same quality. |
5 | 7 |
|
6 | 8 | - 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 |
7 | 66 |
|
8 | | -## Standalone Usage |
| 67 | + * `se_create_symbolic_link_privilege` |
| 68 | + define which users are allowed to create symbolic links |
9 | 69 |
|
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/) |
11 | 103 |
|
12 | 104 | ``` |
| 105 | +# run profile locally and directly from Github |
| 106 | +$ inspec exec https://github.com/dev-sec/windows-baseline |
| 107 | +
|
| 108 | +# run profile locally |
13 | 109 | $ git clone https://github.com/dev-sec/windows-baseline |
14 | 110 | $ inspec exec windows-baseline |
15 | | -``` |
16 | 111 |
|
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> |
18 | 114 |
|
| 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> |
19 | 120 | ``` |
20 | | -$ inspec exec https://github.com/dev-sec/windows-baseline |
21 | 121 |
|
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' |
24 | 128 | ``` |
25 | 129 |
|
26 | | -## License and Author |
| 130 | +## ToDo |
27 | 131 |
|
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 |
30 | 133 |
|
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 |
34 | 135 |
|
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 |
36 | 141 |
|
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 | |
0 commit comments