inspec 1.31.0 → 1.45.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop.yml +3 -0
- data/CHANGELOG.md +2599 -1
- data/Gemfile +0 -1
- data/README.md +24 -34
- data/Rakefile +0 -31
- data/docs/dsl_inspec.md +10 -0
- data/docs/matchers.md +29 -0
- data/docs/plugin_kitchen_inspec.md +18 -24
- data/docs/profiles.md +101 -81
- data/docs/resources/aide_conf.md.erb +71 -0
- 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 +78 -0
- 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/cpan.md.erb +62 -0
- data/docs/resources/cran.md.erb +54 -0
- 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 +61 -58
- data/docs/resources/docker_container.md.erb +23 -19
- data/docs/resources/docker_image.md.erb +20 -16
- data/docs/resources/elasticsearch.md.erb +245 -0
- data/docs/resources/etc_fstab.md.erb +120 -0
- data/docs/resources/etc_group.md.erb +29 -45
- data/docs/resources/etc_hosts.md.erb +68 -0
- data/docs/resources/etc_hosts_allow.md.erb +68 -0
- data/docs/resources/etc_hosts_deny.md.erb +68 -0
- data/docs/resources/file.md.erb +227 -216
- data/docs/resources/firewalld.md.erb +104 -0
- 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 +28 -32
- data/docs/resources/mysql_session.md.erb +15 -29
- data/docs/resources/nginx.md.erb +78 -0
- data/docs/resources/nginx_conf.md.erb +127 -0
- 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 +23 -44
- data/docs/resources/package.md.erb +34 -36
- data/docs/resources/parse_config.md.erb +5 -25
- data/docs/resources/parse_config_file.md.erb +31 -43
- data/docs/resources/{etc_passwd.md.erb → 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/{etc_shadow.md.erb → shadow.md.erb} +41 -47
- 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 +50 -0
- 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 +61 -0
- 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/docs/ruby_usage.md +0 -1
- data/examples/meta-profile/README.md +1 -1
- data/examples/profile-sensitive/README.md +29 -0
- data/examples/profile-sensitive/controls/sensitive-failures.rb +9 -0
- data/examples/profile-sensitive/controls/sensitive.rb +9 -0
- data/examples/profile-sensitive/inspec.yml +8 -0
- data/inspec.gemspec +3 -3
- data/lib/bundles/inspec-artifact/cli.rb +5 -5
- data/lib/bundles/inspec-compliance/README.md +24 -22
- data/lib/bundles/inspec-compliance/api/login.rb +152 -0
- data/lib/bundles/inspec-compliance/api.rb +46 -16
- data/lib/bundles/inspec-compliance/cli.rb +58 -165
- data/lib/bundles/inspec-compliance/target.rb +2 -3
- data/lib/bundles/inspec-habitat/cli.rb +7 -2
- data/lib/bundles/inspec-habitat/profile.rb +44 -20
- data/lib/bundles/inspec-init/templates/profile/README.md +1 -1
- data/lib/bundles/inspec-init/templates/profile/controls/example.rb +1 -1
- data/lib/bundles/inspec-supermarket/api.rb +1 -1
- data/lib/inspec/backend.rb +8 -0
- data/lib/inspec/cli.rb +1 -1
- data/lib/inspec/control_eval_context.rb +16 -6
- data/lib/inspec/dependencies/requirement.rb +22 -8
- data/lib/inspec/dependencies/resolver.rb +1 -1
- data/lib/inspec/exceptions.rb +4 -0
- data/lib/inspec/file_provider.rb +38 -9
- data/lib/inspec/metadata.rb +17 -3
- data/lib/inspec/objects/attribute.rb +16 -7
- data/lib/inspec/objects/control.rb +10 -2
- data/lib/inspec/plugins/resource.rb +34 -5
- data/lib/inspec/profile.rb +10 -1
- data/lib/inspec/profile_context.rb +3 -1
- data/lib/inspec/resource.rb +17 -5
- data/lib/inspec/rspec_json_formatter.rb +48 -14
- data/lib/inspec/rule.rb +4 -0
- data/lib/inspec/runner.rb +72 -30
- data/lib/inspec/shell.rb +24 -19
- data/lib/inspec/version.rb +1 -1
- data/lib/matchers/matchers.rb +40 -0
- data/lib/resources/aide_conf.rb +162 -0
- data/lib/resources/auditd.rb +231 -0
- data/lib/resources/auditd_rules.rb +3 -1
- data/lib/resources/command.rb +1 -1
- data/lib/resources/cpan.rb +60 -0
- data/lib/resources/cran.rb +66 -0
- data/lib/resources/docker.rb +8 -1
- data/lib/resources/docker_container.rb +19 -2
- data/lib/resources/elasticsearch.rb +172 -0
- data/lib/resources/etc_fstab.rb +102 -0
- data/lib/resources/etc_group.rb +1 -1
- data/lib/resources/etc_hosts.rb +81 -0
- data/lib/resources/etc_hosts_allow_deny.rb +122 -0
- data/lib/resources/file.rb +87 -10
- data/lib/resources/firewalld.rb +144 -0
- data/lib/resources/groups.rb +0 -1
- data/lib/resources/host.rb +30 -15
- data/lib/resources/http.rb +178 -22
- data/lib/resources/mssql_session.rb +3 -3
- data/lib/resources/mysql_conf.rb +10 -0
- data/lib/resources/mysql_session.rb +1 -1
- data/lib/resources/nginx.rb +97 -0
- data/lib/resources/nginx_conf.rb +134 -1
- data/lib/resources/oracledb_session.rb +9 -8
- data/lib/resources/os_env.rb +7 -4
- data/lib/resources/package.rb +14 -2
- data/lib/resources/packages.rb +1 -1
- data/lib/resources/pip.rb +28 -20
- data/lib/resources/port.rb +251 -3
- data/lib/resources/postgres.rb +1 -1
- data/lib/resources/postgres_session.rb +1 -1
- data/lib/resources/processes.rb +106 -20
- data/lib/resources/registry_key.rb +11 -2
- data/lib/resources/service.rb +5 -24
- data/lib/resources/ssh_conf.rb +1 -1
- data/lib/resources/ssl.rb +4 -3
- data/lib/resources/toml.rb +2 -2
- data/lib/resources/windows_hotfix.rb +35 -0
- data/lib/resources/xinetd.rb +4 -6
- data/lib/resources/xml.rb +27 -0
- data/lib/source_readers/inspec.rb +3 -3
- data/lib/utils/find_files.rb +2 -1
- data/lib/utils/nginx_parser.rb +10 -1
- data/lib/utils/object_traversal.rb +35 -10
- data/lib/utils/parser.rb +21 -3
- metadata +48 -18
- data/docs/cli.md +0 -392
|
@@ -6,6 +6,8 @@ title: About the iptables Resource
|
|
|
6
6
|
|
|
7
7
|
Use the `iptables` InSpec audit resource to test rules that are defined in `iptables`, which maintains tables of IP packet filtering rules. There may be more than one table. Each table contains one (or more) chains (both built-in and custom). A chain is a list of rules that match packets. When the rule matches, the rule defines what target to assign to the packet.
|
|
8
8
|
|
|
9
|
+
<br>
|
|
10
|
+
|
|
9
11
|
## Syntax
|
|
10
12
|
|
|
11
13
|
A `iptables` resource block declares tests for rules in IP tables:
|
|
@@ -22,35 +24,7 @@ where
|
|
|
22
24
|
* `chain: 'name'` is the name of a user-defined chain or one of `ACCEPT`, `DROP`, `QUEUE`, or `RETURN`
|
|
23
25
|
* `have_rule('RULE')` tests that rule in the iptables list. This must match the entire line taken from `iptables -S CHAIN`.
|
|
24
26
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
This InSpec audit resource has the following matchers:
|
|
28
|
-
|
|
29
|
-
### be
|
|
30
|
-
|
|
31
|
-
<%= partial "/shared/matcher_be" %>
|
|
32
|
-
|
|
33
|
-
### cmp
|
|
34
|
-
|
|
35
|
-
<%= partial "/shared/matcher_cmp" %>
|
|
36
|
-
|
|
37
|
-
### eq
|
|
38
|
-
|
|
39
|
-
<%= partial "/shared/matcher_eq" %>
|
|
40
|
-
|
|
41
|
-
### have_rule
|
|
42
|
-
|
|
43
|
-
The `have_rule` matcher tests the named rule against the information in the `iptables` file:
|
|
44
|
-
|
|
45
|
-
it { should have_rule('RULE') }
|
|
46
|
-
|
|
47
|
-
### include
|
|
48
|
-
|
|
49
|
-
<%= partial "/shared/matcher_include" %>
|
|
50
|
-
|
|
51
|
-
### match
|
|
52
|
-
|
|
53
|
-
<%= partial "/shared/matcher_match" %>
|
|
27
|
+
<br>
|
|
54
28
|
|
|
55
29
|
## Examples
|
|
56
30
|
|
|
@@ -75,3 +49,15 @@ The following examples show how to use this InSpec audit resource.
|
|
|
75
49
|
end
|
|
76
50
|
|
|
77
51
|
Note that the rule specification must exactly match what's in the output of `iptables -S INPUT`, which will depend on how you've built your rules.
|
|
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
|
+
### have_rule
|
|
60
|
+
|
|
61
|
+
The `have_rule` matcher tests the named rule against the information in the `iptables` file:
|
|
62
|
+
|
|
63
|
+
it { should have_rule('RULE') }
|
data/docs/resources/json.md.erb
CHANGED
|
@@ -6,6 +6,8 @@ title: About the json Resource
|
|
|
6
6
|
|
|
7
7
|
Use the `json` InSpec audit resource to test data in a JSON file.
|
|
8
8
|
|
|
9
|
+
<br>
|
|
10
|
+
|
|
9
11
|
## Syntax
|
|
10
12
|
|
|
11
13
|
A `json` resource block declares the data to be tested. Assume the following JSON file:
|
|
@@ -34,43 +36,26 @@ where
|
|
|
34
36
|
* `name` is a configuration setting in a JSON file
|
|
35
37
|
* `should eq 'foo'` tests a value of `name` as read from a JSON file versus the value declared in the test
|
|
36
38
|
|
|
39
|
+
<br>
|
|
37
40
|
|
|
38
|
-
##
|
|
39
|
-
|
|
40
|
-
This InSpec audit resource has the following matchers:
|
|
41
|
-
|
|
42
|
-
### be
|
|
43
|
-
|
|
44
|
-
<%= partial "/shared/matcher_be" %>
|
|
45
|
-
|
|
46
|
-
### cmp
|
|
47
|
-
|
|
48
|
-
<%= partial "/shared/matcher_cmp" %>
|
|
41
|
+
## Examples
|
|
49
42
|
|
|
50
|
-
|
|
43
|
+
The following examples show how to use this InSpec audit resource.
|
|
51
44
|
|
|
52
|
-
|
|
45
|
+
### Test a cookbook version in a policyfile.lock.json file
|
|
53
46
|
|
|
54
|
-
|
|
47
|
+
describe json('policyfile.lock.json') do
|
|
48
|
+
its(['cookbook_locks', 'omnibus', 'version']) { should eq('2.2.0') }
|
|
49
|
+
end
|
|
55
50
|
|
|
56
|
-
|
|
51
|
+
<br>
|
|
57
52
|
|
|
58
|
-
|
|
53
|
+
## Matchers
|
|
59
54
|
|
|
60
|
-
|
|
55
|
+
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/).
|
|
61
56
|
|
|
62
57
|
### name
|
|
63
58
|
|
|
64
59
|
The `name` matcher tests the value of `name` as read from a JSON file versus the value declared in the test:
|
|
65
60
|
|
|
66
61
|
its('name') { should eq 'foo' }
|
|
67
|
-
|
|
68
|
-
## Examples
|
|
69
|
-
|
|
70
|
-
The following examples show how to use this InSpec audit resource.
|
|
71
|
-
|
|
72
|
-
### Test a cookbook version in a policyfile.lock.json file
|
|
73
|
-
|
|
74
|
-
describe json('policyfile.lock.json') do
|
|
75
|
-
its(['cookbook_locks', 'omnibus', 'version']) { should eq('2.2.0') }
|
|
76
|
-
end
|
|
@@ -12,6 +12,8 @@ The `kernel_module` resource can also verify if a kernel module is `blacklisted`
|
|
|
12
12
|
or if a module is disabled via a fake install using the `bin_true` or `bin_false`
|
|
13
13
|
method.
|
|
14
14
|
|
|
15
|
+
<br>
|
|
16
|
+
|
|
15
17
|
## Syntax
|
|
16
18
|
|
|
17
19
|
A `kernel_module` resource block declares a module name, and then tests if that
|
|
@@ -32,90 +34,74 @@ where
|
|
|
32
34
|
* `{ should be_blacklisted }` tests if the module is blacklisted or if the module is disabled via a fake install using /bin/false or /bin/true
|
|
33
35
|
* `{ should be_disabled }` tests if the module is disabled via a fake install using /bin/false or /bin/true
|
|
34
36
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
This InSpec audit resource has the following matchers:
|
|
37
|
+
<br>
|
|
38
38
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
<%= partial "/shared/matcher_be" %>
|
|
39
|
+
## Examples
|
|
42
40
|
|
|
43
|
-
|
|
41
|
+
The following examples show how to use this InSpec audit resource.
|
|
44
42
|
|
|
45
|
-
|
|
43
|
+
### Test a modules 'version'
|
|
46
44
|
|
|
45
|
+
describe kernel_module('bridge') do
|
|
47
46
|
it { should be_loaded }
|
|
47
|
+
its(:version) { should cmp >= '2.2.2' }
|
|
48
|
+
end
|
|
48
49
|
|
|
49
|
-
###
|
|
50
|
-
|
|
51
|
-
<%= partial "/shared/matcher_cmp" %>
|
|
52
|
-
|
|
53
|
-
### eq
|
|
54
|
-
|
|
55
|
-
<%= partial "/shared/matcher_eq" %>
|
|
50
|
+
### Test if a module is loaded, not disabled and not blacklisted
|
|
56
51
|
|
|
57
|
-
|
|
52
|
+
describe kernel_module('video') do
|
|
53
|
+
it { should be_loaded }
|
|
54
|
+
it { should_not be_disabled }
|
|
55
|
+
it { should_not be_blacklisted }
|
|
56
|
+
end
|
|
58
57
|
|
|
59
|
-
|
|
58
|
+
### Check if a module is blacklisted
|
|
60
59
|
|
|
61
|
-
|
|
60
|
+
describe kernel_module('floppy') do
|
|
61
|
+
it { should be_blacklisted }
|
|
62
|
+
end
|
|
62
63
|
|
|
63
|
-
|
|
64
|
+
### Ensure a module is *not* blacklisted and it is loaded
|
|
64
65
|
|
|
65
|
-
|
|
66
|
+
describe kernel_module('video') do
|
|
67
|
+
it { should_not be_blacklisted }
|
|
68
|
+
it { should be_loaded }
|
|
69
|
+
end
|
|
66
70
|
|
|
67
|
-
|
|
71
|
+
### Ensure a module is disabled via 'bin_false'
|
|
68
72
|
|
|
69
|
-
|
|
73
|
+
describe kernel_module('sstfb') do
|
|
74
|
+
it { should_not be_loaded }
|
|
75
|
+
it { should be_disabled }
|
|
76
|
+
end
|
|
70
77
|
|
|
71
|
-
|
|
78
|
+
### Ensure a module is 'blacklisted'/'disabled' via 'bin_true'
|
|
72
79
|
|
|
73
|
-
|
|
80
|
+
describe kernel_module('nvidiafb') do
|
|
81
|
+
it { should_not be_loaded }
|
|
82
|
+
it { should be_blacklisted }
|
|
83
|
+
end
|
|
74
84
|
|
|
75
|
-
|
|
85
|
+
### Ensure a module is not loaded
|
|
76
86
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
end
|
|
87
|
+
describe kernel_module('dhcp') do
|
|
88
|
+
it { should_not be_loaded }
|
|
89
|
+
end
|
|
81
90
|
|
|
82
|
-
|
|
91
|
+
<br>
|
|
83
92
|
|
|
84
|
-
|
|
85
|
-
it { should be_loaded }
|
|
86
|
-
it { should_not be_disabled }
|
|
87
|
-
it { should_not be_blacklisted }
|
|
88
|
-
end
|
|
89
|
-
|
|
90
|
-
### Check if a module is blacklisted
|
|
91
|
-
|
|
92
|
-
describe kernel_module('floppy') do
|
|
93
|
-
it { should be_blacklisted }
|
|
94
|
-
end
|
|
95
|
-
|
|
96
|
-
### Ensure a module is *not* blacklisted and it is loaded
|
|
93
|
+
## Matchers
|
|
97
94
|
|
|
98
|
-
|
|
99
|
-
it { should_not be_blacklisted }
|
|
100
|
-
it { should be_loaded }
|
|
101
|
-
end
|
|
95
|
+
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/).
|
|
102
96
|
|
|
103
|
-
|
|
97
|
+
### be_loaded
|
|
104
98
|
|
|
105
|
-
|
|
106
|
-
it { should_not be_loaded }
|
|
107
|
-
it { should be_disabled }
|
|
108
|
-
end
|
|
99
|
+
The `be_loaded` matcher tests if the module is a loadable kernel module:
|
|
109
100
|
|
|
110
|
-
|
|
101
|
+
it { should be_loaded }
|
|
111
102
|
|
|
112
|
-
|
|
113
|
-
it { should_not be_loaded }
|
|
114
|
-
it { should be_blacklisted }
|
|
115
|
-
end
|
|
103
|
+
### version
|
|
116
104
|
|
|
117
|
-
|
|
105
|
+
The `version` matcher tests if the named module version is on the system:
|
|
118
106
|
|
|
119
|
-
|
|
120
|
-
it { should_not be_loaded }
|
|
121
|
-
end
|
|
107
|
+
its(:version) { should eq '3.2.2' }
|
|
@@ -6,6 +6,8 @@ title: About the kernel_parameter Resource
|
|
|
6
6
|
|
|
7
7
|
Use the `kernel_parameter` InSpec audit resource to test kernel parameters on Linux platforms.
|
|
8
8
|
|
|
9
|
+
<br>
|
|
10
|
+
|
|
9
11
|
## Syntax
|
|
10
12
|
|
|
11
13
|
A `kernel_parameter` resource block declares a parameter and then a value to be tested:
|
|
@@ -19,35 +21,7 @@ where
|
|
|
19
21
|
* `'kernel.parameter'` must specify a kernel parameter, such as `'net.ipv4.conf.all.forwarding'`
|
|
20
22
|
* `{ should eq 0 }` states the value to be tested
|
|
21
23
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
This InSpec audit resource has the following matchers:
|
|
25
|
-
|
|
26
|
-
### be
|
|
27
|
-
|
|
28
|
-
<%= partial "/shared/matcher_be" %>
|
|
29
|
-
|
|
30
|
-
### cmp
|
|
31
|
-
|
|
32
|
-
<%= partial "/shared/matcher_cmp" %>
|
|
33
|
-
|
|
34
|
-
### eq
|
|
35
|
-
|
|
36
|
-
<%= partial "/shared/matcher_eq" %>
|
|
37
|
-
|
|
38
|
-
### include
|
|
39
|
-
|
|
40
|
-
<%= partial "/shared/matcher_include" %>
|
|
41
|
-
|
|
42
|
-
### match
|
|
43
|
-
|
|
44
|
-
<%= partial "/shared/matcher_match" %>
|
|
45
|
-
|
|
46
|
-
### value
|
|
47
|
-
|
|
48
|
-
The `value` matcher tests the value assigned to the named IP address versus the value declared in the test:
|
|
49
|
-
|
|
50
|
-
its('value') { should eq 0 }
|
|
24
|
+
<br>
|
|
51
25
|
|
|
52
26
|
## Examples
|
|
53
27
|
|
|
@@ -70,3 +44,15 @@ The following examples show how to use this InSpec audit resource.
|
|
|
70
44
|
describe kernel_parameter('net.ipv6.conf.interface.accept_redirects') do
|
|
71
45
|
its('value') { should eq 'true' }
|
|
72
46
|
end
|
|
47
|
+
|
|
48
|
+
<br>
|
|
49
|
+
|
|
50
|
+
## Matchers
|
|
51
|
+
|
|
52
|
+
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/).
|
|
53
|
+
|
|
54
|
+
### value
|
|
55
|
+
|
|
56
|
+
The `value` matcher tests the value assigned to the named IP address versus the value declared in the test:
|
|
57
|
+
|
|
58
|
+
its('value') { should eq 0 }
|
|
@@ -8,6 +8,7 @@ Use the `key_rsa` InSpec audit resource to test RSA public/private keypairs.
|
|
|
8
8
|
|
|
9
9
|
This resource is mainly useful when used in conjunction with the x509_certificate resource but it can also be used for checking SSH keys.
|
|
10
10
|
|
|
11
|
+
<br>
|
|
11
12
|
|
|
12
13
|
## Syntax
|
|
13
14
|
|
|
@@ -26,6 +27,8 @@ You can use an optional passphrase with `key_rsa`
|
|
|
26
27
|
it { should be_private }
|
|
27
28
|
end
|
|
28
29
|
|
|
30
|
+
<br>
|
|
31
|
+
|
|
29
32
|
## Supported Properties
|
|
30
33
|
|
|
31
34
|
### public?
|
|
@@ -6,6 +6,8 @@ title: About the launchd_service Resource
|
|
|
6
6
|
|
|
7
7
|
Use the ``launchd_service`` InSpec audit resource to test a service using Launchd.
|
|
8
8
|
|
|
9
|
+
<br>
|
|
10
|
+
|
|
9
11
|
## Syntax
|
|
10
12
|
|
|
11
13
|
A ``launchd_service`` resource block declares the name of a service and then one (or more) matchers to test the state of the service:
|
|
@@ -29,13 +31,11 @@ The path to the service manager's control may be specified for situations where
|
|
|
29
31
|
it { should be_running }
|
|
30
32
|
end
|
|
31
33
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
This InSpec audit resource has the following matchers:
|
|
34
|
+
<br>
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
## Matchers
|
|
37
37
|
|
|
38
|
-
|
|
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/).
|
|
39
39
|
|
|
40
40
|
### be_enabled
|
|
41
41
|
|
|
@@ -54,23 +54,3 @@ The `be_installed` matcher tests if the named service is installed:
|
|
|
54
54
|
The `be_running` matcher tests if the named service is running:
|
|
55
55
|
|
|
56
56
|
it { should be_running }
|
|
57
|
-
|
|
58
|
-
### cmp
|
|
59
|
-
|
|
60
|
-
<%= partial "/shared/matcher_cmp" %>
|
|
61
|
-
|
|
62
|
-
### eq
|
|
63
|
-
|
|
64
|
-
<%= partial "/shared/matcher_eq" %>
|
|
65
|
-
|
|
66
|
-
### include
|
|
67
|
-
|
|
68
|
-
<%= partial "/shared/matcher_include" %>
|
|
69
|
-
|
|
70
|
-
### match
|
|
71
|
-
|
|
72
|
-
<%= partial "/shared/matcher_match" %>
|
|
73
|
-
|
|
74
|
-
## Examples
|
|
75
|
-
|
|
76
|
-
None.
|
|
@@ -17,6 +17,8 @@ Entries in the `limits.conf` file are similar to:
|
|
|
17
17
|
^^^^^^^^^ ^^^^ ^^^^^^ ^^^^^
|
|
18
18
|
domain type item value
|
|
19
19
|
|
|
20
|
+
<br>
|
|
21
|
+
|
|
20
22
|
## Syntax
|
|
21
23
|
|
|
22
24
|
A `limits_conf` resource block declares a domain to be tested, along with associated type, item, and value:
|
|
@@ -34,17 +36,24 @@ where
|
|
|
34
36
|
* `'item'` is the item for which limits are defined, such as `core`, `nofile`, `stack`, `nproc`, `priority`, or `maxlogins`
|
|
35
37
|
* `'value'` is the value associated with the `item`
|
|
36
38
|
|
|
37
|
-
|
|
39
|
+
<br>
|
|
38
40
|
|
|
39
|
-
|
|
41
|
+
## Examples
|
|
40
42
|
|
|
41
|
-
|
|
43
|
+
The following examples show how to use this InSpec audit resource.
|
|
42
44
|
|
|
43
|
-
|
|
45
|
+
### Test limits
|
|
44
46
|
|
|
45
|
-
|
|
47
|
+
describe limits_conf('path') do
|
|
48
|
+
its('*') { should include ['soft', 'core', '0'], ['hard', 'rss', '10000'] }
|
|
49
|
+
its('ftp') { should eq ['hard', 'nproc', '0'] }
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
<br>
|
|
53
|
+
|
|
54
|
+
## Matchers
|
|
46
55
|
|
|
47
|
-
|
|
56
|
+
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/).
|
|
48
57
|
|
|
49
58
|
### domain
|
|
50
59
|
|
|
@@ -55,26 +64,3 @@ The `domain` matcher tests the domain in the `limits.conf` file, along with asso
|
|
|
55
64
|
For example:
|
|
56
65
|
|
|
57
66
|
its('grantmc') { should include ['hard', 'nofile', '63536'] }
|
|
58
|
-
|
|
59
|
-
### eq
|
|
60
|
-
|
|
61
|
-
<%= partial "/shared/matcher_eq" %>
|
|
62
|
-
|
|
63
|
-
### include
|
|
64
|
-
|
|
65
|
-
<%= partial "/shared/matcher_include" %>
|
|
66
|
-
|
|
67
|
-
### match
|
|
68
|
-
|
|
69
|
-
<%= partial "/shared/matcher_match" %>
|
|
70
|
-
|
|
71
|
-
## Examples
|
|
72
|
-
|
|
73
|
-
The following examples show how to use this InSpec audit resource.
|
|
74
|
-
|
|
75
|
-
### Test limits
|
|
76
|
-
|
|
77
|
-
describe limits_conf('path') do
|
|
78
|
-
its('*') { should include ['soft', 'core', '0'], ['hard', 'rss', '10000'] }
|
|
79
|
-
its('ftp') { should eq ['hard', 'nproc', '0'] }
|
|
80
|
-
end
|
|
@@ -6,6 +6,8 @@ title: About the login_defs Resource
|
|
|
6
6
|
|
|
7
7
|
Use the `login_defs` InSpec audit resource to test configuration settings in the `/etc/login.defs` file. The `logins.defs` file defines site-specific configuration for the shadow password suite on Linux and Unix platforms, such as password expiration ranges, minimum/maximum values for automatic selection of user and group identifiers, or the method with which passwords are encrypted.
|
|
8
8
|
|
|
9
|
+
<br>
|
|
10
|
+
|
|
9
11
|
## Syntax
|
|
10
12
|
|
|
11
13
|
A `login_defs` resource block declares the `login.defs` configuration data to be tested:
|
|
@@ -19,36 +21,7 @@ where
|
|
|
19
21
|
* `name` is a configuration setting in `login.defs`
|
|
20
22
|
* `{ should include('foo') }` tests the value of `name` as read from `login.defs` versus the value declared in the test
|
|
21
23
|
|
|
22
|
-
|
|
23
|
-
## Matchers
|
|
24
|
-
|
|
25
|
-
This InSpec audit resource has the following matchers:
|
|
26
|
-
|
|
27
|
-
### be
|
|
28
|
-
|
|
29
|
-
<%= partial "/shared/matcher_be" %>
|
|
30
|
-
|
|
31
|
-
### cmp
|
|
32
|
-
|
|
33
|
-
<%= partial "/shared/matcher_cmp" %>
|
|
34
|
-
|
|
35
|
-
### eq
|
|
36
|
-
|
|
37
|
-
<%= partial "/shared/matcher_eq" %>
|
|
38
|
-
|
|
39
|
-
### include
|
|
40
|
-
|
|
41
|
-
<%= partial "/shared/matcher_include" %>
|
|
42
|
-
|
|
43
|
-
### match
|
|
44
|
-
|
|
45
|
-
<%= partial "/shared/matcher_match" %>
|
|
46
|
-
|
|
47
|
-
### name
|
|
48
|
-
|
|
49
|
-
The `name` matcher tests the value of `name` as read from `login.defs` versus the value declared in the test:
|
|
50
|
-
|
|
51
|
-
its('name') { should eq 'foo' }
|
|
24
|
+
<br>
|
|
52
25
|
|
|
53
26
|
## Examples
|
|
54
27
|
|
|
@@ -75,3 +48,15 @@ The following examples show how to use this InSpec audit resource.
|
|
|
75
48
|
its('UMASK') { should eq '077' }
|
|
76
49
|
its('PASS_MAX_DAYS') { should eq '90' }
|
|
77
50
|
end
|
|
51
|
+
|
|
52
|
+
<br>
|
|
53
|
+
|
|
54
|
+
## Matchers
|
|
55
|
+
|
|
56
|
+
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/).
|
|
57
|
+
|
|
58
|
+
### name
|
|
59
|
+
|
|
60
|
+
The `name` matcher tests the value of `name` as read from `login.defs` versus the value declared in the test:
|
|
61
|
+
|
|
62
|
+
its('name') { should eq 'foo' }
|
data/docs/resources/mount.md.erb
CHANGED
|
@@ -6,6 +6,8 @@ title: About the mount Resource
|
|
|
6
6
|
|
|
7
7
|
Use the `mount` InSpec audit resource to test the mount points on FreeBSD and Linux systems.
|
|
8
8
|
|
|
9
|
+
<br>
|
|
10
|
+
|
|
9
11
|
## Syntax
|
|
10
12
|
|
|
11
13
|
An `mount` resource block declares the synchronization settings that should be tested:
|
|
@@ -20,14 +22,26 @@ where
|
|
|
20
22
|
* `MATCHER` is a valid matcher for this resource
|
|
21
23
|
* `'value'` is the value to be tested
|
|
22
24
|
|
|
25
|
+
<br>
|
|
23
26
|
|
|
24
|
-
##
|
|
27
|
+
## Examples
|
|
28
|
+
|
|
29
|
+
The following examples show how to use this InSpec audit resource.
|
|
30
|
+
|
|
31
|
+
### Test a the mount point on '/'
|
|
32
|
+
|
|
33
|
+
describe mount('/') do
|
|
34
|
+
it { should be_mounted }
|
|
35
|
+
its('device') { should eq '/dev/mapper/VolGroup-lv_root' }
|
|
36
|
+
its('type') { should eq 'ext4' }
|
|
37
|
+
its('options') { should eq ['rw', 'mode=620'] }
|
|
38
|
+
end
|
|
25
39
|
|
|
26
|
-
|
|
40
|
+
<br>
|
|
27
41
|
|
|
28
|
-
|
|
42
|
+
## Matchers
|
|
29
43
|
|
|
30
|
-
|
|
44
|
+
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/).
|
|
31
45
|
|
|
32
46
|
### be_mounted
|
|
33
47
|
|
|
@@ -35,28 +49,12 @@ The `be_mounted` matcher tests if the file is accessible from the file system:
|
|
|
35
49
|
|
|
36
50
|
it { should be_mounted }
|
|
37
51
|
|
|
38
|
-
### cmp
|
|
39
|
-
|
|
40
|
-
<%= partial "/shared/matcher_cmp" %>
|
|
41
|
-
|
|
42
52
|
### device
|
|
43
53
|
|
|
44
54
|
The `device` matcher tests the device from the `fstab` table:
|
|
45
55
|
|
|
46
56
|
its('device') { should eq '/dev/mapper/VolGroup-lv_root' }
|
|
47
57
|
|
|
48
|
-
### eq
|
|
49
|
-
|
|
50
|
-
<%= partial "/shared/matcher_eq" %>
|
|
51
|
-
|
|
52
|
-
### include
|
|
53
|
-
|
|
54
|
-
<%= partial "/shared/matcher_include" %>
|
|
55
|
-
|
|
56
|
-
### match
|
|
57
|
-
|
|
58
|
-
<%= partial "/shared/matcher_match" %>
|
|
59
|
-
|
|
60
58
|
### options
|
|
61
59
|
|
|
62
60
|
The `options` matcher tests the mount options for the file system from the `fstab` table:
|
|
@@ -68,16 +66,3 @@ The `options` matcher tests the mount options for the file system from the `fsta
|
|
|
68
66
|
The `type` matcher tests the file system type:
|
|
69
67
|
|
|
70
68
|
its('type') { should eq 'ext4' }
|
|
71
|
-
|
|
72
|
-
## Examples
|
|
73
|
-
|
|
74
|
-
The following examples show how to use this InSpec audit resource.
|
|
75
|
-
|
|
76
|
-
### Test a the mount point on '/'
|
|
77
|
-
|
|
78
|
-
describe mount('/') do
|
|
79
|
-
it { should be_mounted }
|
|
80
|
-
its('device') { should eq '/dev/mapper/VolGroup-lv_root' }
|
|
81
|
-
its('type') { should eq 'ext4' }
|
|
82
|
-
its('options') { should eq ['rw', 'mode=620'] }
|
|
83
|
-
end
|
|
@@ -6,6 +6,8 @@ title: About the mssql_session Resource
|
|
|
6
6
|
|
|
7
7
|
Use the `mssql_session` InSpec audit resource to test SQL commands run against a Microsoft SQL database.
|
|
8
8
|
|
|
9
|
+
<br>
|
|
10
|
+
|
|
9
11
|
## Syntax
|
|
10
12
|
|
|
11
13
|
A `mssql_session` resource block declares the username and password to use for the session, and then the command to be run:
|
|
@@ -20,18 +22,7 @@ where
|
|
|
20
22
|
* `query('QUERY')` contains the query to be run
|
|
21
23
|
* `its('value') { should eq('') }` compares the results of the query against the expected result in the test
|
|
22
24
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
This InSpec audit resource has the following matchers:
|
|
26
|
-
|
|
27
|
-
### cmp
|
|
28
|
-
|
|
29
|
-
<%= partial "/shared/matcher_cmp" %>
|
|
30
|
-
|
|
31
|
-
### eq
|
|
32
|
-
|
|
33
|
-
<%= partial "/shared/matcher_eq" %>
|
|
34
|
-
|
|
25
|
+
<br>
|
|
35
26
|
|
|
36
27
|
## Examples
|
|
37
28
|
|
|
@@ -60,3 +51,9 @@ The following examples show how to use this InSpec audit resource.
|
|
|
60
51
|
describe sql.query("SELECT SERVERPROPERTY('ProductVersion') as result").row(0).column('result') do
|
|
61
52
|
its("value") { should cmp > '12.00.4457' }
|
|
62
53
|
end
|
|
54
|
+
|
|
55
|
+
<br>
|
|
56
|
+
|
|
57
|
+
## Matchers
|
|
58
|
+
|
|
59
|
+
For a full list of available matchers please visit our [matchers page](https://www.inspec.io/docs/reference/matchers/).
|