2016-09-22 12:43:57 +00:00
|
|
|
---
|
|
|
|
title: About the security_policy Resource
|
2018-02-16 00:28:15 +00:00
|
|
|
platform: windows
|
2016-09-22 12:43:57 +00:00
|
|
|
---
|
|
|
|
|
|
|
|
# security_policy
|
|
|
|
|
2019-04-26 18:24:29 +00:00
|
|
|
Use the `security_policy` Chef InSpec audit resource to test security policies on the Windows platform.
|
2016-09-22 12:43:57 +00:00
|
|
|
|
2017-10-03 21:35:10 +00:00
|
|
|
<br>
|
|
|
|
|
2018-08-09 12:34:49 +00:00
|
|
|
## Availability
|
|
|
|
|
|
|
|
### Installation
|
|
|
|
|
2019-04-26 18:24:29 +00:00
|
|
|
This resource is distributed along with Chef InSpec itself. You can use it automatically.
|
2018-08-09 12:34:49 +00:00
|
|
|
|
|
|
|
### Version
|
|
|
|
|
|
|
|
This resource first became available in v1.0.0 of InSpec.
|
|
|
|
|
2016-09-27 19:03:23 +00:00
|
|
|
## Syntax
|
2016-09-22 12:43:57 +00:00
|
|
|
|
|
|
|
A `security_policy` resource block declares the name of a security policy and the value to be tested:
|
|
|
|
|
|
|
|
describe security_policy do
|
|
|
|
its('policy_name') { should eq 'value' }
|
|
|
|
end
|
|
|
|
|
|
|
|
where
|
|
|
|
|
|
|
|
* `'policy_name'` must specify a security policy
|
|
|
|
* `{ should eq 'value' }` tests the value of `policy_name` against the value declared in the test
|
|
|
|
|
2017-10-03 21:35:10 +00:00
|
|
|
<br>
|
2016-09-22 12:43:57 +00:00
|
|
|
|
2017-10-03 21:35:10 +00:00
|
|
|
## Examples
|
2016-09-22 12:43:57 +00:00
|
|
|
|
2019-04-26 18:24:29 +00:00
|
|
|
The following examples show how to use this Chef InSpec audit resource.
|
2016-09-22 12:43:57 +00:00
|
|
|
|
2017-10-03 21:35:10 +00:00
|
|
|
### Verify that only the Administrators group has remote access
|
2016-09-22 12:43:57 +00:00
|
|
|
|
2017-10-03 21:35:10 +00:00
|
|
|
describe security_policy do
|
|
|
|
its('SeRemoteInteractiveLogonRight') { should eq '*S-1-5-32-544' }
|
|
|
|
end
|
2016-09-22 12:43:57 +00:00
|
|
|
|
2017-10-03 21:35:10 +00:00
|
|
|
<br>
|
2016-09-22 12:43:57 +00:00
|
|
|
|
2017-10-03 21:35:10 +00:00
|
|
|
## Matchers
|
2016-09-22 12:43:57 +00:00
|
|
|
|
2018-02-16 03:07:18 +00:00
|
|
|
For a full list of available matchers, please visit our [matchers page](https://www.inspec.io/docs/reference/matchers/).
|
2016-09-22 12:43:57 +00:00
|
|
|
|
2016-09-27 19:03:23 +00:00
|
|
|
### policy_name
|
2016-09-22 12:43:57 +00:00
|
|
|
|
|
|
|
The `policy_name` matcher must be the name of a security policy:
|
|
|
|
|
|
|
|
its('SeNetworkLogonRight') { should eq '*S-1-5-11' }
|