inspec 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (82) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +46 -3
  3. data/Gemfile +4 -1
  4. data/README.md +3 -0
  5. data/docs/dsl_inspec.md +3 -3
  6. data/docs/profiles.md +17 -0
  7. data/docs/resources/apache_conf.md.erb +10 -10
  8. data/docs/resources/apt.md.erb +13 -13
  9. data/docs/resources/audit_policy.md.erb +10 -10
  10. data/docs/resources/auditd_conf.md.erb +10 -10
  11. data/docs/resources/auditd_rules.md.erb +11 -11
  12. data/docs/resources/bash.md.erb +12 -12
  13. data/docs/resources/bond.md.erb +15 -15
  14. data/docs/resources/bridge.md.erb +11 -11
  15. data/docs/resources/bsd_service.md.erb +11 -11
  16. data/docs/resources/command.md.erb +21 -21
  17. data/docs/resources/csv.md.erb +10 -10
  18. data/docs/resources/directory.md.erb +8 -8
  19. data/docs/resources/etc_group.md.erb +16 -16
  20. data/docs/resources/etc_passwd.md.erb +17 -17
  21. data/docs/resources/etc_shadow.md.erb +19 -19
  22. data/docs/resources/file.md.erb +58 -58
  23. data/docs/resources/gem.md.erb +12 -12
  24. data/docs/resources/group.md.erb +12 -12
  25. data/docs/resources/grub_conf.md.erb +11 -11
  26. data/docs/resources/host.md.erb +13 -13
  27. data/docs/resources/iis_site.md.erb +16 -16
  28. data/docs/resources/inetd_conf.md.erb +10 -10
  29. data/docs/resources/ini.md.erb +9 -9
  30. data/docs/resources/interface.md.erb +11 -11
  31. data/docs/resources/iptables.md.erb +11 -11
  32. data/docs/resources/json.md.erb +10 -10
  33. data/docs/resources/kernel_module.md.erb +10 -10
  34. data/docs/resources/kernel_parameter.md.erb +12 -12
  35. data/docs/resources/launchd_service.md.erb +11 -11
  36. data/docs/resources/limits_conf.md.erb +10 -10
  37. data/docs/resources/login_def.md.erb +12 -12
  38. data/docs/resources/mount.md.erb +13 -13
  39. data/docs/resources/mysql_conf.md.erb +14 -14
  40. data/docs/resources/mysql_session.md.erb +10 -10
  41. data/docs/resources/npm.md.erb +12 -12
  42. data/docs/resources/ntp_conf.md.erb +9 -9
  43. data/docs/resources/oneget.md.erb +11 -11
  44. data/docs/resources/os.md.erb +13 -13
  45. data/docs/resources/os_env.md.erb +12 -12
  46. data/docs/resources/package.md.erb +15 -15
  47. data/docs/resources/parse_config.md.erb +13 -13
  48. data/docs/resources/parse_config_file.md.erb +22 -16
  49. data/docs/resources/pip.md.erb +12 -12
  50. data/docs/resources/port.md.erb +18 -18
  51. data/docs/resources/postgres_conf.md.erb +13 -13
  52. data/docs/resources/postgres_session.md.erb +11 -11
  53. data/docs/resources/powershell.md.erb +13 -13
  54. data/docs/resources/process.md.erb +12 -12
  55. data/docs/resources/registry_key.md.erb +17 -17
  56. data/docs/resources/runit_service.md.erb +11 -11
  57. data/docs/resources/security_policy.md.erb +10 -10
  58. data/docs/resources/service.md.erb +17 -17
  59. data/docs/resources/ssh_config.md.erb +13 -13
  60. data/docs/resources/sshd_config.md.erb +14 -14
  61. data/docs/resources/ssl.md.erb +12 -12
  62. data/docs/resources/sys_info.md.erb +10 -10
  63. data/docs/resources/systemd_service.md.erb +11 -11
  64. data/docs/resources/sysv_service.md.erb +11 -11
  65. data/docs/resources/upstart_service.md.erb +11 -11
  66. data/docs/resources/user.md.erb +20 -20
  67. data/docs/resources/users.md.erb +19 -19
  68. data/docs/resources/vbscript.md.erb +9 -9
  69. data/docs/resources/windows_feature.md.erb +10 -10
  70. data/docs/resources/wmi.md.erb +10 -10
  71. data/docs/resources/xinetd_conf.md.erb +17 -17
  72. data/docs/resources/yaml.md.erb +10 -10
  73. data/docs/resources/yum.md.erb +16 -16
  74. data/examples/meta-profile/README.md +0 -5
  75. data/lib/inspec/base_cli.rb +6 -0
  76. data/lib/inspec/cli.rb +10 -3
  77. data/lib/inspec/profile.rb +3 -3
  78. data/lib/inspec/rspec_json_formatter.rb +24 -15
  79. data/lib/inspec/version.rb +1 -1
  80. data/lib/resources/registry_key.rb +15 -5
  81. data/lib/utils/filter.rb +1 -0
  82. metadata +3 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6c1825c5508e4853cf4bc1446a5b2bd679d9d1be
