inspec 1.40.0 → 1.41.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +30 -9
- data/docs/matchers.md +18 -0
- data/docs/plugin_kitchen_inspec.md +18 -24
- data/docs/profiles.md +39 -2
- data/docs/resources/aide_conf.md.erb +18 -28
- data/docs/resources/apache_conf.md.erb +19 -33
- data/docs/resources/apt.md.erb +22 -36
- data/docs/resources/audit_policy.md.erb +9 -24
- data/docs/resources/auditd.md.erb +9 -24
- data/docs/resources/auditd_conf.md.erb +20 -34
- data/docs/resources/auditd_rules.md.erb +8 -24
- data/docs/resources/bash.md.erb +4 -26
- data/docs/resources/bond.md.erb +25 -40
- data/docs/resources/bridge.md.erb +5 -25
- data/docs/resources/bsd_service.md.erb +5 -25
- data/docs/resources/command.md.erb +35 -50
- data/docs/resources/crontab.md.erb +9 -23
- data/docs/resources/csv.md.erb +12 -27
- data/docs/resources/dh_params.md +1 -0
- data/docs/resources/directory.md.erb +5 -25
- data/docs/resources/docker.md.erb +60 -57
- data/docs/resources/docker_container.md.erb +23 -19
- data/docs/resources/docker_image.md.erb +20 -16
- data/docs/resources/etc_fstab.md.erb +5 -2
- data/docs/resources/etc_group.md.erb +29 -45
- data/docs/resources/etc_hosts.md.erb +6 -0
- data/docs/resources/etc_hosts_allow.md.erb +6 -2
- data/docs/resources/etc_hosts_deny.md.erb +6 -2
- data/docs/resources/file.md.erb +198 -212
- data/docs/resources/firewalld.md.erb +7 -1
- data/docs/resources/gem.md.erb +21 -35
- data/docs/resources/group.md.erb +16 -30
- data/docs/resources/grub_conf.md.erb +9 -24
- data/docs/resources/host.md.erb +32 -49
- data/docs/resources/http.md.erb +38 -44
- data/docs/resources/iis_app.md.erb +25 -35
- data/docs/resources/iis_site.md.erb +26 -40
- data/docs/resources/inetd_conf.md.erb +27 -42
- data/docs/resources/ini.md.erb +9 -23
- data/docs/resources/interface.md.erb +5 -25
- data/docs/resources/iptables.md.erb +15 -29
- data/docs/resources/json.md.erb +12 -27
- data/docs/resources/kernel_module.md.erb +47 -61
- data/docs/resources/kernel_parameter.md.erb +15 -29
- data/docs/resources/key_rsa.md.erb +3 -0
- data/docs/resources/launchd_service.md.erb +5 -25
- data/docs/resources/limits_conf.md.erb +15 -29
- data/docs/resources/login_def.md.erb +15 -30
- data/docs/resources/mount.md.erb +18 -33
- data/docs/resources/mssql_session.md.erb +9 -12
- data/docs/resources/mysql_conf.md.erb +17 -32
- data/docs/resources/mysql_session.md.erb +15 -29
- data/docs/resources/nginx.md.erb +6 -0
- data/docs/resources/nginx_conf.md.erb +25 -20
- data/docs/resources/npm.md.erb +19 -35
- data/docs/resources/ntp_conf.md.erb +20 -37
- data/docs/resources/oneget.md.erb +15 -30
- data/docs/resources/oracledb_session.md.erb +9 -11
- data/docs/resources/os.md.erb +29 -43
- data/docs/resources/os_env.md.erb +29 -44
- data/docs/resources/package.md.erb +33 -42
- data/docs/resources/parse_config.md.erb +5 -25
- data/docs/resources/parse_config_file.md.erb +31 -43
- data/docs/resources/passwd.md.erb +24 -39
- data/docs/resources/pip.md.erb +20 -35
- data/docs/resources/port.md.erb +43 -57
- data/docs/resources/postgres_conf.md.erb +17 -31
- data/docs/resources/postgres_hba_conf.md.erb +26 -38
- data/docs/resources/postgres_ident_conf.md.erb +25 -37
- data/docs/resources/postgres_session.md.erb +15 -29
- data/docs/resources/powershell.md.erb +27 -42
- data/docs/resources/processes.md.erb +17 -33
- data/docs/resources/rabbitmq_config.md.erb +9 -24
- data/docs/resources/registry_key.md.erb +27 -42
- data/docs/resources/runit_service.md.erb +5 -25
- data/docs/resources/security_policy.md.erb +12 -27
- data/docs/resources/service.md.erb +27 -42
- data/docs/resources/shadow.md.erb +20 -35
- data/docs/resources/ssh_config.md.erb +19 -34
- data/docs/resources/sshd_config.md.erb +19 -34
- data/docs/resources/ssl.md.erb +39 -54
- data/docs/resources/sys_info.md.erb +12 -26
- data/docs/resources/systemd_service.md.erb +5 -25
- data/docs/resources/sysv_service.md.erb +5 -25
- data/docs/resources/upstart_service.md.erb +5 -25
- data/docs/resources/user.md.erb +29 -44
- data/docs/resources/users.md.erb +12 -26
- data/docs/resources/vbscript.md.erb +9 -24
- data/docs/resources/virtualization.md.erb +8 -23
- data/docs/resources/windows_feature.md.erb +15 -30
- data/docs/resources/windows_hotfix.md.erb +15 -9
- data/docs/resources/windows_task.md.erb +12 -26
- data/docs/resources/wmi.md.erb +9 -24
- data/docs/resources/x509_certificate.md.erb +4 -0
- data/docs/resources/xinetd_conf.md.erb +65 -80
- data/docs/resources/xml.md.erb +12 -26
- data/docs/resources/yaml.md.erb +12 -27
- data/docs/resources/yum.md.erb +37 -51
- data/docs/resources/zfs_dataset.md.erb +15 -26
- data/docs/resources/zfs_pool.md.erb +9 -20
- data/lib/inspec/backend.rb +8 -0
- data/lib/inspec/profile.rb +9 -1
- data/lib/inspec/shell.rb +13 -13
- data/lib/inspec/version.rb +1 -1
- data/lib/matchers/matchers.rb +2 -0
- data/lib/resources/etc_hosts.rb +1 -1
- data/lib/resources/host.rb +4 -1
- data/lib/resources/http.rb +173 -23
- data/lib/resources/processes.rb +106 -20
- data/lib/resources/ssh_conf.rb +1 -1
- data/lib/resources/ssl.rb +4 -3
- data/lib/utils/object_traversal.rb +35 -10
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 111ac2cdb0069f50d575dfd47e2644489c3b8296
|
4
|
+
data.tar.gz: b989512dea168e62bc8092c1e3df498a706badd3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1cca620d9852d2a6369bbc0bec4663514abcd80e102a7d7b75a3f62f61c1438df5810bc25d81453fda09cd1b72f59ab648bea045b72c95b42da7211b5dda3c4a
|
7
|
+
data.tar.gz: efa759491e6cadb78ee7f97a2e626663a18548f7f3d60db9fc04d431ad19c5fe11f9427a0a124a05abca26242c12fefd54951b395dc30683253d72dbdc8ef88c
|
data/CHANGELOG.md
CHANGED
@@ -1,20 +1,42 @@
|
|
1
1
|
# Change Log
|
2
2
|
<!-- usage documentation: http://expeditor-docs.es.chef.io/configuration/changelog/ -->
|
3
|
-
<!-- latest_release 1.40.
|
4
|
-
## [v1.40.
|
3
|
+
<!-- latest_release 1.40.13 -->
|
4
|
+
## [v1.40.13](https://github.com/chef/inspec/tree/v1.40.13) (2017-10-07)
|
5
5
|
|
6
|
-
####
|
7
|
-
-
|
6
|
+
#### Enhancements
|
7
|
+
- Enhance cmp matcher to work with symbols, fix file documentation [#2224](https://github.com/chef/inspec/pull/2224) ([adamleff](https://github.com/adamleff))
|
8
8
|
<!-- latest_release -->
|
9
9
|
|
10
|
-
<!-- release_rollup since=1.
|
11
|
-
### Changes since 1.
|
10
|
+
<!-- release_rollup since=1.40.0 -->
|
11
|
+
### Changes since 1.40.0 release
|
12
12
|
|
13
|
-
####
|
14
|
-
-
|
13
|
+
#### Bug Fixes
|
14
|
+
- ssl resource: properly raise error when unable to determine if port is enabled [#2205](https://github.com/chef/inspec/pull/2205) ([jquick](https://github.com/jquick)) <!-- 1.40.12 -->
|
15
|
+
- Fix loading profile files when executing multiple profiles [#2223](https://github.com/chef/inspec/pull/2223) ([adamleff](https://github.com/adamleff)) <!-- 1.40.11 -->
|
16
|
+
- Support symbol keys in ObjectTraverser [#2221](https://github.com/chef/inspec/pull/2221) ([adamleff](https://github.com/adamleff)) <!-- 1.40.8 -->
|
17
|
+
- Add nil check for sshd config file [#2217](https://github.com/chef/inspec/pull/2217) ([jquick](https://github.com/jquick)) <!-- 1.40.7 -->
|
18
|
+
|
19
|
+
#### Enhancements
|
20
|
+
- Enhance cmp matcher to work with symbols, fix file documentation [#2224](https://github.com/chef/inspec/pull/2224) ([adamleff](https://github.com/adamleff)) <!-- 1.40.13 -->
|
21
|
+
- processes resource: support busybox ps [#2222](https://github.com/chef/inspec/pull/2222) ([adamleff](https://github.com/adamleff)) <!-- 1.40.10 -->
|
22
|
+
- Update shell resource help to return what is defined [#2219](https://github.com/chef/inspec/pull/2219) ([jquick](https://github.com/jquick)) <!-- 1.40.9 -->
|
23
|
+
- Add output for port/protocol for host resource. [#2202](https://github.com/chef/inspec/pull/2202) ([jquick](https://github.com/jquick)) <!-- 1.40.3 -->
|
24
|
+
|
25
|
+
#### Merged Pull Requests
|
26
|
+
- Add Segment tag to enable Google Analytics [#2220](https://github.com/chef/inspec/pull/2220) ([hamburglar](https://github.com/hamburglar)) <!-- 1.40.6 -->
|
27
|
+
- http resource: properly execute tests on remote target [#2209](https://github.com/chef/inspec/pull/2209) ([adamleff](https://github.com/adamleff)) <!-- 1.40.5 -->
|
28
|
+
- Adding examples of using expect syntax [#2213](https://github.com/chef/inspec/pull/2213) ([adamleff](https://github.com/adamleff)) <!-- 1.40.4 -->
|
29
|
+
- Add bsd platform family to etc_hosts resource [#2192](https://github.com/chef/inspec/pull/2192) ([ctbarrett](https://github.com/ctbarrett)) <!-- 1.40.2 -->
|
30
|
+
- Clean-up kitchen-inspec reference doc [#2208](https://github.com/chef/inspec/pull/2208) ([nathenharvey](https://github.com/nathenharvey)) <!-- 1.40.1 -->
|
15
31
|
<!-- release_rollup -->
|
16
32
|
|
17
33
|
<!-- latest_stable_release -->
|
34
|
+
## [v1.40.0](https://github.com/chef/inspec/tree/v1.40.0) (2017-09-28)
|
35
|
+
|
36
|
+
#### New Resources
|
37
|
+
- firewalld resource: inspect the status and configuration of firewalld [#2074](https://github.com/chef/inspec/pull/2074) ([dromazmj](https://github.com/dromazmj))
|
38
|
+
<!-- latest_stable_release -->
|
39
|
+
|
18
40
|
## [v1.39.0](https://github.com/chef/inspec/tree/v1.39.0) (2017-09-25)
|
19
41
|
|
20
42
|
#### New Resources
|
@@ -23,7 +45,6 @@
|
|
23
45
|
|
24
46
|
#### Merged Pull Requests
|
25
47
|
- Bump train to 0.28 to allow for more net-ssh versions [#2185](https://github.com/chef/inspec/pull/2185) ([adamleff](https://github.com/adamleff))
|
26
|
-
<!-- latest_stable_release -->
|
27
48
|
|
28
49
|
## [v1.38.8](https://github.com/chef/inspec/tree/v1.38.8) (2017-09-23)
|
29
50
|
|
data/docs/matchers.md
CHANGED
@@ -14,6 +14,8 @@ The following matchers are available:
|
|
14
14
|
* `include`
|
15
15
|
* `match`
|
16
16
|
|
17
|
+
<br>
|
18
|
+
|
17
19
|
## be
|
18
20
|
|
19
21
|
This matcher can be followed by many different comparison operators.
|
@@ -26,6 +28,8 @@ describe file('/proc/cpuinfo') do
|
|
26
28
|
end
|
27
29
|
```
|
28
30
|
|
31
|
+
<br>
|
32
|
+
|
29
33
|
## cmp
|
30
34
|
|
31
35
|
Unlike `eq`, cmp is a matcher for less-restrictive comparisons. It will
|
@@ -64,6 +68,13 @@ end
|
|
64
68
|
its('log_format') { should cmp 'RAW' }
|
65
69
|
end
|
66
70
|
```
|
71
|
+
* Recognize versions embedded in strings
|
72
|
+
|
73
|
+
```ruby
|
74
|
+
describe package(curl) do
|
75
|
+
its('version') { should cmp > '7.35.0-1ubuntu2.10' }
|
76
|
+
end
|
77
|
+
```
|
67
78
|
|
68
79
|
* Compare arrays with only one entry to a value
|
69
80
|
|
@@ -92,6 +103,7 @@ end
|
|
92
103
|
expected: 0345
|
93
104
|
got: 0444
|
94
105
|
```
|
106
|
+
<br>
|
95
107
|
|
96
108
|
## eq
|
97
109
|
|
@@ -116,6 +128,8 @@ its('Port') { should eq 22 }
|
|
116
128
|
|
117
129
|
For less restrictive comparisons, please use `cmp`.
|
118
130
|
|
131
|
+
<br>
|
132
|
+
|
119
133
|
## include
|
120
134
|
|
121
135
|
Verifies if a value is included in a list.
|
@@ -126,6 +140,8 @@ describe passwd do
|
|
126
140
|
end
|
127
141
|
```
|
128
142
|
|
143
|
+
<br>
|
144
|
+
|
129
145
|
## be_in
|
130
146
|
|
131
147
|
Verifies that an item is included in a list.
|
@@ -136,6 +152,8 @@ describe resource do
|
|
136
152
|
end
|
137
153
|
```
|
138
154
|
|
155
|
+
<br>
|
156
|
+
|
139
157
|
## match
|
140
158
|
|
141
159
|
Check if a string matches a regular expression.
|
@@ -4,19 +4,19 @@ title: About kitchen-inspec
|
|
4
4
|
|
5
5
|
# kitchen-inspec
|
6
6
|
|
7
|
-
|
7
|
+
Use InSpec as a Kitchen verifier with `kitchen-inspec`.
|
8
8
|
|
9
|
-
|
9
|
+
Add the InSpec verifier to the `.kitchen.yml` file:
|
10
10
|
|
11
11
|
verifier:
|
12
12
|
name: inspec
|
13
13
|
|
14
|
-
|
14
|
+
Use a compliance profile from the Chef Compliance server:
|
15
15
|
|
16
16
|
suites:
|
17
17
|
- name: compliance
|
18
18
|
run_list:
|
19
|
-
- recipe[ssh-hardening]
|
19
|
+
- recipe[ssh-hardening::default]
|
20
20
|
verifier:
|
21
21
|
inspec_tests:
|
22
22
|
- compliance://base/ssh
|
@@ -27,29 +27,23 @@ and then run the following command:
|
|
27
27
|
|
28
28
|
where `--insecure` is required when using self-signed certificates.
|
29
29
|
|
30
|
-
|
30
|
+
Use a compliance profile from the Chef Supermarket:
|
31
31
|
|
32
32
|
suites:
|
33
33
|
- name: supermarket
|
34
34
|
run_list:
|
35
|
-
- recipe[ssh-hardening]
|
35
|
+
- recipe[ssh-hardening::default]
|
36
36
|
verifier:
|
37
37
|
inspec_tests:
|
38
|
-
- supermarket://
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
└── test
|
51
|
-
└── integration
|
52
|
-
└── default
|
53
|
-
├── controls
|
54
|
-
├── inspec.yml
|
55
|
-
└── libraries
|
38
|
+
- supermarket://dev-sec/ssh-baseline
|
39
|
+
|
40
|
+
Use InSpec tests from the local file system:
|
41
|
+
|
42
|
+
suites:
|
43
|
+
- name: local
|
44
|
+
run_list:
|
45
|
+
- recipe[my_cookbook::default]
|
46
|
+
verifier:
|
47
|
+
inspec_tests:
|
48
|
+
- test/integration/default
|
49
|
+
|
data/docs/profiles.md
CHANGED
@@ -125,7 +125,7 @@ InSpec supports a number of dependency sources.
|
|
125
125
|
|
126
126
|
### path
|
127
127
|
|
128
|
-
The `path` setting defines a profile that is located on disk. This setting is typically used during development of profiles and when debugging profiles.
|
128
|
+
The `path` setting defines a profile that is located on disk. This setting is typically used during development of profiles and when debugging profiles.
|
129
129
|
|
130
130
|
depends:
|
131
131
|
- name: my-profile
|
@@ -203,7 +203,7 @@ In the example above, every time `my-app-profile` is executed, all the controls
|
|
203
203
|
* baseline-1
|
204
204
|
* baseline-2
|
205
205
|
|
206
|
-
This is a great reminder that having a good naming convention for your controls is helpful to avoid confusion when
|
206
|
+
This is a great reminder that having a good naming convention for your controls is helpful to avoid confusion when
|
207
207
|
including controls from other profiles!
|
208
208
|
|
209
209
|
### Skipping a Control from a Profile
|
@@ -331,3 +331,40 @@ The tests in `example.rb` can now access this file:
|
|
331
331
|
it { should be_listening }
|
332
332
|
end
|
333
333
|
end
|
334
|
+
|
335
|
+
# "should" vs. "expect" syntax
|
336
|
+
|
337
|
+
Users familiar with the RSpec testing framework may know that there are two ways to write test statements: `should` and `expect`. The RSpec community decided that `expect` is the preferred syntax. However, InSpec recommends the `should` syntax as it tends to read more easily to those users who are not as technical.
|
338
|
+
|
339
|
+
InSpec will continue to support both methods of writing tests. Consider this `file` test:
|
340
|
+
|
341
|
+
describe file('/tmp/test.txt') do
|
342
|
+
it { should be_file }
|
343
|
+
end
|
344
|
+
|
345
|
+
This can be re-written with `expect` syntax
|
346
|
+
|
347
|
+
describe file('/tmp/test.txt') do
|
348
|
+
it 'should be a file' do
|
349
|
+
expect(subject).to(be_file)
|
350
|
+
end
|
351
|
+
end
|
352
|
+
|
353
|
+
The output of both of the above examples looks like this:
|
354
|
+
|
355
|
+
File /tmp/test.txt
|
356
|
+
✔ should be a file
|
357
|
+
|
358
|
+
In addition, you can make use of the `subject` keyword to further control your output if you choose:
|
359
|
+
|
360
|
+
describe 'test file' do
|
361
|
+
subject { file('/tmp/test.txt') }
|
362
|
+
it 'should be a file' do
|
363
|
+
expect(subject).to(be_file)
|
364
|
+
end
|
365
|
+
end
|
366
|
+
|
367
|
+
... which will render the following output:
|
368
|
+
|
369
|
+
test file
|
370
|
+
✔ should be a file
|
@@ -6,6 +6,8 @@ title: About the aide_conf Resource
|
|
6
6
|
|
7
7
|
Use the `aide_conf` InSpec audit resource to test the rules established for the file integrity tool AIDE. Controlled by the aide.conf file typically at /etc/aide.conf.
|
8
8
|
|
9
|
+
<br>
|
10
|
+
|
9
11
|
## Syntax
|
10
12
|
|
11
13
|
An `aide_conf` resource block can be used to determine if the selection lines contain one (or more) directories whose files should be added to the aide database:
|
@@ -30,37 +32,11 @@ Use the where clause to match a selection_line to one rule or a particular set o
|
|
30
32
|
its('rules') { should include ['p', 'i', 'l', 'n', 'u', 'g', 'sha512'] }
|
31
33
|
end
|
32
34
|
|
33
|
-
|
34
|
-
|
35
|
-
This InSpec audit resource has the following matchers:
|
36
|
-
|
37
|
-
### be
|
38
|
-
|
39
|
-
<%= partial "/shared/matcher_be" %>
|
40
|
-
|
41
|
-
### cmp
|
42
|
-
|
43
|
-
<%= partial "/shared/matcher_cmp" %>
|
44
|
-
|
45
|
-
### eq
|
46
|
-
|
47
|
-
<%= partial "/shared/matcher_eq" %>
|
48
|
-
|
49
|
-
### include
|
50
|
-
|
51
|
-
<%= partial "/shared/matcher_include" %>
|
52
|
-
|
53
|
-
### all_have_rule
|
54
|
-
|
55
|
-
The usage of all_have_rule will return whether or not all selection lines in audit.conf contain a particular rule:
|
56
|
-
|
57
|
-
describe aide_conf.all_have_rule('sha512') do
|
58
|
-
it { should eq true }
|
59
|
-
end
|
35
|
+
<br>
|
60
36
|
|
61
37
|
## Examples
|
62
38
|
|
63
|
-
The following examples show how to use this InSpec audit resource.
|
39
|
+
The following examples show how to use this InSpec audit resource. For a full list of available matchers please visit our [matchers page](https://www.inspec.io/docs/reference/matchers/).
|
64
40
|
|
65
41
|
### Test if all selection lines contain the xattr rule
|
66
42
|
|
@@ -79,3 +55,17 @@ The following examples show how to use this InSpec audit resource.
|
|
79
55
|
describe aide_conf.where { selection_line == '/sbin' } do
|
80
56
|
its('rules') { should include ['r', 'sha512'] }
|
81
57
|
end
|
58
|
+
|
59
|
+
<br>
|
60
|
+
|
61
|
+
## Matchers
|
62
|
+
|
63
|
+
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/).
|
64
|
+
|
65
|
+
### all_have_rule
|
66
|
+
|
67
|
+
The usage of all_have_rule will return whether or not all selection lines in audit.conf contain a particular rule:
|
68
|
+
|
69
|
+
describe aide_conf.all_have_rule('sha512') do
|
70
|
+
it { should eq true }
|
71
|
+
end
|
@@ -6,6 +6,8 @@ title: About the apache_conf Resource
|
|
6
6
|
|
7
7
|
Use the `apache_conf` InSpec audit resource to test the configuration settings for Apache. This file is typically located under `/etc/apache2` on the Debian and Ubuntu platforms and under `/etc/httpd` on the Fedora, CentOS, RedHat Enterprise Linux, and ArchLinux platforms. The configuration settings may vary significantly from platform to platform.
|
8
8
|
|
9
|
+
<br>
|
10
|
+
|
9
11
|
## Syntax
|
10
12
|
|
11
13
|
An `apache_conf` InSpec audit resource block declares configuration settings that should be tested:
|
@@ -20,56 +22,40 @@ where
|
|
20
22
|
* `('path')` is the non-default path to the Apache configuration file
|
21
23
|
* `{ should eq 'value' }` is the value that is expected
|
22
24
|
|
23
|
-
|
25
|
+
<br>
|
24
26
|
|
25
|
-
|
27
|
+
## Examples
|
26
28
|
|
27
|
-
|
29
|
+
The following examples show how to use this InSpec audit resource.
|
28
30
|
|
29
|
-
|
31
|
+
### Test for blocking .htaccess files on CentOS
|
30
32
|
|
31
|
-
|
33
|
+
describe apache_conf do
|
34
|
+
its('AllowOverride') { should eq 'None' }
|
35
|
+
end
|
32
36
|
|
33
|
-
|
37
|
+
### Test ports for SSL
|
34
38
|
|
35
39
|
describe apache_conf do
|
36
|
-
its('MaxClients') { should eq 100 }
|
37
40
|
its('Listen') { should eq '443'}
|
38
41
|
end
|
39
42
|
|
43
|
+
<br>
|
40
44
|
|
41
|
-
|
42
|
-
|
43
|
-
<%= partial "/shared/matcher_be" %>
|
44
|
-
|
45
|
-
### cmp
|
46
|
-
|
47
|
-
<%= partial "/shared/matcher_cmp" %>
|
48
|
-
|
49
|
-
### eq
|
50
|
-
|
51
|
-
<%= partial "/shared/matcher_eq" %>
|
52
|
-
|
53
|
-
### include
|
54
|
-
|
55
|
-
<%= partial "/shared/matcher_include" %>
|
56
|
-
|
57
|
-
### match
|
58
|
-
|
59
|
-
<%= partial "/shared/matcher_match" %>
|
45
|
+
## Matchers
|
60
46
|
|
61
|
-
|
47
|
+
For a full list of available matchers please visit our [matchers page](https://www.inspec.io/docs/reference/matchers/).
|
48
|
+
This InSpec audit resource matches any service that is listed in the Apache configuration file:
|
62
49
|
|
63
|
-
|
50
|
+
its('PidFile') { should_not eq '/var/run/httpd.pid' }
|
64
51
|
|
65
|
-
|
52
|
+
or:
|
66
53
|
|
67
|
-
|
68
|
-
its('AllowOverride') { should eq 'None' }
|
69
|
-
end
|
54
|
+
its('Timeout') { should eq 300 }
|
70
55
|
|
71
|
-
|
56
|
+
For example:
|
72
57
|
|
73
58
|
describe apache_conf do
|
59
|
+
its('MaxClients') { should eq 100 }
|
74
60
|
its('Listen') { should eq '443'}
|
75
61
|
end
|
data/docs/resources/apt.md.erb
CHANGED
@@ -6,6 +6,8 @@ title: About the apt Resource
|
|
6
6
|
|
7
7
|
Use the `apt` InSpec audit resource to verify Apt repositories on the Debian and Ubuntu platforms, and also PPA repositories on the Ubuntu platform.
|
8
8
|
|
9
|
+
<br>
|
10
|
+
|
9
11
|
## Syntax
|
10
12
|
|
11
13
|
An `apt` resource block tests the contents of Apt and PPA repositories:
|
@@ -21,42 +23,7 @@ where
|
|
21
23
|
* `('path')` may be an `http://` address, a `ppa:` address, or a short `repo-name/ppa` address
|
22
24
|
* `exist` and `be_enabled` are a valid matchers for this resource
|
23
25
|
|
24
|
-
|
25
|
-
## Matchers
|
26
|
-
|
27
|
-
This InSpec audit resource has the following matchers:
|
28
|
-
|
29
|
-
### be
|
30
|
-
|
31
|
-
<%= partial "/shared/matcher_be" %>
|
32
|
-
|
33
|
-
### be_enabled
|
34
|
-
|
35
|
-
The `be_enabled` matcher tests if a package exists in the repository:
|
36
|
-
|
37
|
-
it { should be_enabled }
|
38
|
-
|
39
|
-
### cmp
|
40
|
-
|
41
|
-
<%= partial "/shared/matcher_cmp" %>
|
42
|
-
|
43
|
-
### eq
|
44
|
-
|
45
|
-
<%= partial "/shared/matcher_eq" %>
|
46
|
-
|
47
|
-
### exist
|
48
|
-
|
49
|
-
The `exist` matcher tests if a package exists on the system:
|
50
|
-
|
51
|
-
it { should exist }
|
52
|
-
|
53
|
-
### include
|
54
|
-
|
55
|
-
<%= partial "/shared/matcher_include" %>
|
56
|
-
|
57
|
-
### match
|
58
|
-
|
59
|
-
<%= partial "/shared/matcher_match" %>
|
26
|
+
<br>
|
60
27
|
|
61
28
|
## Examples
|
62
29
|
|
@@ -82,3 +49,22 @@ The following examples show how to use this InSpec audit resource.
|
|
82
49
|
it { should_not exist }
|
83
50
|
it { should_not be_enabled }
|
84
51
|
end
|
52
|
+
|
53
|
+
<br>
|
54
|
+
|
55
|
+
## Matchers
|
56
|
+
|
57
|
+
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/).
|
58
|
+
|
59
|
+
|
60
|
+
### be_enabled
|
61
|
+
|
62
|
+
The `be_enabled` matcher tests if a package exists in the repository:
|
63
|
+
|
64
|
+
it { should be_enabled }
|
65
|
+
|
66
|
+
### exist
|
67
|
+
|
68
|
+
The `exist` matcher tests if a package exists on the system:
|
69
|
+
|
70
|
+
it { should exist }
|