inspec 1.51.18 → 1.51.21
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +16 -9
- data/docs/reporters.md +105 -0
- data/docs/resources/aide_conf.md.erb +1 -1
- data/docs/resources/apache.md.erb +1 -1
- data/docs/resources/auditd_conf.md.erb +1 -1
- data/docs/resources/bash.md.erb +1 -1
- data/docs/resources/bridge.md.erb +1 -1
- data/docs/resources/bsd_service.md.erb +1 -1
- data/docs/resources/cpan.md.erb +1 -1
- data/docs/resources/cran.md.erb +1 -1
- data/docs/resources/crontab.md.erb +1 -1
- data/docs/resources/csv.md.erb +1 -1
- data/docs/resources/dh_params.md.erb +1 -1
- data/docs/resources/directory.md.erb +1 -1
- data/docs/resources/docker_container.md.erb +3 -1
- data/docs/resources/elasticsearch.md.erb +1 -1
- data/docs/resources/etc_fstab.md.erb +1 -1
- data/docs/resources/etc_group.md.erb +2 -2
- data/docs/resources/etc_hosts.md.erb +1 -1
- data/docs/resources/etc_hosts_allow.md.erb +1 -1
- data/docs/resources/etc_hosts_deny.md.erb +2 -2
- data/docs/resources/file.md.erb +4 -4
- data/docs/resources/firewalld.md.erb +1 -1
- data/docs/resources/http.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/inetd_conf.md.erb +1 -1
- data/docs/resources/ini.md.erb +1 -1
- data/docs/resources/interface.md.erb +1 -1
- data/docs/resources/kernel_parameter.md.erb +3 -8
- data/docs/resources/key_rsa.md.erb +25 -15
- data/docs/resources/limits_conf.md.erb +16 -9
- data/docs/resources/login_def.md.erb +13 -4
- data/docs/resources/nginx.md.erb +2 -2
- data/docs/resources/postgres_hba_conf.md.erb +2 -2
- data/docs/resources/postgres_ident_conf.md.erb +2 -2
- data/docs/resources/user.md.erb +4 -5
- data/docs/resources/x509_certificate.md.erb +1 -1
- data/docs/resources/xml.md.erb +2 -2
- data/lib/inspec/base_cli.rb +9 -1
- data/lib/inspec/runner_rspec.rb +1 -6
- data/lib/inspec/version.rb +1 -1
- data/lib/resources/package.rb +6 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3379b4b69a099b07df2099525af24ea73e167141
|
4
|
+
data.tar.gz: f22f228ca686117c6737040d292c6311b09bc12f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 04cf3f6b6265c41df661c540bdc3c35553c6cd425a7620c27dfa4aa18cc8bf87a9be7f64619c4767b53ad9f604d3722211839161d973f128b4325ca9867a0f91
|
7
|
+
data.tar.gz: efa9fd7444b45de81d1f525829cfa8c48e7c8a2fc09038ed48990acf92746405d8ef1dc6622377fa8c885dc2842540e32dbb27a67394ce4768384484f63af50a
|
data/CHANGELOG.md
CHANGED
@@ -1,22 +1,30 @@
|
|
1
1
|
# Change Log
|
2
2
|
<!-- usage documentation: http://expeditor-docs.es.chef.io/configuration/changelog/ -->
|
3
|
-
<!-- latest_release 1.51.
|
4
|
-
## [v1.51.
|
3
|
+
<!-- latest_release 1.51.21 -->
|
4
|
+
## [v1.51.21](https://github.com/chef/inspec/tree/v1.51.21) (2018-02-18)
|
5
5
|
|
6
6
|
#### Merged Pull Requests
|
7
|
-
-
|
7
|
+
- Fix legacy reporter output to file (inspec-v1.x) [#2689](https://github.com/chef/inspec/pull/2689) ([jquick](https://github.com/jquick))
|
8
8
|
<!-- latest_release -->
|
9
9
|
|
10
|
-
<!-- release_rollup since=1.51.
|
11
|
-
### Changes since 1.51.
|
10
|
+
<!-- release_rollup since=1.51.18 -->
|
11
|
+
### Changes since 1.51.18 release
|
12
12
|
|
13
13
|
#### Merged Pull Requests
|
14
|
-
-
|
15
|
-
-
|
16
|
-
-
|
14
|
+
- Fix legacy reporter output to file (inspec-v1.x) [#2689](https://github.com/chef/inspec/pull/2689) ([jquick](https://github.com/jquick)) <!-- 1.51.21 -->
|
15
|
+
- package resource: Fix Windows package detection [#2624](https://github.com/chef/inspec/pull/2624) ([jerryaldrichiii](https://github.com/jerryaldrichiii)) <!-- 1.51.20 -->
|
16
|
+
- Fix the /private/var osx issue causing functional tests to fail [#2616](https://github.com/chef/inspec/pull/2616) ([jquick](https://github.com/jquick)) <!-- 1.51.19 -->
|
17
17
|
<!-- release_rollup -->
|
18
18
|
|
19
19
|
<!-- latest_stable_release -->
|
20
|
+
## [v1.51.18](https://github.com/chef/inspec/tree/v1.51.18) (2018-02-12)
|
21
|
+
|
22
|
+
#### Merged Pull Requests
|
23
|
+
- Force a default reporter for ad-hoc runners [#2610](https://github.com/chef/inspec/pull/2610) ([jquick](https://github.com/jquick))
|
24
|
+
- Allow ad-hoc runners to use rspec formats. [#2621](https://github.com/chef/inspec/pull/2621) ([jquick](https://github.com/jquick))
|
25
|
+
- Add json fields to schema and add tests. [#2618](https://github.com/chef/inspec/pull/2618) ([jquick](https://github.com/jquick))
|
26
|
+
<!-- latest_stable_release -->
|
27
|
+
|
20
28
|
## [v1.51.15](https://github.com/chef/inspec/tree/v1.51.15) (2018-02-09)
|
21
29
|
|
22
30
|
#### Merged Pull Requests
|
@@ -29,7 +37,6 @@
|
|
29
37
|
- Refactors grub_conf doc sligtly; adds os metadata [#2537](https://github.com/chef/inspec/pull/2537) ([kagarmoe](https://github.com/kagarmoe))
|
30
38
|
- Use the version of LicenseScout that comes with the Omnibus gem. [#2554](https://github.com/chef/inspec/pull/2554) ([tduffield](https://github.com/tduffield))
|
31
39
|
- Fix runner report and json newline [#2601](https://github.com/chef/inspec/pull/2601) ([jquick](https://github.com/jquick))
|
32
|
-
<!-- latest_stable_release -->
|
33
40
|
|
34
41
|
## [v1.51.6](https://github.com/chef/inspec/tree/v1.51.6) (2018-02-08)
|
35
42
|
|
data/docs/reporters.md
ADDED
@@ -0,0 +1,105 @@
|
|
1
|
+
---
|
2
|
+
title: InSpec Reporters
|
3
|
+
---
|
4
|
+
|
5
|
+
# InSpec Reporters
|
6
|
+
|
7
|
+
Introduced in InSpec 1.51.6
|
8
|
+
|
9
|
+
InSpec allows you to output your test results to one or more reporters. You can configure the reporter(s) using either the `--json-config` option or the `--reporter` option. While you can configure multiple reporters to write to different files, only one reporter can output to the screen(stdout).
|
10
|
+
|
11
|
+
## Syntax
|
12
|
+
|
13
|
+
You can specify one or more reporters using the `--reporter` cli flag. You can also specify a output by appending a path seperated by a colon.
|
14
|
+
|
15
|
+
Output json to screen.
|
16
|
+
|
17
|
+
```bash
|
18
|
+
inspec exec --reporter json
|
19
|
+
or
|
20
|
+
inspec exec --reporter json:-
|
21
|
+
```
|
22
|
+
|
23
|
+
Output cli to screen and write json to a file.
|
24
|
+
|
25
|
+
```bash
|
26
|
+
inspec exec --reporter cli json:/tmp/output.json
|
27
|
+
```
|
28
|
+
|
29
|
+
Output nothing to screen and write junit and html to a file.
|
30
|
+
|
31
|
+
```bash
|
32
|
+
inspec exec --reporter junit:/tmp/junit.xml html:www/index.html
|
33
|
+
```
|
34
|
+
|
35
|
+
Output json to screen and write to a file. Write junit to a file.
|
36
|
+
|
37
|
+
```bash
|
38
|
+
inspec exec --reporter json junit:/tmp/junit.xml | tee out.json
|
39
|
+
```
|
40
|
+
|
41
|
+
If you are using the cli option `--json-config` you can also set reporters.
|
42
|
+
|
43
|
+
Output cli to screen.
|
44
|
+
|
45
|
+
```json
|
46
|
+
{
|
47
|
+
"reporter": {
|
48
|
+
"cli" : {
|
49
|
+
"stdout" : true
|
50
|
+
}
|
51
|
+
}
|
52
|
+
}
|
53
|
+
```
|
54
|
+
|
55
|
+
Output cli to screen and write json to a file.
|
56
|
+
|
57
|
+
```json
|
58
|
+
{
|
59
|
+
"reporter": {
|
60
|
+
"cli" : {
|
61
|
+
"stdout" : true
|
62
|
+
},
|
63
|
+
"json" : {
|
64
|
+
"file" : "/tmp/output.json",
|
65
|
+
"stdout" : false
|
66
|
+
}
|
67
|
+
}
|
68
|
+
}
|
69
|
+
```
|
70
|
+
|
71
|
+
## Supported Reporters
|
72
|
+
|
73
|
+
The following are the current supported reporters:
|
74
|
+
|
75
|
+
### cli
|
76
|
+
|
77
|
+
This is the basic text base report. It includes details about which tests passed and failed and includes an overall summary at the end.
|
78
|
+
|
79
|
+
### json
|
80
|
+
|
81
|
+
This reporter includes all information about the profiles and test results in standard json format.
|
82
|
+
|
83
|
+
### json-min
|
84
|
+
|
85
|
+
This reporter is a redacted version of the json and only includes test results.
|
86
|
+
|
87
|
+
### documentation
|
88
|
+
|
89
|
+
This reporter is a very minimal text base report. It shows you which tests passed by name and has a small summary at the end.
|
90
|
+
|
91
|
+
### junit
|
92
|
+
|
93
|
+
This reporter outputs the standard junit spec in xml format.
|
94
|
+
|
95
|
+
### progress
|
96
|
+
|
97
|
+
This reporter is very condensed and gives you a `.`(pass), `f`(fail), or `*`(skip) character per test and a small summary at the end.
|
98
|
+
|
99
|
+
### json-rspec
|
100
|
+
|
101
|
+
This reporter includes all information from the rspec runner. Unlike the json reporter this includes rspec specific details.
|
102
|
+
|
103
|
+
### html
|
104
|
+
|
105
|
+
This renders html code to view your tests in a browser. It includes all the test and summary information.
|
data/docs/resources/bash.md.erb
CHANGED
@@ -19,7 +19,7 @@ A `bridge` resource block declares the bridge to be tested and what interface it
|
|
19
19
|
|
20
20
|
<br>
|
21
21
|
|
22
|
-
##
|
22
|
+
## Properties
|
23
23
|
|
24
24
|
* On Linux platforms, any value in the `/sys/class/net/{interface}/bridge` directory may be tested
|
25
25
|
* On the Windows platform, the `Get-NetAdapter` cmdlet is associated with the `Get-NetAdapterBinding` cmdlet and returns the `ComponentID ms_bridge` value as a JSON object
|
data/docs/resources/cpan.md.erb
CHANGED
data/docs/resources/cran.md.erb
CHANGED
data/docs/resources/csv.md.erb
CHANGED
@@ -25,7 +25,7 @@ A `docker_container` resource block declares the configuration data to be tested
|
|
25
25
|
|
26
26
|
## Resource Parameter Examples
|
27
27
|
|
28
|
-
###
|
28
|
+
### name
|
29
29
|
|
30
30
|
The container name can also be passed with the `name` resource parameter:
|
31
31
|
|
@@ -34,6 +34,8 @@ The container name can also be passed with the `name` resource parameter:
|
|
34
34
|
it { should be_running }
|
35
35
|
end
|
36
36
|
|
37
|
+
### id
|
38
|
+
|
37
39
|
Alternatively, you can pass in the container id:
|
38
40
|
|
39
41
|
describe docker_container(id: '71b5df59442b') do
|
@@ -35,7 +35,7 @@ Use the optional constructor parameter to give an alternative path to fstab file
|
|
35
35
|
|
36
36
|
<br>
|
37
37
|
|
38
|
-
##
|
38
|
+
## Properties
|
39
39
|
|
40
40
|
* `device_name` is the name associated with the device.
|
41
41
|
* `mount_point` is the directory at which the filesystem is configured to be mounted.
|
@@ -32,13 +32,13 @@ where
|
|
32
32
|
* `name: 'name'`, `group_name: 'group_name'`, `password: 'password'`, `gid: 'gid'`, `group_id: 'gid'`, `users: 'user_name'`, `members: 'member_name'`
|
33
33
|
<br>
|
34
34
|
|
35
|
-
##
|
35
|
+
## Properties
|
36
36
|
|
37
37
|
* `'gids'`, `'groups'`, and `'users'` are valid resource parameters for this resource.
|
38
38
|
|
39
39
|
<br>
|
40
40
|
|
41
|
-
##
|
41
|
+
## Examples
|
42
42
|
|
43
43
|
The following examples show how to use this InSpec audit resource.
|
44
44
|
|
data/docs/resources/file.md.erb
CHANGED
@@ -24,17 +24,17 @@ where
|
|
24
24
|
|
25
25
|
<br>
|
26
26
|
|
27
|
-
##
|
27
|
+
## Properties
|
28
28
|
|
29
|
-
### General
|
29
|
+
### General Properties
|
30
30
|
|
31
31
|
content, size, basename, path, owner, group, type
|
32
32
|
|
33
|
-
### Unix/Linux
|
33
|
+
### Unix/Linux Properties
|
34
34
|
|
35
35
|
symlink, mode, link_path, mtime, size, selinux\_label, md5sum, sha256sum, path, source, source\_path, uid, gid
|
36
36
|
|
37
|
-
### Windows
|
37
|
+
### Windows Properties
|
38
38
|
|
39
39
|
file\_version, product\_version
|
40
40
|
|
data/docs/resources/http.md.erb
CHANGED
@@ -49,7 +49,7 @@ Beginning with InSpec 1.41, you can enable the ability to have the HTTP test exe
|
|
49
49
|
In InSpec 2.0, the HTTP test will automatically execute remotely whenever InSpec is testing a remote node.
|
50
50
|
|
51
51
|
<br>
|
52
|
-
##
|
52
|
+
## Properties
|
53
53
|
|
54
54
|
body, headers, http_method, status,
|
55
55
|
|
data/docs/resources/ini.md.erb
CHANGED
@@ -43,7 +43,7 @@ In the event a section or setting name has a period in it, the alternate syntax
|
|
43
43
|
its(['section.with.a.dot.in.it', 'setting.name.with.dots']) { should cmp 'lotsadots' }
|
44
44
|
|
45
45
|
<br>
|
46
|
-
##
|
46
|
+
## Properties
|
47
47
|
|
48
48
|
This resource supports any of the settings listed in an INI file as properties.
|
49
49
|
|
@@ -1,11 +1,12 @@
|
|
1
1
|
---
|
2
2
|
title: About the kernel_parameter Resource
|
3
|
+
os: Linux
|
3
4
|
---
|
4
5
|
|
5
6
|
# kernel_parameter
|
6
7
|
|
7
8
|
Use the `kernel_parameter` InSpec audit resource to test kernel parameters on Linux platforms.
|
8
|
-
|
9
|
+
These parameters are located under `/proc/cmdline`.
|
9
10
|
<br>
|
10
11
|
|
11
12
|
## Syntax
|
@@ -42,7 +43,7 @@ The following examples show how to use this InSpec audit resource.
|
|
42
43
|
### Test if an IPv6 address accepts redirects
|
43
44
|
|
44
45
|
describe kernel_parameter('net.ipv6.conf.interface.accept_redirects') do
|
45
|
-
its('value') { should
|
46
|
+
its('value') { should cmp 'true' }
|
46
47
|
end
|
47
48
|
|
48
49
|
<br>
|
@@ -50,9 +51,3 @@ The following examples show how to use this InSpec audit resource.
|
|
50
51
|
## Matchers
|
51
52
|
|
52
53
|
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 }
|
@@ -1,5 +1,6 @@
|
|
1
1
|
---
|
2
2
|
title: The key_rsa Resource
|
3
|
+
os: Linux
|
3
4
|
---
|
4
5
|
|
5
6
|
# key_rsa
|
@@ -29,15 +30,13 @@ You can use an optional passphrase with `key_rsa`
|
|
29
30
|
|
30
31
|
<br>
|
31
32
|
|
32
|
-
##
|
33
|
+
## Properties
|
33
34
|
|
34
|
-
|
35
|
+
* `public_key`, `private_key`, `key_length`
|
35
36
|
|
36
|
-
|
37
|
+
<br>
|
37
38
|
|
38
|
-
|
39
|
-
it { should be_public }
|
40
|
-
end
|
39
|
+
## Property Examples
|
41
40
|
|
42
41
|
### public_key (String)
|
43
42
|
|
@@ -47,15 +46,6 @@ The `public_key` property returns the public part of the RSA key pair
|
|
47
46
|
its('public_key') { should match "-----BEGIN PUBLIC KEY-----\n3597459df9f3982......" }
|
48
47
|
end
|
49
48
|
|
50
|
-
### private?
|
51
|
-
|
52
|
-
This property verifies that the key includes a private key:
|
53
|
-
|
54
|
-
describe key_rsa('/etc/pki/www.mywebsite.com.key') do
|
55
|
-
it { should be_private }
|
56
|
-
end
|
57
|
-
|
58
|
-
|
59
49
|
### private_key (String)
|
60
50
|
|
61
51
|
The `private_key` property returns the private key or the RSA key pair.
|
@@ -71,3 +61,23 @@ The `key_length` property allows testing the number of bits in the key pair.
|
|
71
61
|
describe key_rsa('/etc/pki/www.mywebsite.com.key') do
|
72
62
|
its('key_length') { should eq 2048 }
|
73
63
|
end
|
64
|
+
|
65
|
+
## Matchers
|
66
|
+
|
67
|
+
For a full list of available matchers please visit our [matchers page](https://www.inspec.io/docs/reference/matchers/).
|
68
|
+
|
69
|
+
### public?
|
70
|
+
|
71
|
+
To verify if a key is public use the following:
|
72
|
+
|
73
|
+
describe key_rsa('/etc/pki/www.mywebsite.com.key') do
|
74
|
+
it { should be_public }
|
75
|
+
end
|
76
|
+
|
77
|
+
### private?
|
78
|
+
|
79
|
+
This property verifies that the key includes a private key:
|
80
|
+
|
81
|
+
describe key_rsa('/etc/pki/www.mywebsite.com.key') do
|
82
|
+
it { should be_private }
|
83
|
+
end
|
@@ -1,10 +1,11 @@
|
|
1
1
|
---
|
2
2
|
title: About the limits_conf Resource
|
3
|
+
os: Linux
|
3
4
|
---
|
4
5
|
|
5
6
|
# limits_conf
|
6
7
|
|
7
|
-
Use the `limits_conf` InSpec audit resource to test configuration settings in the `/etc/security/limits.conf` file. The `limits.conf` defines limits for processes (by user and/or group names) and helps ensure that the system
|
8
|
+
Use the `limits_conf` InSpec audit resource to test configuration settings in the `/etc/security/limits.conf` file. The `limits.conf` defines limits for processes (by user and/or group names) and helps ensure that the system running those processes remains stable. Each process may be assigned a hard or soft limit.
|
8
9
|
|
9
10
|
* Soft limits are maintained by the shell and defines the number of file handles (or open files) available to the user or group after login
|
10
11
|
* Hard limits are maintained by the kernel and defines the maximum number of allowed file handles
|
@@ -38,10 +39,24 @@ where
|
|
38
39
|
|
39
40
|
<br>
|
40
41
|
|
42
|
+
## Properties
|
43
|
+
|
44
|
+
* `domain`
|
45
|
+
|
41
46
|
## Examples
|
42
47
|
|
43
48
|
The following examples show how to use this InSpec audit resource.
|
44
49
|
|
50
|
+
### domain
|
51
|
+
|
52
|
+
The `domain` property tests the domain in the `limits.conf` file, along with associated type, item, and value:
|
53
|
+
|
54
|
+
its('domain') { should include ['type', 'item', 'value'] }
|
55
|
+
`
|
56
|
+
For example:
|
57
|
+
|
58
|
+
its('grantmc') { should include ['hard', 'nofile', '63536'] }
|
59
|
+
|
45
60
|
### Test limits
|
46
61
|
|
47
62
|
describe limits_conf('path') do
|
@@ -55,12 +70,4 @@ The following examples show how to use this InSpec audit resource.
|
|
55
70
|
|
56
71
|
For a full list of available matchers please visit our [matchers page](https://www.inspec.io/docs/reference/matchers/).
|
57
72
|
|
58
|
-
### domain
|
59
73
|
|
60
|
-
The `domain` matcher tests the domain in the `limits.conf` file, along with associated type, item, and value:
|
61
|
-
|
62
|
-
its('domain') { should include ['type', 'item', 'value'] }
|
63
|
-
`
|
64
|
-
For example:
|
65
|
-
|
66
|
-
its('grantmc') { should include ['hard', 'nofile', '63536'] }
|
@@ -1,5 +1,6 @@
|
|
1
1
|
---
|
2
2
|
title: About the login_defs Resource
|
3
|
+
os: Linux
|
3
4
|
---
|
4
5
|
|
5
6
|
# login_defs
|
@@ -23,10 +24,22 @@ where
|
|
23
24
|
|
24
25
|
<br>
|
25
26
|
|
27
|
+
## Properties
|
28
|
+
|
29
|
+
This resource supports the properties found in the `login.defs` configuration settings.
|
30
|
+
|
31
|
+
<br>
|
32
|
+
|
26
33
|
## Examples
|
27
34
|
|
28
35
|
The following examples show how to use this InSpec audit resource.
|
29
36
|
|
37
|
+
### name
|
38
|
+
|
39
|
+
The `name` matcher tests the value of `name` as read from `login.defs` versus the value declared in the test:
|
40
|
+
|
41
|
+
its('name') { should eq 'foo' }
|
42
|
+
|
30
43
|
### Test password expiration settings
|
31
44
|
|
32
45
|
describe login_defs do
|
@@ -55,8 +68,4 @@ The following examples show how to use this InSpec audit resource.
|
|
55
68
|
|
56
69
|
For a full list of available matchers please visit our [matchers page](https://www.inspec.io/docs/reference/matchers/).
|
57
70
|
|
58
|
-
### name
|
59
71
|
|
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/nginx.md.erb
CHANGED
@@ -29,13 +29,13 @@ where
|
|
29
29
|
|
30
30
|
<br>
|
31
31
|
|
32
|
-
##
|
32
|
+
## Properties
|
33
33
|
|
34
34
|
* 'compiler_info', 'error_log_path', 'http_client_body_temp_path', 'http_fastcgi_temp_path', 'http_log_path', 'http_proxy_temp_path', 'http_scgi_temp_path', 'http_uwsgi_temp_path', 'lock_path', 'modules', 'modules_path', 'openssl_version', 'prefix', 'sbin_path', 'service', 'support_info', 'version'
|
35
35
|
|
36
36
|
<br>
|
37
37
|
|
38
|
-
## Property Examples
|
38
|
+
## Property Examples
|
39
39
|
|
40
40
|
### version(String)
|
41
41
|
|
@@ -24,13 +24,13 @@ where
|
|
24
24
|
|
25
25
|
<br>
|
26
26
|
|
27
|
-
##
|
27
|
+
## Properties
|
28
28
|
|
29
29
|
'address', 'auth_method', 'auth_params', 'conf_dir' , 'conf_file' , 'database', 'params' ,'type', 'user'
|
30
30
|
|
31
31
|
<br>
|
32
32
|
|
33
|
-
## Property Examples
|
33
|
+
## Property Examples
|
34
34
|
|
35
35
|
### address([String])
|
36
36
|
|
@@ -24,13 +24,13 @@ where
|
|
24
24
|
|
25
25
|
<br>
|
26
26
|
|
27
|
-
##
|
27
|
+
## Properties
|
28
28
|
|
29
29
|
'conf_file', 'map_name', 'params', 'pg_username', 'system_username'
|
30
30
|
|
31
31
|
<br>
|
32
32
|
|
33
|
-
## Property Examples
|
33
|
+
## Property Examples
|
34
34
|
|
35
35
|
### map_name([String])
|
36
36
|
|
data/docs/resources/user.md.erb
CHANGED
@@ -40,7 +40,6 @@ The following examples show how to use this InSpec audit resource.
|
|
40
40
|
|
41
41
|
describe user('root') do
|
42
42
|
it { should exist }
|
43
|
-
it { should belong_to_group 'root' }
|
44
43
|
its('uid') { should eq 0 }
|
45
44
|
its('groups') { should eq ['root'] }
|
46
45
|
end
|
@@ -64,7 +63,7 @@ The `nginx` user is typically `www-data`, but on CentOS it's `nginx`. The follow
|
|
64
63
|
|
65
64
|
## Matchers
|
66
65
|
|
67
|
-
For a full list of available matchers please visit our [matchers page](https://www.inspec.io/docs/reference/matchers/).
|
66
|
+
For a full list of available matchers please visit our [matchers page](https://www.inspec.io/docs/reference/matchers/).
|
68
67
|
|
69
68
|
### exist
|
70
69
|
|
@@ -76,7 +75,7 @@ The `exist` matcher tests if the named user exists:
|
|
76
75
|
|
77
76
|
The `gid` matcher tests the group identifier:
|
78
77
|
|
79
|
-
its('gid') { should eq 1234 }
|
78
|
+
its('gid') { should eq 1234 }
|
80
79
|
|
81
80
|
where `1234` represents the user identifier.
|
82
81
|
|
@@ -92,7 +91,7 @@ where `root` represents the group.
|
|
92
91
|
|
93
92
|
The `groups` matcher tests two (or more) groups to which the user belongs:
|
94
93
|
|
95
|
-
its('groups') { should eq ['root', 'other']}
|
94
|
+
its('groups') { should eq ['root', 'other'] }
|
96
95
|
|
97
96
|
### home
|
98
97
|
|
@@ -126,7 +125,7 @@ The `shell` matcher tests the path to the default shell for the user:
|
|
126
125
|
|
127
126
|
The `uid` matcher tests the user identifier:
|
128
127
|
|
129
|
-
its('uid') { should eq 1234 }
|
128
|
+
its('uid') { should eq 1234 }
|
130
129
|
|
131
130
|
where `1234` represents the user identifier.
|
132
131
|
|
data/docs/resources/xml.md.erb
CHANGED
@@ -50,12 +50,12 @@ where
|
|
50
50
|
|
51
51
|
In the above example, you see the use of `@` and `attribute::` which are both methods of fetching attributes.
|
52
52
|
|
53
|
-
<br>
|
54
|
-
|
55
53
|
In the event the path contains an element which contains periods, the alternate syntax can be used:
|
56
54
|
|
57
55
|
its(['root/name.with.a.period']) { should cmp 'so_many_dots' }
|
58
56
|
|
57
|
+
<br>
|
58
|
+
|
59
59
|
## Examples
|
60
60
|
|
61
61
|
The following examples show how to use this InSpec audit resource.
|
data/lib/inspec/base_cli.rb
CHANGED
@@ -93,11 +93,19 @@ module Inspec
|
|
93
93
|
}
|
94
94
|
end
|
95
95
|
|
96
|
-
def self.parse_reporters(opts) # rubocop:disable Metrics/AbcSize
|
96
|
+
def self.parse_reporters(opts) # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
|
97
97
|
# merge in any legacy formats as reporter
|
98
98
|
# this method will only be used for ad-hoc runners
|
99
99
|
if !opts['format'].nil? && opts['reporter'].nil?
|
100
100
|
warn '[DEPRECATED] The option --format is being is being deprecated and will be removed in inspec 3.0. Please use --reporter'
|
101
|
+
|
102
|
+
# see if we are using the legacy output to write to files
|
103
|
+
if opts['output']
|
104
|
+
warn '[DEPRECATED] The option \'output\' is being is being deprecated and will be removed in inspec 3.0. Please use --reporter name:path'
|
105
|
+
opts['format'] = "#{opts['format']}:#{opts['output']}"
|
106
|
+
opts.delete('output')
|
107
|
+
end
|
108
|
+
|
101
109
|
opts['reporter'] = Array(opts['format'])
|
102
110
|
opts.delete('format')
|
103
111
|
end
|
data/lib/inspec/runner_rspec.rb
CHANGED
@@ -121,12 +121,7 @@ module Inspec
|
|
121
121
|
#
|
122
122
|
# @return [nil]
|
123
123
|
def configure_output
|
124
|
-
|
125
|
-
RSpec.configuration.output_stream = $stdout
|
126
|
-
else
|
127
|
-
RSpec.configuration.output_stream = @conf['output']
|
128
|
-
end
|
129
|
-
|
124
|
+
RSpec.configuration.output_stream = $stdout
|
130
125
|
@formatter = RSpec.configuration.add_formatter(Inspec::Formatters::Base)
|
131
126
|
RSpec.configuration.add_formatter(Inspec::Formatters::ShowProgress, $stderr) if @conf[:show_progress]
|
132
127
|
set_optional_formatters
|
data/lib/inspec/version.rb
CHANGED
data/lib/resources/package.rb
CHANGED
@@ -267,6 +267,12 @@ module Inspec::Resources
|
|
267
267
|
Select-Object -Property DisplayName,DisplayVersion | ConvertTo-Json
|
268
268
|
EOF
|
269
269
|
|
270
|
+
# We cannot rely on `exit_status` since PowerShell always exits 0 from the
|
271
|
+
# above command. Instead, if no package is found the output of the command
|
272
|
+
# will be `''` so we can use that to return `{}` to match the behavior of
|
273
|
+
# other package managers.
|
274
|
+
return {} if cmd.stdout == ''
|
275
|
+
|
270
276
|
begin
|
271
277
|
package = JSON.parse(cmd.stdout)
|
272
278
|
rescue JSON::ParserError => e
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: inspec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.51.
|
4
|
+
version: 1.51.21
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dominik Richter
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-02-
|
11
|
+
date: 2018-02-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: train
|
@@ -299,6 +299,7 @@ files:
|
|
299
299
|
- docs/migration.md
|
300
300
|
- docs/plugin_kitchen_inspec.md
|
301
301
|
- docs/profiles.md
|
302
|
+
- docs/reporters.md
|
302
303
|
- docs/resources/aide_conf.md.erb
|
303
304
|
- docs/resources/apache.md.erb
|
304
305
|
- docs/resources/apache_conf.md.erb
|