4
- data.tar.gz: 6ffbe626a987b38ea03561d8bd18681803d89aaf
3
+ metadata.gz: 2faac665307feffb17c77bd84bfc153d4d9bd67c
4
+ data.tar.gz: 102164908f57fcdd0d7f98f9718e3d66befbbf17
5
5
  SHA512:
6
- metadata.gz: 4bb3e9f9c6295dcb29e500b134e5b264ac239f8270cb695dd6c28aeefa7fc9b65604e93b9c144f2754536988a8c1220dc31df12add23729fcaea9eabecbd6b11
7
- data.tar.gz: 5916f874af8a593d5b08e7456bacf42b5ed7c6dadf73b243c4e0d6d675af470f7aa2928abb603da4a32d97c76ded9e1354e6ab05eac61ffd85d4d0030e7fe60f
6
+ metadata.gz: 63805e739ec2374b9c42a9a0ab9c48934eb8e49c858ae4543d42dafbaacd42c2bb570a5046bea4fb63c7d6ce848bb58a245c814485e1cfff78bca6a3020e5f58
7
+ data.tar.gz: 7a2953246e9a34fcfb34664b65cc479ff56bb1bfb3fdd208ad045c162dce613590b52c26f297cdb5a40f4a60dfcdde6bfedcea04b3215f7a65d782b9721516f4
@@ -1,7 +1,51 @@
1
1
  # Change Log
2
2
 
