inspec 1.51.0 → 1.51.6
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/CHANGELOG.md +29 -15
- data/README.md +1 -1
- data/docs/glossary.md +99 -0
- data/docs/resources/aide_conf.md.erb +16 -9
- data/docs/resources/apache.md.erb +66 -0
- data/docs/resources/apache_conf.md.erb +11 -5
- data/docs/resources/apt.md.erb +1 -1
- data/docs/resources/audit_policy.md.erb +1 -1
- data/docs/resources/auditd_conf.md.erb +12 -9
- data/docs/resources/bash.md.erb +24 -12
- data/docs/resources/bond.md.erb +26 -24
- data/docs/resources/bridge.md.erb +18 -11
- data/docs/resources/bsd_service.md.erb +11 -2
- data/docs/resources/command.md.erb +30 -29
- data/docs/resources/cpan.md.erb +33 -17
- data/docs/resources/cran.md.erb +26 -17
- data/docs/resources/crontab.md.erb +18 -1
- data/docs/resources/csv.md.erb +13 -7
- data/docs/resources/{dh_params.md → dh_params.md.erb} +30 -6
- data/docs/resources/directory.md.erb +9 -4
- data/docs/resources/docker.md.erb +1 -1
- data/docs/resources/docker_container.md.erb +32 -26
- data/docs/resources/docker_image.md.erb +29 -26
- data/docs/resources/docker_service.md.erb +37 -31
- data/docs/resources/elasticsearch.md.erb +18 -32
- data/docs/resources/etc_fstab.md.erb +19 -15
- data/docs/resources/etc_group.md.erb +13 -39
- data/docs/resources/etc_hosts.md.erb +12 -5
- data/docs/resources/etc_hosts_allow.md.erb +9 -4
- data/docs/resources/etc_hosts_deny.md.erb +12 -7
- data/docs/resources/file.md.erb +139 -134
- data/docs/resources/filesystem.md.erb +5 -4
- data/docs/resources/firewalld.md.erb +1 -1
- data/docs/resources/gem.md.erb +2 -2
- data/docs/resources/group.md.erb +1 -1
- data/docs/resources/host.md.erb +1 -1
- data/docs/resources/iis_app.md.erb +1 -1
- data/docs/resources/iis_site.md.erb +1 -1
- data/docs/resources/interface.md.erb +1 -1
- data/docs/resources/iptables.md.erb +1 -1
- data/docs/resources/json.md.erb +1 -1
- data/docs/resources/kernel_module.md.erb +1 -1
- data/docs/resources/kernel_parameter.md.erb +1 -1
- data/docs/resources/launchd_service.md.erb +1 -1
- data/docs/resources/limits_conf.md.erb +1 -1
- data/docs/resources/login_def.md.erb +1 -1
- data/docs/resources/mount.md.erb +1 -1
- data/docs/resources/mysql_conf.md.erb +1 -1
- data/docs/resources/nginx_conf.md.erb +1 -1
- data/docs/resources/npm.md.erb +1 -1
- data/docs/resources/oneget.md.erb +1 -1
- data/docs/resources/os.md.erb +1 -1
- data/docs/resources/os_env.md.erb +2 -2
- data/docs/resources/package.md.erb +1 -1
- data/docs/resources/packages.md.erb +66 -0
- data/docs/resources/parse_config.md.erb +1 -1
- data/docs/resources/parse_config_file.md.erb +1 -1
- data/docs/resources/passwd.md.erb +1 -1
- data/docs/resources/pip.md.erb +1 -1
- data/docs/resources/port.md.erb +1 -1
- data/docs/resources/postgres_conf.md.erb +1 -1
- data/docs/resources/postgres_session.md.erb +1 -1
- data/docs/resources/powershell.md.erb +2 -2
- data/docs/resources/processes.md.erb +1 -1
- data/docs/resources/registry_key.md.erb +1 -1
- data/docs/resources/runit_service.md.erb +1 -1
- data/docs/resources/security_policy.md.erb +1 -1
- data/docs/resources/service.md.erb +1 -1
- data/docs/resources/shadow.md.erb +1 -1
- data/docs/resources/ssh_config.md.erb +1 -1
- data/docs/resources/sshd_config.md.erb +1 -1
- data/docs/resources/ssl.md.erb +1 -1
- data/docs/resources/sys_info.md.erb +1 -1
- data/docs/resources/systemd_service.md.erb +1 -1
- data/docs/resources/sysv_service.md.erb +1 -1
- data/docs/resources/upstart_service.md.erb +1 -1
- data/docs/resources/user.md.erb +1 -1
- data/docs/resources/users.md.erb +1 -1
- data/docs/resources/windows_feature.md.erb +1 -1
- data/docs/resources/windows_hotfix.md.erb +1 -1
- data/docs/resources/xinetd_conf.md.erb +1 -1
- data/docs/resources/xml.md.erb +1 -1
- data/docs/resources/yaml.md.erb +1 -1
- data/docs/resources/yum.md.erb +1 -1
- data/lib/inspec.rb +2 -1
- data/lib/inspec/base_cli.rb +98 -18
- data/lib/inspec/cli.rb +33 -21
- data/lib/inspec/formatters.rb +3 -0
- data/lib/inspec/formatters/base.rb +208 -0
- data/lib/inspec/formatters/json_rspec.rb +20 -0
- data/lib/inspec/formatters/show_progress.rb +12 -0
- data/lib/inspec/objects.rb +1 -0
- data/lib/inspec/objects/describe.rb +92 -0
- data/lib/inspec/reporters.rb +33 -0
- data/lib/inspec/reporters/base.rb +23 -0
- data/lib/inspec/reporters/cli.rb +395 -0
- data/lib/inspec/reporters/json.rb +132 -0
- data/lib/inspec/reporters/json_min.rb +44 -0
- data/lib/inspec/reporters/junit.rb +77 -0
- data/lib/inspec/runner.rb +14 -1
- data/lib/inspec/runner_rspec.rb +34 -14
- data/lib/inspec/schema.rb +1 -0
- data/lib/inspec/shell.rb +0 -1
- data/lib/inspec/version.rb +1 -1
- data/lib/resources/apache.rb +20 -0
- data/lib/resources/apache_conf.rb +33 -8
- data/lib/resources/audit_policy.rb +1 -1
- data/lib/resources/packages.rb +4 -3
- metadata +17 -4
- data/lib/inspec/rspec_json_formatter.rb +0 -940
@@ -4,7 +4,8 @@ title: About the filesystem Resource
|
|
4
4
|
|
5
5
|
# filesystem
|
6
6
|
|
7
|
-
Use the `filesystem` InSpec resource to audit filesystem disk space usage
|
7
|
+
Use the `filesystem` InSpec resource to audit filesystem disk space usage.
|
8
|
+
|
8
9
|
<br>
|
9
10
|
|
10
11
|
## Syntax
|
@@ -17,12 +18,12 @@ A `filesystem` resource block declares tests for disk space in a partion:
|
|
17
18
|
|
18
19
|
where
|
19
20
|
|
20
|
-
* `filesystem('/')` states that
|
21
|
-
* `size` is measured in megabytes (MB)
|
21
|
+
* `filesystem('/')` states that the resource will look at the root (/) partition.
|
22
|
+
* `size` is measured in megabytes (MB).
|
22
23
|
|
23
24
|
<br>
|
24
25
|
|
25
|
-
## Examples
|
26
|
+
## Resource Property Examples
|
26
27
|
|
27
28
|
The following examples show how to use this InSpec audit resource.
|
28
29
|
|
@@ -65,7 +65,7 @@ The `default_zone` property displays the default active zone to be used.
|
|
65
65
|
|
66
66
|
## Matchers
|
67
67
|
|
68
|
-
|
68
|
+
For a full list of available matchers please visit our [matchers page](https://www.inspec.io/docs/reference/matchers/).
|
69
69
|
|
70
70
|
### `be_installed`
|
71
71
|
|
data/docs/resources/gem.md.erb
CHANGED
@@ -24,7 +24,7 @@ where
|
|
24
24
|
|
25
25
|
<br>
|
26
26
|
|
27
|
-
## Examples
|
27
|
+
## Resource Property Examples
|
28
28
|
|
29
29
|
The following examples show how to use this InSpec audit resource.
|
30
30
|
|
@@ -63,7 +63,7 @@ The following examples show how to use this InSpec audit resource.
|
|
63
63
|
|
64
64
|
## Matchers
|
65
65
|
|
66
|
-
|
66
|
+
For a full list of available matchers please visit our [matchers page](https://www.inspec.io/docs/reference/matchers/).
|
67
67
|
|
68
68
|
### be_installed
|
69
69
|
|
data/docs/resources/group.md.erb
CHANGED
@@ -39,7 +39,7 @@ The following examples show how to use this InSpec audit resource.
|
|
39
39
|
|
40
40
|
## Matchers
|
41
41
|
|
42
|
-
|
42
|
+
For a full list of available matchers please visit our [matchers page](https://www.inspec.io/docs/reference/matchers/).
|
43
43
|
|
44
44
|
### be_local
|
45
45
|
|
data/docs/resources/host.md.erb
CHANGED
@@ -56,7 +56,7 @@ The following examples show how to use this InSpec audit resource.
|
|
56
56
|
|
57
57
|
## Matchers
|
58
58
|
|
59
|
-
|
59
|
+
For a full list of available matchers please visit our [matchers page](https://www.inspec.io/docs/reference/matchers/).
|
60
60
|
|
61
61
|
### be_reachable
|
62
62
|
|
@@ -67,7 +67,7 @@ The following examples show how to use this InSpec audit resource.
|
|
67
67
|
|
68
68
|
## Matchers
|
69
69
|
|
70
|
-
|
70
|
+
For a full list of available matchers please visit our [matchers page](https://www.inspec.io/docs/reference/matchers/).
|
71
71
|
|
72
72
|
### exist
|
73
73
|
|
@@ -65,7 +65,7 @@ The following examples show how to use this InSpec audit resource.
|
|
65
65
|
|
66
66
|
## Matchers
|
67
67
|
|
68
|
-
|
68
|
+
For a full list of available matchers please visit our [matchers page](https://www.inspec.io/docs/reference/matchers/).
|
69
69
|
|
70
70
|
### be_running
|
71
71
|
|
@@ -25,7 +25,7 @@ An `interface` resource block declares network interface properties to be tested
|
|
25
25
|
|
26
26
|
## Matchers
|
27
27
|
|
28
|
-
|
28
|
+
For a full list of available matchers please visit our [matchers page](https://www.inspec.io/docs/reference/matchers/).
|
29
29
|
|
30
30
|
### be_up
|
31
31
|
|
@@ -54,7 +54,7 @@ Note that the rule specification must exactly match what's in the output of `ipt
|
|
54
54
|
|
55
55
|
## Matchers
|
56
56
|
|
57
|
-
|
57
|
+
For a full list of available matchers please visit our [matchers page](https://www.inspec.io/docs/reference/matchers/).
|
58
58
|
|
59
59
|
### have_rule
|
60
60
|
|
data/docs/resources/json.md.erb
CHANGED
@@ -52,7 +52,7 @@ The following examples show how to use this InSpec audit resource.
|
|
52
52
|
|
53
53
|
## Matchers
|
54
54
|
|
55
|
-
|
55
|
+
For a full list of available matchers please visit our [matchers page](https://www.inspec.io/docs/reference/matchers/).
|
56
56
|
|
57
57
|
### name
|
58
58
|
|
@@ -91,7 +91,7 @@ The following examples show how to use this InSpec audit resource.
|
|
91
91
|
|
92
92
|
## Matchers
|
93
93
|
|
94
|
-
|
94
|
+
For a full list of available matchers please visit our [matchers page](https://www.inspec.io/docs/reference/matchers/).
|
95
95
|
|
96
96
|
### be_loaded
|
97
97
|
|
@@ -49,7 +49,7 @@ The following examples show how to use this InSpec audit resource.
|
|
49
49
|
|
50
50
|
## Matchers
|
51
51
|
|
52
|
-
|
52
|
+
For a full list of available matchers please visit our [matchers page](https://www.inspec.io/docs/reference/matchers/).
|
53
53
|
|
54
54
|
### value
|
55
55
|
|
@@ -35,7 +35,7 @@ The path to the service manager's control may be specified for situations where
|
|
35
35
|
|
36
36
|
## Matchers
|
37
37
|
|
38
|
-
|
38
|
+
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
|
|
@@ -53,7 +53,7 @@ The following examples show how to use this InSpec audit resource.
|
|
53
53
|
|
54
54
|
## Matchers
|
55
55
|
|
56
|
-
|
56
|
+
For a full list of available matchers please visit our [matchers page](https://www.inspec.io/docs/reference/matchers/).
|
57
57
|
|
58
58
|
### domain
|
59
59
|
|
@@ -53,7 +53,7 @@ The following examples show how to use this InSpec audit resource.
|
|
53
53
|
|
54
54
|
## Matchers
|
55
55
|
|
56
|
-
|
56
|
+
For a full list of available matchers please visit our [matchers page](https://www.inspec.io/docs/reference/matchers/).
|
57
57
|
|
58
58
|
### name
|
59
59
|
|
data/docs/resources/mount.md.erb
CHANGED
@@ -41,7 +41,7 @@ The following examples show how to use this InSpec audit resource.
|
|
41
41
|
|
42
42
|
## Matchers
|
43
43
|
|
44
|
-
|
44
|
+
For a full list of available matchers please visit our [matchers page](https://www.inspec.io/docs/reference/matchers/).
|
45
45
|
|
46
46
|
### be_mounted
|
47
47
|
|
@@ -87,7 +87,7 @@ The following examples show how to use this InSpec audit resource.
|
|
87
87
|
|
88
88
|
## Matchers
|
89
89
|
|
90
|
-
|
90
|
+
For a full list of available matchers please visit our [matchers page](https://www.inspec.io/docs/reference/matchers/).
|
91
91
|
|
92
92
|
### setting
|
93
93
|
|
@@ -50,7 +50,7 @@ The following examples show how to use this InSpec audit resource.
|
|
50
50
|
|
51
51
|
## Matchers
|
52
52
|
|
53
|
-
|
53
|
+
For a full list of available matchers please visit our [matchers page](https://www.inspec.io/docs/reference/matchers/).
|
54
54
|
|
55
55
|
### http
|
56
56
|
|
data/docs/resources/npm.md.erb
CHANGED
@@ -44,7 +44,7 @@ The following examples show how to use this InSpec audit resource.
|
|
44
44
|
|
45
45
|
## Matchers
|
46
46
|
|
47
|
-
|
47
|
+
For a full list of available matchers please visit our [matchers page](https://www.inspec.io/docs/reference/matchers/).
|
48
48
|
|
49
49
|
### be_installed
|
50
50
|
|
@@ -37,7 +37,7 @@ The following examples show how to use this InSpec audit resource.
|
|
37
37
|
|
38
38
|
## Matchers
|
39
39
|
|
40
|
-
|
40
|
+
For a full list of available matchers please visit our [matchers page](https://www.inspec.io/docs/reference/matchers/).
|
41
41
|
|
42
42
|
### be_installed
|
43
43
|
|
data/docs/resources/os.md.erb
CHANGED
@@ -52,7 +52,7 @@ The following examples show how to use this InSpec audit resource.
|
|
52
52
|
|
53
53
|
## Matchers
|
54
54
|
|
55
|
-
|
55
|
+
For a full list of available matchers please visit our [matchers page](https://www.inspec.io/docs/reference/matchers/).
|
56
56
|
|
57
57
|
## os.family? Helpers
|
58
58
|
|
@@ -13,7 +13,7 @@ Use the `os_env` InSpec audit resource to test the environment variables for the
|
|
13
13
|
A `os_env` resource block declares an environment variable, and then declares its value:
|
14
14
|
|
15
15
|
describe os_env('VARIABLE') do
|
16
|
-
its('
|
16
|
+
its('property') { should eq 1 }
|
17
17
|
end
|
18
18
|
|
19
19
|
where
|
@@ -60,7 +60,7 @@ Habitat uses the `os_env` resource to test environment variables. The environmen
|
|
60
60
|
|
61
61
|
## Matchers
|
62
62
|
|
63
|
-
|
63
|
+
For a full list of available matchers please visit our [matchers page](https://www.inspec.io/docs/reference/matchers/).
|
64
64
|
|
65
65
|
### content
|
66
66
|
|
@@ -91,7 +91,7 @@ Memcached is an in-memory key-value store that helps improve the performance of
|
|
91
91
|
|
92
92
|
## Matchers
|
93
93
|
|
94
|
-
|
94
|
+
For a full list of available matchers please visit our [matchers page](https://www.inspec.io/docs/reference/matchers/).
|
95
95
|
|
96
96
|
### be_held
|
97
97
|
|
@@ -0,0 +1,66 @@
|
|
1
|
+
---
|
2
|
+
title: About the packages Resource
|
3
|
+
---
|
4
|
+
|
5
|
+
# packages
|
6
|
+
|
7
|
+
Use the `packages` InSpec audit resource to test the properties of multiple packages on the system.
|
8
|
+
|
9
|
+
<br>
|
10
|
+
|
11
|
+
## Syntax
|
12
|
+
|
13
|
+
A `packages` resource block declares a regular expression search to select packages
|
14
|
+
|
15
|
+
describe packages(/name/) do
|
16
|
+
its('statuses') { should cmp 'installed' }
|
17
|
+
end
|
18
|
+
|
19
|
+
<br>
|
20
|
+
|
21
|
+
## Examples
|
22
|
+
|
23
|
+
The following examples show how to use this InSpec audit resource.
|
24
|
+
|
25
|
+
### Verify that no `xserver` packages are installed
|
26
|
+
|
27
|
+
describe package(/xserver/) do
|
28
|
+
its('statuses') { should_not cmp 'installed' }
|
29
|
+
end
|
30
|
+
|
31
|
+
### Verify all `openssl` packages match a certain version
|
32
|
+
|
33
|
+
describe package(/openssl/) do
|
34
|
+
its('versions') { should cmp '1.0.1e-42.el7' }
|
35
|
+
end
|
36
|
+
|
37
|
+
### Verify that both the `i686` and `x86_64` versions of `libgcc` are installed
|
38
|
+
|
39
|
+
describe package(/libgcc/) do
|
40
|
+
its('architectures') { should include 'x86_64' }
|
41
|
+
its('architectures') { should include 'i686' }
|
42
|
+
end
|
43
|
+
|
44
|
+
<br>
|
45
|
+
|
46
|
+
## Matchers
|
47
|
+
|
48
|
+
For a full list of available matchers please visit our [matchers page](https://www.inspec.io/docs/reference/matchers/).
|
49
|
+
|
50
|
+
### statuses
|
51
|
+
|
52
|
+
The `statuses` matcher tests if packages are installed on the system
|
53
|
+
|
54
|
+
its('statuses') { should cmp 'installed' }
|
55
|
+
|
56
|
+
### versions
|
57
|
+
|
58
|
+
The `versions` matcher tests the versions of the packages installed on the system
|
59
|
+
|
60
|
+
its('versions') { should cmp '3.4.0.2-4.el7' }
|
61
|
+
|
62
|
+
### architectures
|
63
|
+
|
64
|
+
The `architectures` matcher tests the architecture of packages installed on the system
|
65
|
+
|
66
|
+
its('architectures') { should include 'i686' }
|
@@ -41,7 +41,7 @@ where each test
|
|
41
41
|
|
42
42
|
## Matchers
|
43
43
|
|
44
|
-
|
44
|
+
For a full list of available matchers please visit our [matchers page](https://www.inspec.io/docs/reference/matchers/).
|
45
45
|
|
46
46
|
### assignment_regex
|
47
47
|
|
@@ -76,7 +76,7 @@ The following examples show how to use this InSpec audit resource.
|
|
76
76
|
|
77
77
|
## Matchers
|
78
78
|
|
79
|
-
|
79
|
+
For a full list of available matchers please visit our [matchers page](https://www.inspec.io/docs/reference/matchers/).
|
80
80
|
|
81
81
|
### assignment_regex
|
82
82
|
|
@@ -68,7 +68,7 @@ The following examples show how to use this InSpec audit resource.
|
|
68
68
|
|
69
69
|
## Matchers
|
70
70
|
|
71
|
-
|
71
|
+
For a full list of available matchers please visit our [matchers page](https://www.inspec.io/docs/reference/matchers/).
|
72
72
|
|
73
73
|
### gids
|
74
74
|
|
data/docs/resources/pip.md.erb
CHANGED
@@ -51,7 +51,7 @@ The following examples show how to use this InSpec audit resource.
|
|
51
51
|
|
52
52
|
## Matchers
|
53
53
|
|
54
|
-
|
54
|
+
For a full list of available matchers please visit our [matchers page](https://www.inspec.io/docs/reference/matchers/).
|
55
55
|
|
56
56
|
### be_installed
|
57
57
|
|
data/docs/resources/port.md.erb
CHANGED
@@ -99,7 +99,7 @@ or:
|
|
99
99
|
|
100
100
|
## Matchers
|
101
101
|
|
102
|
-
|
102
|
+
For a full list of available matchers please visit our [matchers page](https://www.inspec.io/docs/reference/matchers/).
|
103
103
|
|
104
104
|
### address
|
105
105
|
|
@@ -67,7 +67,7 @@ where `unix_socket_group` is set to the PostgreSQL default setting (the group to
|
|
67
67
|
|
68
68
|
## Matchers
|
69
69
|
|
70
|
-
|
70
|
+
For a full list of available matchers please visit our [matchers page](https://www.inspec.io/docs/reference/matchers/).
|
71
71
|
|
72
72
|
### setting
|
73
73
|
|
@@ -59,7 +59,7 @@ The following examples show how to use this InSpec audit resource.
|
|
59
59
|
|
60
60
|
## Matchers
|
61
61
|
|
62
|
-
|
62
|
+
For a full list of available matchers please visit our [matchers page](https://www.inspec.io/docs/reference/matchers/).
|
63
63
|
|
64
64
|
### output
|
65
65
|
|
@@ -17,7 +17,7 @@ A `powershell` resource block declares a Powershell script to be tested, and the
|
|
17
17
|
EOH
|
18
18
|
|
19
19
|
describe powershell(script) do
|
20
|
-
its('
|
20
|
+
its('property') { should eq 'output' }
|
21
21
|
end
|
22
22
|
|
23
23
|
where
|
@@ -80,7 +80,7 @@ No newline:
|
|
80
80
|
|
81
81
|
## Matchers
|
82
82
|
|
83
|
-
|
83
|
+
For a full list of available matchers please visit our [matchers page](https://www.inspec.io/docs/reference/matchers/).
|
84
84
|
|
85
85
|
### exit_status
|
86
86
|
|
@@ -98,7 +98,7 @@ Below is a mapping table to help you understand what property the unix field map
|
|
98
98
|
|
99
99
|
## Matchers
|
100
100
|
|
101
|
-
|
101
|
+
For a full list of available matchers please visit our [matchers page](https://www.inspec.io/docs/reference/matchers/).
|
102
102
|
|
103
103
|
### property_name
|
104
104
|
|
@@ -90,7 +90,7 @@ where `'HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Schedule'` is the f
|
|
90
90
|
|
91
91
|
## Matchers
|
92
92
|
|
93
|
-
|
93
|
+
For a full list of available matchers please visit our [matchers page](https://www.inspec.io/docs/reference/matchers/).
|
94
94
|
|
95
95
|
### children
|
96
96
|
|
@@ -35,7 +35,7 @@ The path to the service manager's control may be specified for situations where
|
|
35
35
|
|
36
36
|
## Matchers
|
37
37
|
|
38
|
-
|
38
|
+
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
|
|
@@ -37,7 +37,7 @@ The following examples show how to use this InSpec audit resource.
|
|
37
37
|
|
38
38
|
## Matchers
|
39
39
|
|
40
|
-
|
40
|
+
For a full list of available matchers please visit our [matchers page](https://www.inspec.io/docs/reference/matchers/).
|
41
41
|
|
42
42
|
### policy_name
|
43
43
|
|