inspec 1.40.0 → 1.41.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (114) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +30 -9
  3. data/docs/matchers.md +18 -0
  4. data/docs/plugin_kitchen_inspec.md +18 -24
  5. data/docs/profiles.md +39 -2
  6. data/docs/resources/aide_conf.md.erb +18 -28
  7. data/docs/resources/apache_conf.md.erb +19 -33
  8. data/docs/resources/apt.md.erb +22 -36
  9. data/docs/resources/audit_policy.md.erb +9 -24
  10. data/docs/resources/auditd.md.erb +9 -24
  11. data/docs/resources/auditd_conf.md.erb +20 -34
  12. data/docs/resources/auditd_rules.md.erb +8 -24
  13. data/docs/resources/bash.md.erb +4 -26
  14. data/docs/resources/bond.md.erb +25 -40
  15. data/docs/resources/bridge.md.erb +5 -25
  16. data/docs/resources/bsd_service.md.erb +5 -25
  17. data/docs/resources/command.md.erb +35 -50
  18. data/docs/resources/crontab.md.erb +9 -23
  19. data/docs/resources/csv.md.erb +12 -27
  20. data/docs/resources/dh_params.md +1 -0
  21. data/docs/resources/directory.md.erb +5 -25
  22. data/docs/resources/docker.md.erb +60 -57
  23. data/docs/resources/docker_container.md.erb +23 -19
  24. data/docs/resources/docker_image.md.erb +20 -16
  25. data/docs/resources/etc_fstab.md.erb +5 -2
  26. data/docs/resources/etc_group.md.erb +29 -45
  27. data/docs/resources/etc_hosts.md.erb +6 -0
  28. data/docs/resources/etc_hosts_allow.md.erb +6 -2
  29. data/docs/resources/etc_hosts_deny.md.erb +6 -2
  30. data/docs/resources/file.md.erb +198 -212
  31. data/docs/resources/firewalld.md.erb +7 -1
  32. data/docs/resources/gem.md.erb +21 -35
  33. data/docs/resources/group.md.erb +16 -30
  34. data/docs/resources/grub_conf.md.erb +9 -24
  35. data/docs/resources/host.md.erb +32 -49
  36. data/docs/resources/http.md.erb +38 -44
  37. data/docs/resources/iis_app.md.erb +25 -35
  38. data/docs/resources/iis_site.md.erb +26 -40
  39. data/docs/resources/inetd_conf.md.erb +27 -42
  40. data/docs/resources/ini.md.erb +9 -23
  41. data/docs/resources/interface.md.erb +5 -25
  42. data/docs/resources/iptables.md.erb +15 -29
  43. data/docs/resources/json.md.erb +12 -27
  44. data/docs/resources/kernel_module.md.erb +47 -61
  45. data/docs/resources/kernel_parameter.md.erb +15 -29
  46. data/docs/resources/key_rsa.md.erb +3 -0
  47. data/docs/resources/launchd_service.md.erb +5 -25
  48. data/docs/resources/limits_conf.md.erb +15 -29
  49. data/docs/resources/login_def.md.erb +15 -30
  50. data/docs/resources/mount.md.erb +18 -33
  51. data/docs/resources/mssql_session.md.erb +9 -12
  52. data/docs/resources/mysql_conf.md.erb +17 -32
  53. data/docs/resources/mysql_session.md.erb +15 -29
  54. data/docs/resources/nginx.md.erb +6 -0
  55. data/docs/resources/nginx_conf.md.erb +25 -20
  56. data/docs/resources/npm.md.erb +19 -35
  57. data/docs/resources/ntp_conf.md.erb +20 -37
  58. data/docs/resources/oneget.md.erb +15 -30
  59. data/docs/resources/oracledb_session.md.erb +9 -11
  60. data/docs/resources/os.md.erb +29 -43
  61. data/docs/resources/os_env.md.erb +29 -44
  62. data/docs/resources/package.md.erb +33 -42
  63. data/docs/resources/parse_config.md.erb +5 -25
  64. data/docs/resources/parse_config_file.md.erb +31 -43
  65. data/docs/resources/passwd.md.erb +24 -39
  66. data/docs/resources/pip.md.erb +20 -35
  67. data/docs/resources/port.md.erb +43 -57
  68. data/docs/resources/postgres_conf.md.erb +17 -31
  69. data/docs/resources/postgres_hba_conf.md.erb +26 -38
  70. data/docs/resources/postgres_ident_conf.md.erb +25 -37
  71. data/docs/resources/postgres_session.md.erb +15 -29
  72. data/docs/resources/powershell.md.erb +27 -42
  73. data/docs/resources/processes.md.erb +17 -33
  74. data/docs/resources/rabbitmq_config.md.erb +9 -24
  75. data/docs/resources/registry_key.md.erb +27 -42
  76. data/docs/resources/runit_service.md.erb +5 -25
  77. data/docs/resources/security_policy.md.erb +12 -27
  78. data/docs/resources/service.md.erb +27 -42
  79. data/docs/resources/shadow.md.erb +20 -35
  80. data/docs/resources/ssh_config.md.erb +19 -34
  81. data/docs/resources/sshd_config.md.erb +19 -34
  82. data/docs/resources/ssl.md.erb +39 -54
  83. data/docs/resources/sys_info.md.erb +12 -26
  84. data/docs/resources/systemd_service.md.erb +5 -25
  85. data/docs/resources/sysv_service.md.erb +5 -25
  86. data/docs/resources/upstart_service.md.erb +5 -25
  87. data/docs/resources/user.md.erb +29 -44
  88. data/docs/resources/users.md.erb +12 -26
  89. data/docs/resources/vbscript.md.erb +9 -24
  90. data/docs/resources/virtualization.md.erb +8 -23
  91. data/docs/resources/windows_feature.md.erb +15 -30
  92. data/docs/resources/windows_hotfix.md.erb +15 -9
  93. data/docs/resources/windows_task.md.erb +12 -26
  94. data/docs/resources/wmi.md.erb +9 -24
  95. data/docs/resources/x509_certificate.md.erb +4 -0
  96. data/docs/resources/xinetd_conf.md.erb +65 -80
  97. data/docs/resources/xml.md.erb +12 -26
  98. data/docs/resources/yaml.md.erb +12 -27
  99. data/docs/resources/yum.md.erb +37 -51
  100. data/docs/resources/zfs_dataset.md.erb +15 -26
  101. data/docs/resources/zfs_pool.md.erb +9 -20
  102. data/lib/inspec/backend.rb +8 -0
  103. data/lib/inspec/profile.rb +9 -1
  104. data/lib/inspec/shell.rb +13 -13
  105. data/lib/inspec/version.rb +1 -1
  106. data/lib/matchers/matchers.rb +2 -0
  107. data/lib/resources/etc_hosts.rb +1 -1
  108. data/lib/resources/host.rb +4 -1
  109. data/lib/resources/http.rb +173 -23
  110. data/lib/resources/processes.rb +106 -20
  111. data/lib/resources/ssh_conf.rb +1 -1
  112. data/lib/resources/ssl.rb +4 -3
  113. data/lib/utils/object_traversal.rb +35 -10
  114. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 48bd4f2dd3f7ca6fd9867f3c526a77d33f823cd3