3
- ## [1.0.0](https://github.com/chef/inspec/tree/1.0.0) (2016-09-26)
4
- [Full Changelog](https://github.com/chef/inspec/compare/v1.0.0.beta3...1.0.0)
3
+ ## [1.1.0](https://github.com/chef/inspec/tree/1.1.0) (2016-10-05)
4
+ [Full Changelog](https://github.com/chef/inspec/compare/v1.0.0...1.1.0)
5
+
6
+ **Fixed bugs:**
7
+
8
+ - InSpec in Visibility [\#1117](https://github.com/chef/inspec/issues/1117)
9
+ - inspec exec on tar.gz with local library requirements doesn't work [\#779](https://github.com/chef/inspec/issues/779)
10
+ - parse\_config\_file fails when it encounters a '\[' [\#687](https://github.com/chef/inspec/issues/687)
11
+ - use mock backend for inspec vendor/check/json [\#1202](https://github.com/chef/inspec/pull/1202) ([arlimus](https://github.com/arlimus))
12
+ - bugfix: support nil entries in filter table [\#1201](https://github.com/chef/inspec/pull/1201) ([arlimus](https://github.com/arlimus))
13
+ - bugfix: always use the mock backend for inspec archive [\#1200](https://github.com/chef/inspec/pull/1200) ([arlimus](https://github.com/arlimus))
14
+ - Missing registry keys should not exist [\#1199](https://github.com/chef/inspec/pull/1199) ([alexpop](https://github.com/alexpop))
15
+ - bugfix: use correct logger in cli [\#1198](https://github.com/chef/inspec/pull/1198) ([arlimus](https://github.com/arlimus))
16
+
17
+ **Closed issues:**
18
+
19
+ - registry\_key ignores failed Get-Item, always "exists" [\#1196](https://github.com/chef/inspec/issues/1196)
20
+ - www: Online tutorial doesn't load \(not building\) [\#1182](https://github.com/chef/inspec/issues/1182)
21
+ - Issue locally running an inspec check on a service resource [\#1176](https://github.com/chef/inspec/issues/1176)
22
+ - Demo at `http://inspec.io/` stuck on `Loading` [\#1165](https://github.com/chef/inspec/issues/1165)
23
+ - Confusing reporter output with inherited profiles [\#1071](https://github.com/chef/inspec/issues/1071)
24
+ - Provide clear error message if dependency is not available [\#1069](https://github.com/chef/inspec/issues/1069)
25
+ - Dependencies: Design UX for scoping of attributes and resources [\#1057](https://github.com/chef/inspec/issues/1057)
26
+ - RFC Dependencies [\#888](https://github.com/chef/inspec/issues/888)
27
+
28
+ **Merged pull requests:**
29
+
30
+ - Remove pre-1.0 warning from meta-profile [\#1194](https://github.com/chef/inspec/pull/1194) ([chris-rock](https://github.com/chris-rock))
31
+ - Add shell options [\#1192](https://github.com/chef/inspec/pull/1192) ([jonathanmorley](https://github.com/jonathanmorley))
32
+ - Website: Fix buggy behavior in nav and add global message [\#1190](https://github.com/chef/inspec/pull/1190) ([magwalk](https://github.com/magwalk))
33
+ - add example for yumconf-like structured files [\#1185](https://github.com/chef/inspec/pull/1185) ([vjeffrey](https://github.com/vjeffrey))
34
+ - add sanity checks and fail build process if requirements aren't met [\#1183](https://github.com/chef/inspec/pull/1183) ([arlimus](https://github.com/arlimus))
35
+ - tp/learn links [\#1181](https://github.com/chef/inspec/pull/1181) ([tpetchel](https://github.com/tpetchel))
36
+ - include control section in instructions [\#1180](https://github.com/chef/inspec/pull/1180) ([vjeffrey](https://github.com/vjeffrey))
37
+ - Changing headings to align with SEO best practices [\#1179](https://github.com/chef/inspec/pull/1179) ([davidwrede](https://github.com/davidwrede))
38
+ - move inquirer to deploy [\#1178](https://github.com/chef/inspec/pull/1178) ([vjeffrey](https://github.com/vjeffrey))
39
+ - Ignore lockfiles in example profiles [\#1177](https://github.com/chef/inspec/pull/1177) ([stevendanna](https://github.com/stevendanna))
40
+ - Remove default parameter in `updateInstructions\(\)` [\#1175](https://github.com/chef/inspec/pull/1175) ([jerryaldrichiii](https://github.com/jerryaldrichiii))
41
+ - Website: Fix docs nav functionality and optimize for mobile [\#1174](https://github.com/chef/inspec/pull/1174) ([magwalk](https://github.com/magwalk))
42
+ - Adds segment [\#1172](https://github.com/chef/inspec/pull/1172) ([cwebberOps](https://github.com/cwebberOps))
43
+ - print profile info before test results \(inherited profiles\) [\#1170](https://github.com/chef/inspec/pull/1170) ([vjeffrey](https://github.com/vjeffrey))
44
+ - www: fix wording [\#1168](https://github.com/chef/inspec/pull/1168) ([arlimus](https://github.com/arlimus))
45
+ - Update dependency documentation and mention the lockfile [\#1167](https://github.com/chef/inspec/pull/1167) ([alexpop](https://github.com/alexpop))
46
+
47
+ ## [v1.0.0](https://github.com/chef/inspec/tree/v1.0.0) (2016-09-26)
48
+ [Full Changelog](https://github.com/chef/inspec/compare/v1.0.0.beta3...v1.0.0)
5
49
 
6
50
  **Implemented enhancements:**
7
51
 
@@ -89,7 +133,6 @@
89
133
  - InSpec in Workflow [\#1115](https://github.com/chef/inspec/issues/1115)
90
134
  - uninstalled package shows as installed [\#1092](https://github.com/chef/inspec/issues/1092)
91
135
  - undefined method `send\_request' for Compliance::API:Class [\#1088](https://github.com/chef/inspec/issues/1088)
92
- - safari inspec online demo bug! [\#1086](https://github.com/chef/inspec/issues/1086)
93
136
  - \[package\] Regression on Windows 2008R2 [\#998](https://github.com/chef/inspec/issues/998)
94
137
  - \[script\] Is there a limit on the number of char's within a script block [\#539](https://github.com/chef/inspec/issues/539)
95
138
  - Use parenthesis when passing regular expressions [\#1106](https://github.com/chef/inspec/pull/1106) ([alexpop](https://github.com/alexpop))
data/Gemfile CHANGED
@@ -25,7 +25,6 @@ group :test do
25
25
  gem 'concurrent-ruby', '~> 0.9'
26
26
  gem 'mocha', '~> 1.1'
27
27
  gem 'ruby-progressbar', '~> 1.8'
28
- gem 'inquirer'
29
28
  gem 'nokogiri', '~> 1.6'
30
29
  end
31
30
 
@@ -60,3 +59,7 @@ group :maintenance do
60
59
  gem 'octokit'
61
60
  gem 'netrc'
62
61
  end
62
+
63
+ group :deploy do
64
+ gem 'inquirer'
65
+ end
data/README.md CHANGED
@@ -210,6 +210,9 @@ inspec exec test.rb -t docker://container_id
210
210
 
211
211
  # run with sudo
212
212
  inspec exec test.rb --sudo [--sudo-password ...] [--sudo-options ...] [--sudo_command ...]
213
+
214
+ # run in a subshell
215
+ inspec exec test.rb --shell [--shell-options ...] [--shell-command ...]
213
216
  ```
214
217
 
215
218
  ### detect
@@ -74,7 +74,7 @@ The following examples show simple compliance tests using a single `control` blo
74
74
 
75
75
  ## Test System Event Log
76
76
 
77
- The following test shows how to audit machines running Windows 2012 R2 that pwassword complexity is enabled:
77
+ The following test shows how to audit machines running Windows 2012 R2 that password complexity is enabled:
78
78
 
79
79
  ```ruby
80
80
  control 'windows-account-102' do
@@ -89,7 +89,7 @@ end
89
89
 
90
90
  ## Are PosgtreSQL passwords empty?
91
91
 
92
- The following test shows how to audit machines running PostgerSQL to ensure that passwords are not empty.
92
+ The following test shows how to audit machines running PostgreSQL to ensure that passwords are not empty.
93
93
 
94
94
  ```ruby
95
95
  control 'postgres-7' do
@@ -173,7 +173,7 @@ end
173
173
 
174
174
  ## Test Windows Registry Keys
175
175
 
176
- The following test shows how to audit machines to ensure Safe DLL Seach Mode is enabled:
176
+ The following test shows how to audit machines to ensure Safe DLL Search Mode is enabled:
177
177
 
178
178
  ```ruby
179
179
  control 'windows-base-101' do
@@ -109,6 +109,11 @@ and to target all of these examples in a single `inspec.yml` file:
109
109
 
110
110
  # Profile Dependencies
111
111
 
112
+ A profile dependency is needed when:
113
+
114
+ * using `include_controls` or `require_controls` in order to load controls defined in another profile
115
+ * using a custom InSpec resource defined in another profile
116
+
112
117
  Use the `depends` setting in the `inspec.yml` file to specify one (or more) profiles on which this profile depends. A profile dependency may be sourced from a path, URL, a git repo, a cookbook located on Chef Supermarket or on GitHub, or a profile located on the Chef Compliance server.
113
118
 
114
119
  ## Path
@@ -193,19 +198,31 @@ Use the `depends` setting in the `inspec.yml` file to define any combination of
193
198
  depends:
194
199
  - name: ssh-hardening
195
200
  supermarket: hardening/ssh-hardening
201
+ version: '= 2.0.0'
196
202
  - name: os-hardening
197
203
  url: https://github.com/dev-sec/tests-os-hardening/archive/master.zip
198
204
  - name: ssl-benchmark
199
205
  git: https://github.com/dev-sec/ssl-benchmark.git
206
+ version: '< 2.0'
200
207
  - name: windows-patch-benchmark
201
208
  git: https://github.com/chris-rock/windows-patch-benchmark.git
209
+ version: '~> 0.6'
202
210
  - name: linux
203
211
  compliance: base/linux
204
212
 
213
+ ## Vendoring Dependencies
214
+
215
+ When you execute a local profile, the `inspec.yml` file will be read in order to source any profile dependencies. It will then cache the dependencies locally and generate an `inspec.lock` file. If you add or update dependencies in `inspec.yml`, please refresh the lock file by either:
216
+
217
+ * running `inspec vendor` inside the profile directory; or
218
+ * deleting `inspec.lock` before running `inspec exec`
219
+
205
220
  # Profile Inheritance
206
221
 
207
222
  When a profile is run, it may include controls that are defined in other profiles. Controls may also be required.
208
223
 
224
+ This requires an `inspec.yml` dependency to the profile you inherit from.
225
+
209
226
  ## include_controls
210
227
 
211
228
  The `include_controls` keyword may be used in a profile to import all rules from the named profile.
@@ -6,7 +6,7 @@ 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
- # Syntax
9
+ ## Syntax
10
10
 
11
11
  An `apache_conf` InSpec audit resource block declares configuration settings that should be tested:
12
12
 
@@ -20,7 +20,7 @@ where
20
20
  * `('path')` is the non-default path to the Apache configuration file
21
21
  * `{ should eq 'value' }` is the value that is expected
22
22
 
23
- # Matchers
23
+ ## Matchers
24
24
 
25
25
  This InSpec audit resource matches any service that is listed in the Apache configuration file:
26
26
 
@@ -38,37 +38,37 @@ For example:
38
38
  end
39
39
 
40
40
 
41
- ## be
41
+ ### be
42
42
 
43
43
  <%= partial "/shared/matcher_be" %>
44
44
 
45
- ## cmp
45
+ ### cmp
46
46
 
47
47
  <%= partial "/shared/matcher_cmp" %>
48
48
 
49
- ## eq
49
+ ### eq
50
50
 
51
51
  <%= partial "/shared/matcher_eq" %>
52
52
 
53
- ## include
53
+ ### include
54
54
 
55
55
  <%= partial "/shared/matcher_include" %>
56
56
 
57
- ## match
57
+ ### match
58
58
 
59
59
  <%= partial "/shared/matcher_match" %>
60
60
 
61
- # Examples
61
+ ## Examples
62
62
 
63
63
  The following examples show how to use this InSpec audit resource.
64
64
 
65
- ## Test for blocking .htaccess files on CentOS
65
+ ### Test for blocking .htaccess files on CentOS
66
66
 
67
67
  describe apache_conf do
68
68
  its('AllowOverride') { should eq 'None' }
69
69
  end
70
70
 
71
- ## Test ports for SSL
71
+ ### Test ports for SSL
72
72
 
73
73
  describe apache_conf do
74
74
  its('Listen') { should eq '443'}
@@ -6,7 +6,7 @@ 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
- # Syntax
9
+ ## Syntax
10
10
 
11
11
  An `apt` resource block tests the contents of Apt and PPA repositories:
12
12
 
@@ -22,61 +22,61 @@ where
22
22
  * `exist` and `be_enabled` are a valid matchers for this resource
23
23
 
24
24
 
25
- # Matchers
25
+ ## Matchers
26
26
 
27
27
  This InSpec audit resource has the following matchers:
28
28
 
29
- ## be
29
+ ### be
30
30
 
31
31
  <%= partial "/shared/matcher_be" %>
32
32
 
33
- ## be_enabled
33
+ ### be_enabled
34
34
 
35
35
  The `be_enabled` matcher tests if a package exists in the repository:
36
36
 
37
37
  it { should be_enabled }
38
38
 
39
- ## cmp
39
+ ### cmp
40
40
 
41
41
  <%= partial "/shared/matcher_cmp" %>
42
42
 
43
- ## eq
43
+ ### eq
44
44
 
45
45
  <%= partial "/shared/matcher_eq" %>
46
46
 
47
- ## exist
47
+ ### exist
48
48
 
49
49
  The `exist` matcher tests if a package exists on the system:
50
50
 
51
51
  it { should exist }
52
52
 
53
- ## include
53
+ ### include
54
54
 
55
55
  <%= partial "/shared/matcher_include" %>
56
56
 
57
- ## match
57
+ ### match
58
58
 
59
59
  <%= partial "/shared/matcher_match" %>
60
60
 
61
- # Examples
61
+ ## Examples
62
62
 
63
63
  The following examples show how to use this InSpec audit resource.
64
64
 
65
- ## Test if apt repository exists and is enabled
65
+ ### Test if apt repository exists and is enabled
66
66
 
67
67
  describe apt('http://ppa.launchpad.net/juju/stable/ubuntu') do
68
68
  it { should exist }
69
69
  it { should be_enabled }
70
70
  end
71
71
 
72
- ## Verify that a PPA repository exists and is enabled
72
+ ### Verify that a PPA repository exists and is enabled
73
73
 
74
74
  describe apt('ppa:nginx/stable') do
75
75
  it { should exist }
76
76
  it { should be_enabled }
77
77
  end
78
78
 
79
- ## Verify that a repository is not present
79
+ ### Verify that a repository is not present
80
80
 
81
81
  describe apt('ubuntu-wine/ppa') do
82
82
  it { should_not exist }
@@ -6,7 +6,7 @@ title: About the audit_policy Resource
6
6
 
7
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 that is enabled, the auditing level may be set to `No Auditing`, `Not Specified`, `Success`, `Success and Failure`, or `Failure`.
8
8
 
9
- # Syntax
9
+ ## Syntax
10
10
 
11
11
  An `audit_policy` resource block declares a parameter that belongs to an audit policy category or subcategory:
12
12
 
@@ -20,41 +20,41 @@ where
20
20
  * `'value'` must be one of `No Auditing`, `Not Specified`, `Success`, `Success and Failure`, or `Failure`
21
21
 
22
22
 
23
- # Matchers
23
+ ## Matchers
24
24
 
25
25
  This InSpec audit resource has the following matchers:
26
26
 
27
- ## be
27
+ ### be
28
28
 
29
29
  <%= partial "/shared/matcher_be" %>
30
30
 
31
- ## cmp
31
+ ### cmp
32
32
 
33
33
  <%= partial "/shared/matcher_cmp" %>
34
34
 
35
- ## eq
35
+ ### eq
36
36
 
37
37
  <%= partial "/shared/matcher_eq" %>
38
38
 
39
- ## include
39
+ ### include
40
40
 
41
41
  <%= partial "/shared/matcher_include" %>
42
42
 
43
- ## match
43
+ ### match
44
44
 
45
45
  <%= partial "/shared/matcher_match" %>
46
46
 
47
- # Examples
47
+ ## Examples
48
48
 
49
49
  The following examples show how to use this InSpec audit resource.
50
50
 
51
- ## Test that a parameter is not set to "No Auditing"
51
+ ### Test that a parameter is not set to "No Auditing"
52
52
 
53
53
  describe audit_policy do
54
54
  its('Other Account Logon Events') { should_not eq 'No Auditing' }
55
55
  end
56
56
 
57
- ## Test that a parameter is set to "Success"
57
+ ### Test that a parameter is set to "Success"
58
58
 
59
59
  describe audit_policy do
60
60
  its('User Account Management') { should eq 'Success' }
@@ -6,7 +6,7 @@ title: About the auditd_conf Resource
6
6
 
7
7
  Use the `auditd_conf` InSpec audit resource to test the configuration settings for the audit daemon. This file is typically located under `/etc/audit/auditd.conf'` on Unix and Linux platforms.
8
8
 
9
- # Syntax
9
+ ## Syntax
10
10
 
11
11
  A `auditd_conf` resource block declares configuration settings that should be tested:
12
12
 
@@ -21,27 +21,27 @@ where
21
21
  * `{ should cmp 'value' }` is the value that is expected
22
22
 
23
23
 
24
- # Matchers
24
+ ## Matchers
25
25
 
26
26
  This InSpec audit resource has the following matchers:
27
27
 
28
- ## be
28
+ ### be
29
29
 
30
30
  <%= partial "/shared/matcher_be" %>
31
31
 
32
- ## cmp
32
+ ### cmp
33
33
 
34
34
  <%= partial "/shared/matcher_cmp" %>
35
35
 
36
- ## eq
36
+ ### eq
37
37
 
38
38
  <%= partial "/shared/matcher_eq" %>
39
39
 
40
- ## include
40
+ ### include
41
41
 
42
42
  <%= partial "/shared/matcher_include" %>
43
43
 
44
- ## keyword
44
+ ### keyword
45
45
 
46
46
  This matcher will matche any keyword that is listed in the `auditd.conf` configuration file. Option names and values are case-insensitive:
47
47
 
@@ -51,15 +51,15 @@ or:
51
51
 
52
52
  its('max_log_file') { should cmp 6 }
53
53
 
54
- ## match
54
+ ### match
55
55
 
56
56
  <%= partial "/shared/matcher_match" %>
57
57
 
58
- # Examples
58
+ ## Examples
59
59
 
60
60
  The following examples show how to use this InSpec audit resource.
61
61
 
62
- ## Test the auditd.conf file
62
+ ### Test the auditd.conf file
63
63
 
64
64
  describe auditd_conf do
65
65
  its('log_file') { should cmp '/full/path/to/file' }
@@ -7,7 +7,7 @@ title: About the auditd_rules Resource
7
7
  Use the `auditd_rules` InSpec audit resource to test the rules for logging that exist on the system. The `audit.rules` file is typically located under `/etc/audit/` and contains the list of rules that define what is captured in log files. This resource uses `auditctl` to query the run-time `auditd` rules setup, which may be different from `audit.rules`.
8
8
 
9
9
 
10
- # Syntax
10
+ ## Syntax
11
11
 
12
12
  An `auditd_rules` resource block declares one (or more) rules to be tested, and then what that rule should do. The syntax depends on the version of `audit`:
13
13
 
@@ -62,35 +62,35 @@ or test that individual rules are defined:
62
62
  where each test must declare one (or more) rules to be tested.
63
63
 
64
64
 
65
- # Matchers
65
+ ## Matchers
66
66
 
67
67
  This InSpec audit resource has the following matchers:
68
68
 
69
- ## be
69
+ ### be
70
70
 
71
71
  <%= partial "/shared/matcher_be" %>
72
72
 
73
- ## cmp
73
+ ### cmp
74
74
 
75
75
  <%= partial "/shared/matcher_cmp" %>
76
76
 
77
- ## eq
77
+ ### eq
78
78
 
79
79
  <%= partial "/shared/matcher_eq" %>
80
80
 
81
- ## include
81
+ ### include
82
82
 
83
83
  <%= partial "/shared/matcher_include" %>
84
84
 
85
- ## match
85
+ ### match
86
86
 
87
87
  <%= partial "/shared/matcher_match" %>
88
88
 
89
- # Examples
89
+ ## Examples
90
90
 
91
91
  The following examples show how to use this InSpec audit resource.
92
92
 
93
- ## Test if a rule contains a matching element that is identified by a regular expression
93
+ ### Test if a rule contains a matching element that is identified by a regular expression
94
94
 
95
95
  For `audit` >= 2.3:
96
96
 
@@ -109,13 +109,13 @@ For `audit` < 2.3:
109
109
  end
110
110
 
111
111
 
112
- ## Query the audit daemon status
112
+ ### Query the audit daemon status
113
113
 
114
114
  describe auditd_rules.status('backlog') do
115
115
  it { should cmp 0 }
116
116
  end
117
117
 
118
- ## Query properties of rules targeting specific syscalls or files
118
+ ### Query properties of rules targeting specific syscalls or files
119
119
 
120
120
  describe auditd_rules.syscall('open').action do
121
121
  it { should eq(['always']) }