inspec 1.51.0 → 1.51.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +29 -15
- data/README.md +1 -1
- data/docs/glossary.md +99 -0
- data/docs/resources/aide_conf.md.erb +16 -9
- data/docs/resources/apache.md.erb +66 -0
- data/docs/resources/apache_conf.md.erb +11 -5
- data/docs/resources/apt.md.erb +1 -1
- data/docs/resources/audit_policy.md.erb +1 -1
- data/docs/resources/auditd_conf.md.erb +12 -9
- data/docs/resources/bash.md.erb +24 -12
- data/docs/resources/bond.md.erb +26 -24
- data/docs/resources/bridge.md.erb +18 -11
- data/docs/resources/bsd_service.md.erb +11 -2
- data/docs/resources/command.md.erb +30 -29
- data/docs/resources/cpan.md.erb +33 -17
- data/docs/resources/cran.md.erb +26 -17
- data/docs/resources/crontab.md.erb +18 -1
- data/docs/resources/csv.md.erb +13 -7
- data/docs/resources/{dh_params.md → dh_params.md.erb} +30 -6
- data/docs/resources/directory.md.erb +9 -4
- data/docs/resources/docker.md.erb +1 -1
- data/docs/resources/docker_container.md.erb +32 -26
- data/docs/resources/docker_image.md.erb +29 -26
- data/docs/resources/docker_service.md.erb +37 -31
- data/docs/resources/elasticsearch.md.erb +18 -32
- data/docs/resources/etc_fstab.md.erb +19 -15
- data/docs/resources/etc_group.md.erb +13 -39
- data/docs/resources/etc_hosts.md.erb +12 -5
- data/docs/resources/etc_hosts_allow.md.erb +9 -4
- data/docs/resources/etc_hosts_deny.md.erb +12 -7
- data/docs/resources/file.md.erb +139 -134
- data/docs/resources/filesystem.md.erb +5 -4
- data/docs/resources/firewalld.md.erb +1 -1
- data/docs/resources/gem.md.erb +2 -2
- data/docs/resources/group.md.erb +1 -1
- data/docs/resources/host.md.erb +1 -1
- data/docs/resources/iis_app.md.erb +1 -1
- data/docs/resources/iis_site.md.erb +1 -1
- data/docs/resources/interface.md.erb +1 -1
- data/docs/resources/iptables.md.erb +1 -1
- data/docs/resources/json.md.erb +1 -1
- data/docs/resources/kernel_module.md.erb +1 -1
- data/docs/resources/kernel_parameter.md.erb +1 -1
- data/docs/resources/launchd_service.md.erb +1 -1
- data/docs/resources/limits_conf.md.erb +1 -1
- data/docs/resources/login_def.md.erb +1 -1
- data/docs/resources/mount.md.erb +1 -1
- data/docs/resources/mysql_conf.md.erb +1 -1
- data/docs/resources/nginx_conf.md.erb +1 -1
- data/docs/resources/npm.md.erb +1 -1
- data/docs/resources/oneget.md.erb +1 -1
- data/docs/resources/os.md.erb +1 -1
- data/docs/resources/os_env.md.erb +2 -2
- data/docs/resources/package.md.erb +1 -1
- data/docs/resources/packages.md.erb +66 -0
- data/docs/resources/parse_config.md.erb +1 -1
- data/docs/resources/parse_config_file.md.erb +1 -1
- data/docs/resources/passwd.md.erb +1 -1
- data/docs/resources/pip.md.erb +1 -1
- data/docs/resources/port.md.erb +1 -1
- data/docs/resources/postgres_conf.md.erb +1 -1
- data/docs/resources/postgres_session.md.erb +1 -1
- data/docs/resources/powershell.md.erb +2 -2
- data/docs/resources/processes.md.erb +1 -1
- data/docs/resources/registry_key.md.erb +1 -1
- data/docs/resources/runit_service.md.erb +1 -1
- data/docs/resources/security_policy.md.erb +1 -1
- data/docs/resources/service.md.erb +1 -1
- data/docs/resources/shadow.md.erb +1 -1
- data/docs/resources/ssh_config.md.erb +1 -1
- data/docs/resources/sshd_config.md.erb +1 -1
- data/docs/resources/ssl.md.erb +1 -1
- data/docs/resources/sys_info.md.erb +1 -1
- data/docs/resources/systemd_service.md.erb +1 -1
- data/docs/resources/sysv_service.md.erb +1 -1
- data/docs/resources/upstart_service.md.erb +1 -1
- data/docs/resources/user.md.erb +1 -1
- data/docs/resources/users.md.erb +1 -1
- data/docs/resources/windows_feature.md.erb +1 -1
- data/docs/resources/windows_hotfix.md.erb +1 -1
- data/docs/resources/xinetd_conf.md.erb +1 -1
- data/docs/resources/xml.md.erb +1 -1
- data/docs/resources/yaml.md.erb +1 -1
- data/docs/resources/yum.md.erb +1 -1
- data/lib/inspec.rb +2 -1
- data/lib/inspec/base_cli.rb +98 -18
- data/lib/inspec/cli.rb +33 -21
- data/lib/inspec/formatters.rb +3 -0
- data/lib/inspec/formatters/base.rb +208 -0
- data/lib/inspec/formatters/json_rspec.rb +20 -0
- data/lib/inspec/formatters/show_progress.rb +12 -0
- data/lib/inspec/objects.rb +1 -0
- data/lib/inspec/objects/describe.rb +92 -0
- data/lib/inspec/reporters.rb +33 -0
- data/lib/inspec/reporters/base.rb +23 -0
- data/lib/inspec/reporters/cli.rb +395 -0
- data/lib/inspec/reporters/json.rb +132 -0
- data/lib/inspec/reporters/json_min.rb +44 -0
- data/lib/inspec/reporters/junit.rb +77 -0
- data/lib/inspec/runner.rb +14 -1
- data/lib/inspec/runner_rspec.rb +34 -14
- data/lib/inspec/schema.rb +1 -0
- data/lib/inspec/shell.rb +0 -1
- data/lib/inspec/version.rb +1 -1
- data/lib/resources/apache.rb +20 -0
- data/lib/resources/apache_conf.rb +33 -8
- data/lib/resources/audit_policy.rb +1 -1
- data/lib/resources/packages.rb +4 -3
- metadata +17 -4
- data/lib/inspec/rspec_json_formatter.rb +0 -940
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dbfea5e413e1c0ebcf2184242fabc92fd61c3954
|
4
|
+
data.tar.gz: ccfc7ed525ece869edf03f23176e0d5e2de940b2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e29c023aae58ddcb1cc2aa589fdc272919da0eb9e8ea0dc12359e42ee728d2279ff5b4b09a34bea43512068f3881135e2777c2748ef487070c2931dfe857fd44
|
7
|
+
data.tar.gz: 68fec89c3c0f6d70fb466f94786589823e76ebfa448ff51b910da6af71dc0ee2bf39e199c717b0b586cc977c75a52a488085207da1ddb12f0db0ad18b591cb80
|
data/CHANGELOG.md
CHANGED
@@ -1,31 +1,46 @@
|
|
1
1
|
# Change Log
|
2
2
|
<!-- usage documentation: http://expeditor-docs.es.chef.io/configuration/changelog/ -->
|
3
|
-
<!-- latest_release 1.51.
|
4
|
-
## [v1.51.
|
3
|
+
<!-- latest_release 1.51.6 -->
|
4
|
+
## [v1.51.6](https://github.com/chef/inspec/tree/v1.51.6) (2018-02-08)
|
5
5
|
|
6
|
-
#### New
|
7
|
-
-
|
6
|
+
#### New Features
|
7
|
+
- Add new "reporter" system (replacement for "formatters"), support multiple reporters per run [#2464](https://github.com/chef/inspec/pull/2464) ([jquick](https://github.com/jquick))
|
8
8
|
<!-- latest_release -->
|
9
9
|
|
10
|
-
<!-- release_rollup since=1.
|
11
|
-
### Changes since 1.
|
10
|
+
<!-- release_rollup since=1.51.0 -->
|
11
|
+
### Changes since 1.51.0 release
|
12
|
+
|
13
|
+
#### New Features
|
14
|
+
- Add new "reporter" system (replacement for "formatters"), support multiple reporters per run [#2464](https://github.com/chef/inspec/pull/2464) ([jquick](https://github.com/jquick)) <!-- 1.51.6 -->
|
15
|
+
|
16
|
+
#### Merged Pull Requests
|
17
|
+
- Fix travis-ci bundler issue [#2533](https://github.com/chef/inspec/pull/2533) ([jquick](https://github.com/jquick)) <!-- 1.51.5 -->
|
18
|
+
- Improve links to Learn Chef Rally [#2476](https://github.com/chef/inspec/pull/2476) ([tpetchel](https://github.com/tpetchel)) <!-- 1.51.4 -->
|
19
|
+
- apache resource: document and deprecate [#2494](https://github.com/chef/inspec/pull/2494) ([adamleff](https://github.com/adamleff)) <!-- 1.51.3 -->
|
20
|
+
- add Inspec::Describe for abstract describe state [#2010](https://github.com/chef/inspec/pull/2010) ([arlimus](https://github.com/arlimus)) <!-- 1.51.2 -->
|
12
21
|
|
13
22
|
#### Enhancements
|
14
|
-
-
|
23
|
+
- packages resource: Add `architectures` support [#2469](https://github.com/chef/inspec/pull/2469) ([jerryaldrichiii](https://github.com/jerryaldrichiii)) <!-- 1.51.1 -->
|
24
|
+
<!-- release_rollup -->
|
25
|
+
|
26
|
+
<!-- latest_stable_release -->
|
27
|
+
## [v1.51.0](https://github.com/chef/inspec/tree/v1.51.0) (2018-01-25)
|
15
28
|
|
16
29
|
#### New Resources
|
17
|
-
-
|
18
|
-
-
|
30
|
+
- new docker_service resource to inspect Docker Swarm services [#2456](https://github.com/chef/inspec/pull/2456) ([mattlqx](https://github.com/mattlqx))
|
31
|
+
- filesystem resource: inspect linux filesystems [#2441](https://github.com/chef/inspec/pull/2441) ([tarcinil](https://github.com/tarcinil))
|
19
32
|
|
20
|
-
####
|
21
|
-
-
|
33
|
+
#### Enhancements
|
34
|
+
- Update security_policy resource to return Names, not SIDs [#2462](https://github.com/chef/inspec/pull/2462) ([ViolentOr](https://github.com/ViolentOr))
|
22
35
|
|
23
36
|
#### Bug Fixes
|
24
|
-
-
|
25
|
-
-
|
26
|
-
<!-- release_rollup -->
|
37
|
+
- grub_conf resource: fix menuentry detection [#2408](https://github.com/chef/inspec/pull/2408) ([jerryaldrichiii](https://github.com/jerryaldrichiii))
|
38
|
+
- service resource: attempt a SysV fallback if SystemD unit file is not found [#2473](https://github.com/chef/inspec/pull/2473) ([jerryaldrichiii](https://github.com/jerryaldrichiii))
|
27
39
|
|
40
|
+
#### Merged Pull Requests
|
41
|
+
- Sort library files before loading them so load order is predictable [#2475](https://github.com/chef/inspec/pull/2475) ([clintoncwolfe](https://github.com/clintoncwolfe))
|
28
42
|
<!-- latest_stable_release -->
|
43
|
+
|
29
44
|
## [v1.50.1](https://github.com/chef/inspec/tree/v1.50.1) (2018-01-17)
|
30
45
|
|
31
46
|
#### Enhancements
|
@@ -43,7 +58,6 @@
|
|
43
58
|
- Bump Omnibus Ruby (and Travis Rubies) to 2.4.3 [#2452](https://github.com/chef/inspec/pull/2452) ([adamleff](https://github.com/adamleff))
|
44
59
|
- Bump minor version [#2465](https://github.com/chef/inspec/pull/2465) ([adamleff](https://github.com/adamleff))
|
45
60
|
- Bump version manually to trigger Habitat build [#2466](https://github.com/chef/inspec/pull/2466) ([adamleff](https://github.com/adamleff))
|
46
|
-
<!-- latest_stable_release -->
|
47
61
|
|
48
62
|
## [v1.49.2](https://github.com/chef/inspec/tree/v1.49.2) (2018-01-04)
|
49
63
|
|
data/README.md
CHANGED
@@ -381,7 +381,7 @@ In addition, these test require Docker to be available on your machine or a remo
|
|
381
381
|
List the various test instances available:
|
382
382
|
|
383
383
|
```bash
|
384
|
-
bundle exec kitchen list
|
384
|
+
bundle exec kitchen list
|
385
385
|
```
|
386
386
|
|
387
387
|
The platforms and test suites are configured in the `.kitchen.yml` file. Once you know which instance you wish to test, test that instance:
|
data/docs/glossary.md
ADDED
@@ -0,0 +1,99 @@
|
|
1
|
+
# InSpec Glossary
|
2
|
+
|
3
|
+
## Basic Syntax
|
4
|
+
```
|
5
|
+
describe foo('/path/to/foo.txt') do
|
6
|
+
its('blah') { should cmp '123' }
|
7
|
+
it { should exist }
|
8
|
+
it { should be_reasonable }
|
9
|
+
it { should_not be_ridiculous }
|
10
|
+
end
|
11
|
+
```
|
12
|
+
## Basic Elements:
|
13
|
+
|
14
|
+
### describe **foo**, where
|
15
|
+
|
16
|
+
* `foo` is the _resource_
|
17
|
+
|
18
|
+
### describe foo **('/path/to/foo.txt')**, where
|
19
|
+
|
20
|
+
* `'/path/to/foo.txt'` is the _resource parameter_
|
21
|
+
|
22
|
+
## Tests:
|
23
|
+
|
24
|
+
### **its('blah') { should cmp '123' }** is an _individual test_, where
|
25
|
+
|
26
|
+
* `blah` is a _property_
|
27
|
+
* { should cmp '123' } is a _condition statement_
|
28
|
+
* `should` is the _condition_
|
29
|
+
* `cmp` is the _matcher_
|
30
|
+
* `'123'` is the _expected result_
|
31
|
+
|
32
|
+
### **{ should exist }** is a _condition statement_, where
|
33
|
+
|
34
|
+
* `should` is the _condition_
|
35
|
+
* `exist` is the _matcher_
|
36
|
+
|
37
|
+
### **{ should be\_reasonable }** is a _condition statement_, where
|
38
|
+
|
39
|
+
* `should` is the _condition_
|
40
|
+
* `be_reasonable` is the _matcher_
|
41
|
+
|
42
|
+
### **{ should\_not be\_ridiculous }** is a _negative condition statement_, where
|
43
|
+
|
44
|
+
* `should_not` is the _negative condition_
|
45
|
+
* `be_ridiculous` is the _matcher_
|
46
|
+
|
47
|
+
## Advanced Syntax
|
48
|
+
|
49
|
+
```
|
50
|
+
describe foos('/path/to/foo.txt', ssl_verify: true).where { names == 'blah' } do
|
51
|
+
its('jared') { should cmp >= 123 }
|
52
|
+
its('jared.sort.first.monkey') { should be `loud` }
|
53
|
+
its(['jared', 'monkey.with.dots']) { should be `loud` }
|
54
|
+
end
|
55
|
+
```
|
56
|
+
|
57
|
+
## Advanced Elements:
|
58
|
+
|
59
|
+
### describe **foos**, where
|
60
|
+
|
61
|
+
* `foos` is a _plural resource_
|
62
|
+
|
63
|
+
### describe foos **('/path/to/foo.txt', ssl_verify: true)**, where
|
64
|
+
|
65
|
+
* `'/path/to/foo.txt'` and `ssl_verify: true` are the _resource parameters_. Resources take one or more parameters.
|
66
|
+
|
67
|
+
## Filters:
|
68
|
+
|
69
|
+
### describe foos ('/path/to/foo.txt', ssl_verify: true)**.where { names == 'blah' }**
|
70
|
+
|
71
|
+
* `.where { names == 'blah' }` is an example of a **filter**.
|
72
|
+
* `{ names == 'blah' }` is an example of a _filter clause_
|
73
|
+
* Some resources support one or more filters.
|
74
|
+
* Filters are used on plural resources.
|
75
|
+
* Some resources, such as `etc_hosts` are explicitly plural, while others, such as `passwd` are implicitly plural.
|
76
|
+
|
77
|
+
### **{ names == 'my-name' && spots == true }** are filter criteria
|
78
|
+
|
79
|
+
* `names` compares output to `blah`
|
80
|
+
* `has spots` evaluates to `true` or `false`
|
81
|
+
|
82
|
+
## Properties:
|
83
|
+
|
84
|
+
### **its('jared') { should cmp >= 123 }**
|
85
|
+
|
86
|
+
* `jared` is the _property_
|
87
|
+
|
88
|
+
### **{ should cmp >= 123 }** is a conditional statement that uses a matcher with an operator and expected value.
|
89
|
+
|
90
|
+
* `cmp` is the _matcher_
|
91
|
+
* `>=` is the operator (some matchers accept operators)
|
92
|
+
* `123` is the expected value
|
93
|
+
|
94
|
+
## Properties with advanced usage:
|
95
|
+
|
96
|
+
### Some properties may have advanced usage:
|
97
|
+
#### **its `('jared.sort.first.monkey') { should be `loud` }`**
|
98
|
+
|
99
|
+
* `jared.sort.first.monkey` is an example of the `jared` property with an advanced usage
|
@@ -1,5 +1,5 @@
|
|
1
1
|
---
|
2
|
-
title:
|
2
|
+
title: The aide_conf Resource
|
3
3
|
---
|
4
4
|
|
5
5
|
# aide_conf
|
@@ -34,9 +34,13 @@ Use the where clause to match a selection_line to one rule or a particular set o
|
|
34
34
|
|
35
35
|
<br>
|
36
36
|
|
37
|
-
##
|
37
|
+
## Supported Properties
|
38
38
|
|
39
|
-
|
39
|
+
* `conf_path`, `content`, `rules`, `all_have_rule`
|
40
|
+
|
41
|
+
## Property Examples
|
42
|
+
|
43
|
+
The following examples show how to use this InSpec audit resource.
|
40
44
|
|
41
45
|
### Test if all selection lines contain the xattr rule
|
42
46
|
|
@@ -56,16 +60,19 @@ The following examples show how to use this InSpec audit resource. For a full li
|
|
56
60
|
its('rules') { should include ['r', 'sha512'] }
|
57
61
|
end
|
58
62
|
|
63
|
+
### The usage of all\_have\_rule will return whether or not all selection lines in audit.conf contain a particular rule:
|
64
|
+
|
65
|
+
describe aide_conf.all_have_rule('sha512') do
|
66
|
+
it { should eq true }
|
67
|
+
end
|
68
|
+
|
59
69
|
<br>
|
60
70
|
|
61
71
|
## Matchers
|
62
72
|
|
63
|
-
|
73
|
+
For a full list of available matchers please visit our [matchers page](https://www.inspec.io/docs/reference/matchers/).
|
74
|
+
This InSpec audit resource uses the matchers `eq` and `include`.
|
64
75
|
|
65
|
-
|
76
|
+
For a full list of available matchers please visit our [matchers page](https://www.inspec.io/docs/reference/matchers/).
|
66
77
|
|
67
|
-
The usage of all_have_rule will return whether or not all selection lines in audit.conf contain a particular rule:
|
68
78
|
|
69
|
-
describe aide_conf.all_have_rule('sha512') do
|
70
|
-
it { should eq true }
|
71
|
-
end
|
@@ -0,0 +1,66 @@
|
|
1
|
+
---
|
2
|
+
title: About the apache Resource
|
3
|
+
---
|
4
|
+
|
5
|
+
# apache
|
6
|
+
|
7
|
+
Use the `apache` InSpec audit resource to test the state of the Apache server on Linux/Unix systems.
|
8
|
+
|
9
|
+
<p class="warning">This resource is deprecated and should not be used. It will be removed in InSpec 3.0.</p>
|
10
|
+
|
11
|
+
<br>
|
12
|
+
|
13
|
+
## Syntax
|
14
|
+
|
15
|
+
An `apache` InSpec audit resource block declares settings that should be tested:
|
16
|
+
|
17
|
+
describe apache do
|
18
|
+
its('setting_name') { should cmp 'value' }
|
19
|
+
end
|
20
|
+
|
21
|
+
where
|
22
|
+
|
23
|
+
* `'setting_name'` is description of the Apache configuration file
|
24
|
+
* `{ should cmp 'value' }` is the value that is expected
|
25
|
+
|
26
|
+
<br>
|
27
|
+
|
28
|
+
## Supported Properties
|
29
|
+
|
30
|
+
* 'service', 'conf_dir', 'conf_path', 'user'
|
31
|
+
|
32
|
+
<br>
|
33
|
+
|
34
|
+
## Property Examples
|
35
|
+
|
36
|
+
The following examples show how to use this InSpec audit resource.
|
37
|
+
|
38
|
+
### Test the service name.
|
39
|
+
|
40
|
+
describe apache do
|
41
|
+
its ('service') { should cmp 'apache2' }
|
42
|
+
end
|
43
|
+
|
44
|
+
### Test the configuration location
|
45
|
+
|
46
|
+
describe apache do
|
47
|
+
its ('conf_dir') { should cmp '/etc/apache2' }
|
48
|
+
end
|
49
|
+
|
50
|
+
### Test the path of the configuration file
|
51
|
+
|
52
|
+
describe apache do
|
53
|
+
its ('conf_path') { should cmp '/etc/apache2/apache2.conf' }
|
54
|
+
end
|
55
|
+
|
56
|
+
### Test the apache user
|
57
|
+
|
58
|
+
describe apache do
|
59
|
+
its ('user') { should cmp 'www-data' }
|
60
|
+
end
|
61
|
+
|
62
|
+
<br>
|
63
|
+
|
64
|
+
## Matchers
|
65
|
+
|
66
|
+
For a full list of available matchers please visit our [matchers page](https://www.inspec.io/docs/reference/matchers/).
|
@@ -31,13 +31,19 @@ The following examples show how to use this InSpec audit resource.
|
|
31
31
|
### Test for blocking .htaccess files on CentOS
|
32
32
|
|
33
33
|
describe apache_conf do
|
34
|
-
its('AllowOverride') { should
|
34
|
+
its('AllowOverride') { should cmp 'None' }
|
35
35
|
end
|
36
36
|
|
37
37
|
### Test ports for SSL
|
38
38
|
|
39
39
|
describe apache_conf do
|
40
|
-
its('Listen') { should
|
40
|
+
its('Listen') { should cmp '443' }
|
41
|
+
end
|
42
|
+
|
43
|
+
### Test multiple ports are listening
|
44
|
+
|
45
|
+
describe apache_conf do
|
46
|
+
its('Listen') { should =~ [ '80', '443' ] }
|
41
47
|
end
|
42
48
|
|
43
49
|
<br>
|
@@ -51,11 +57,11 @@ This InSpec audit resource matches any service that is listed in the Apache conf
|
|
51
57
|
|
52
58
|
or:
|
53
59
|
|
54
|
-
its('Timeout') { should
|
60
|
+
its('Timeout') { should cmp '300' }
|
55
61
|
|
56
62
|
For example:
|
57
63
|
|
58
64
|
describe apache_conf do
|
59
|
-
its('MaxClients') { should
|
60
|
-
its('Listen') { should
|
65
|
+
its('MaxClients') { should cmp '100' }
|
66
|
+
its('Listen') { should cmp '443' }
|
61
67
|
end
|
data/docs/resources/apt.md.erb
CHANGED
@@ -54,7 +54,7 @@ The following examples show how to use this InSpec audit resource.
|
|
54
54
|
|
55
55
|
## Matchers
|
56
56
|
|
57
|
-
|
57
|
+
For a full list of available matchers please visit our [matchers page](https://www.inspec.io/docs/reference/matchers/).
|
58
58
|
|
59
59
|
|
60
60
|
### be_enabled
|
@@ -4,7 +4,7 @@ title: About the audit_policy Resource
|
|
4
4
|
|
5
5
|
# audit_policy
|
6
6
|
|
7
|
-
Use the `audit_policy` Inspec audit resource to test auditing policies on the Windows platform. An auditing policy is a category of security-related events to be audited. Auditing is disabled by default and may be enabled for categories like account management, logon events, policy changes, process tracking, privilege use, system events, or object access. For each auditing category property
|
7
|
+
Use the `audit_policy` Inspec audit resource to test auditing policies on the Windows platform. An auditing policy is a category of security-related events to be audited. Auditing is disabled by default and may be enabled for categories like account management, logon events, policy changes, process tracking, privilege use, system events, or object access. For each enabled auditing category property, the auditing level may be set to `No Auditing`, `Not Specified`, `Success`, `Success and Failure`, or `Failure`.
|
8
8
|
|
9
9
|
<br>
|
10
10
|
|
@@ -24,7 +24,13 @@ where
|
|
24
24
|
|
25
25
|
<br>
|
26
26
|
|
27
|
-
##
|
27
|
+
## Supported Properties
|
28
|
+
|
29
|
+
This matcher will match any property listed in the `auditd.conf` configuration file. Property names and expected values are case-insensitive:
|
30
|
+
|
31
|
+
* `admin_space_left`, `admin_space_left_action`, `action_mail_acct`, `disk_error_action`, `disk_full_action`, `flush`, `freq`, `log_file`, `log_format`, `max_log_file`, `max_log_file_action`, `num_logs`, `space_left`, `space_left_action`
|
32
|
+
|
33
|
+
## Property Examples
|
28
34
|
|
29
35
|
The following examples show how to use this InSpec audit resource.
|
30
36
|
|
@@ -51,15 +57,12 @@ The following examples show how to use this InSpec audit resource.
|
|
51
57
|
|
52
58
|
## Matchers
|
53
59
|
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
### keyword
|
60
|
+
For a full list of available matchers please visit our [matchers page](https://www.inspec.io/docs/reference/matchers/).
|
58
61
|
|
59
|
-
|
62
|
+
### `cmp`
|
60
63
|
|
61
|
-
|
64
|
+
The `cmp` matcher compares values across types.
|
62
65
|
|
63
|
-
|
66
|
+
its('freq') { should cmp 1 }
|
64
67
|
|
65
|
-
|
68
|
+
For a full list of available matchers please visit our [matchers page](https://www.inspec.io/docs/reference/matchers/).
|
data/docs/resources/bash.md.erb
CHANGED
@@ -14,14 +14,14 @@ A `command` resource block declares a command to be run, one (or more) expected
|
|
14
14
|
|
15
15
|
describe bash('command') do
|
16
16
|
it { should exist }
|
17
|
-
its('
|
17
|
+
its('property') { should eq 'expected value' }
|
18
18
|
end
|
19
19
|
|
20
20
|
where
|
21
21
|
|
22
22
|
* `'command'` must specify a command to be run
|
23
|
-
* `'
|
24
|
-
* `'
|
23
|
+
* `'property'` is one of `exit_status`, `stderr`, or `stdout`
|
24
|
+
* `'expected value'` tests the output of the command run on the system versus the expected output stated in the test
|
25
25
|
|
26
26
|
For example:
|
27
27
|
|
@@ -33,30 +33,42 @@ For example:
|
|
33
33
|
|
34
34
|
<br>
|
35
35
|
|
36
|
-
##
|
37
|
-
|
38
|
-
This InSpec audit resource has the following matchers. For a full list of available matchers please visit our [matchers page](https://www.inspec.io/docs/reference/matchers/).
|
36
|
+
## Supported Properties
|
39
37
|
|
40
|
-
|
38
|
+
* `exit_status`, `stderr`, `stdout`
|
41
39
|
|
42
|
-
|
40
|
+
<br>
|
43
41
|
|
44
|
-
|
42
|
+
## Property Examples
|
45
43
|
|
46
44
|
### exit_status
|
47
45
|
|
48
|
-
The `exit_status`
|
46
|
+
The `exit_status` property tests the exit status for the command:
|
49
47
|
|
50
48
|
its('exit_status') { should eq 0 }
|
51
49
|
|
52
50
|
### stderr
|
53
51
|
|
54
|
-
The `stderr`
|
52
|
+
The `stderr` property tests results of the command as returned in standard error (stderr):
|
55
53
|
|
56
54
|
its('stderr') { should eq '' }
|
57
55
|
|
58
56
|
### stdout
|
59
57
|
|
60
|
-
The `stdout`
|
58
|
+
The `stdout` property tests results of the command as returned in standard output (stdout).
|
61
59
|
|
62
60
|
its('stdout') { should match /bin/ }
|
61
|
+
|
62
|
+
<br>
|
63
|
+
|
64
|
+
## Matchers
|
65
|
+
|
66
|
+
For a full list of available matchers please visit our [matchers page](https://www.inspec.io/docs/reference/matchers/).
|
67
|
+
|
68
|
+
### exist
|
69
|
+
|
70
|
+
If an absolute path is provided, the `exist` matcher tests if the command exists on the filesystem at the specified location. Otherwise, the `exist` matcher tests if the command is found in the PATH.
|
71
|
+
|
72
|
+
it { should exist }
|
73
|
+
|
74
|
+
|