4
- data.tar.gz: 40b54c1efd38c3b50d88c58ef60652d59d9ae1e6
3
+ metadata.gz: 111ac2cdb0069f50d575dfd47e2644489c3b8296
4
+ data.tar.gz: b989512dea168e62bc8092c1e3df498a706badd3
5
5
  SHA512:
6
- metadata.gz: 549fab63987e3a8c4601d9166f3c49d8d7db92537a4358f3b83c43342ddacefcf1ba5d598e19b354414f04591f2e4a4eb5b4723358f3cbd74b717fe92659547a
7
- data.tar.gz: bc5e8c053a1d96b4a24be5fc85b3754a71a4a20d5780be13d282a3d794e27b0f246771b19f443fb53838a3ff8d61236c26cc904b5cffa8a7d208b7e2187471f5
6
+ metadata.gz: 1cca620d9852d2a6369bbc0bec4663514abcd80e102a7d7b75a3f62f61c1438df5810bc25d81453fda09cd1b72f59ab648bea045b72c95b42da7211b5dda3c4a
7
+ data.tar.gz: efa759491e6cadb78ee7f97a2e626663a18548f7f3d60db9fc04d431ad19c5fe11f9427a0a124a05abca26242c12fefd54951b395dc30683253d72dbdc8ef88c
@@ -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.0 -->
4
- ## [v1.40.0](https://github.com/chef/inspec/tree/v1.40.0) (2017-09-27)
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
- #### New Resources
7
- - firewalld resource: inspect the status and configuration of firewalld [#2074](https://github.com/chef/inspec/pull/2074) ([dromazmj](https://github.com/dromazmj))
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.39.1 -->
11
- ### Changes since 1.39.1 release
10
+ <!-- release_rollup since=1.40.0 -->
11
+ ### Changes since 1.40.0 release
12
12
 
13
- #### New Resources
14
- - firewalld resource: inspect the status and configuration of firewalld [#2074](https://github.com/chef/inspec/pull/2074) ([dromazmj](https://github.com/dromazmj)) <!-- 1.40.0 -->
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
 
@@ -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
- The `kitchen-inspec` driver enables InSpec to be used as a verifier within Kitchen.
7
+ Use InSpec as a Kitchen verifier with `kitchen-inspec`.
8
8
 
9
- To use InSpec as a verifier, add it to the kitchen.yml file:
9
+ Add the InSpec verifier to the `.kitchen.yml` file:
10
10
 
11
11
  verifier:
12
12
  name: inspec
13
13
 
14
- To define a suite that pulls its run-list from the Chef Compliance server:
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
- To define a suite that pulls its run-list from the Chef Supermarket:
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://hardening/ssh-hardening
39
-
40
- The `kitchen-inspec` driver expects tests to be located in the `test/integration` directory in a cookbook. For example::
41
-
42
- .
43
- ├── Berksfile
44
- ├── Gemfile
45
- ├── README.md
46
- ├── metadata.rb
47
- ├── recipes
48
- │ ├── default.rb
49
- │ └── nginx.rb
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
+
@@ -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
- ## Matchers
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
- ## Matchers
25
+ <br>
24
26
 
25
- This InSpec audit resource matches any service that is listed in the Apache configuration file:
27
+ ## Examples
26
28
 
27
- its('PidFile') { should_not eq '/var/run/httpd.pid' }
29
+ The following examples show how to use this InSpec audit resource.
28
30
 
29
- or:
31
+ ### Test for blocking .htaccess files on CentOS
30
32
 
31
- its('Timeout') { should eq 300 }
33
+ describe apache_conf do
34
+ its('AllowOverride') { should eq 'None' }
35
+ end
32
36
 
33
- For example:
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
- ### be
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
- ## Examples
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
- The following examples show how to use this InSpec audit resource.
50
+ its('PidFile') { should_not eq '/var/run/httpd.pid' }
64
51
 
65
- ### Test for blocking .htaccess files on CentOS
52
+ or:
66
53
 
67
- describe apache_conf do
68
- its('AllowOverride') { should eq 'None' }
69
- end
54
+ its('Timeout') { should eq 300 }
70
55
 
71
- ### Test ports for SSL
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
@@ -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 }