inspec_tools 1.4.0 → 1.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -4
- data/README.md +11 -8
- data/lib/inspec_tools/cli.rb +11 -2
- data/lib/inspec_tools/version.rb +1 -1
- metadata +10 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e1624fa6a12ead98dfd354a493256ecbaeeb33627bc94aff46053fa673238e95
|
4
|
+
data.tar.gz: 753a011624c348b0c427366a69cb607a1c2f3155dab551d1dd01dc3f9ebfa2d8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8b34323e3e0519cf722d82ea232f3d609b784bc25c6db883e69ccc4bc8b12fd4871d8a4d917f63fbd4140f105e57427482b9f18d9d2bc012329ac6d5f6d6ad10
|
7
|
+
data.tar.gz: 6d7baf7e9716daa2f5f9fc3707192d953294da87d882b523e5bc741f093cd82b850c66d8cbe2300460b2f73a7cd8590dc879f452952276c0cfb8d6c0a5ac87c2
|
data/CHANGELOG.md
CHANGED
@@ -1,15 +1,19 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
## [v1.4.0](https://github.com/mitre/inspec_tools/tree/v1.4.0) (2019-05-17)
|
4
|
+
[Full Changelog](https://github.com/mitre/inspec_tools/compare/v1.3.6...v1.4.0)
|
5
|
+
|
6
|
+
**Merged pull requests:**
|
7
|
+
|
8
|
+
- Apply fixes from CodeFactor [\#61](https://github.com/mitre/inspec_tools/pull/61) ([aaronlippold](https://github.com/aaronlippold))
|
9
|
+
|
3
10
|
## [v1.3.6](https://github.com/mitre/inspec_tools/tree/v1.3.6) (2019-05-02)
|
4
11
|
[Full Changelog](https://github.com/mitre/inspec_tools/compare/v1.3.5...v1.3.6)
|
5
12
|
|
6
13
|
**Implemented enhancements:**
|
7
14
|
|
8
|
-
- remove 'severity' from conversion [\#57](https://github.com/mitre/inspec_tools/pull/57) ([aaronlippold](https://github.com/aaronlippold))
|
9
|
-
|
10
|
-
**Fixed bugs:**
|
11
|
-
|
12
15
|
- document new metadata.json file and creation of file in README.md [\#53](https://github.com/mitre/inspec_tools/issues/53)
|
16
|
+
- remove 'severity' from conversion [\#57](https://github.com/mitre/inspec_tools/pull/57) ([aaronlippold](https://github.com/aaronlippold))
|
13
17
|
|
14
18
|
**Closed issues:**
|
15
19
|
|
data/README.md
CHANGED
@@ -101,8 +101,9 @@ Examples:
|
|
101
101
|
inspec_tools compliance -j examples/sample_json/rhel-simp.json -f examples/sample_yaml/threshold.yaml
|
102
102
|
```
|
103
103
|
|
104
|
-
|
104
|
+
### YAML file or In-line threshold definition styles:
|
105
105
|
|
106
|
+
#### File Examples
|
106
107
|
```
|
107
108
|
failed:
|
108
109
|
critical:
|
@@ -114,17 +115,18 @@ compliance:
|
|
114
115
|
```
|
115
116
|
|
116
117
|
```
|
117
|
-
|
118
|
+
compliance.min: 81
|
119
|
+
failed.critical.max: 1
|
120
|
+
failed.high.max: 1
|
118
121
|
```
|
119
122
|
|
123
|
+
#### In-Line Exmamples
|
120
124
|
```
|
121
|
-
{compliance
|
125
|
+
{compliance: {min: 90}, failed: {critical: {max: 0}, high: {max: 0}}}
|
122
126
|
```
|
123
127
|
|
124
128
|
```
|
125
|
-
compliance.min: 81
|
126
|
-
failed.critical.max: 10
|
127
|
-
failed.high.max: 1
|
129
|
+
{compliance.min: 81, failed.critical.max: 0, failed.high.max: 0}
|
128
130
|
```
|
129
131
|
|
130
132
|
## summary
|
@@ -137,10 +139,11 @@ USAGE: inspec_tools summary [OPTIONS] -j <inspec-json> -o <summary-csv>
|
|
137
139
|
FLAGS:
|
138
140
|
-j --inspec-json <inspec-json> : path to InSpec results Json
|
139
141
|
-o --output <output-json> : path to summary json
|
142
|
+
-c --cli <output-cli> : print summary to stdout
|
140
143
|
|
141
144
|
Examples:
|
142
145
|
|
143
|
-
inspec_tools summary -j examples/sample_json/rhel-simp.json -o summary.json
|
146
|
+
inspec_tools summary -j examples/sample_json/rhel-simp.json -o summary.json -c
|
144
147
|
```
|
145
148
|
|
146
149
|
## xccdf2inspec
|
@@ -300,7 +303,7 @@ Then, run `bundle exec rake release` which will create a git tag for the specifi
|
|
300
303
|
|
301
304
|
Approved for Public Release; Distribution Unlimited. Case Number 18-3678.
|
302
305
|
|
303
|
-
|
306
|
+
### NOTICE
|
304
307
|
|
305
308
|
MITRE hereby grants express written permission to use, reproduce, distribute, modify, and otherwise leverage this software to the extent permitted by the licensed terms provided in the LICENSE.md file included with this project.
|
306
309
|
|
data/lib/inspec_tools/cli.rb
CHANGED
@@ -163,12 +163,21 @@ module InspecTools
|
|
163
163
|
desc 'summary', 'summary parses an inspec results json to create a summary json'
|
164
164
|
long_desc Help.text(:summary)
|
165
165
|
option :inspec_json, required: true, aliases: '-j'
|
166
|
-
option :output, required:
|
166
|
+
option :output, required: false, aliases: '-o'
|
167
|
+
option :cli, required: false, aliases: '-c'
|
167
168
|
option :verbose, type: :boolean, aliases: '-V'
|
168
169
|
|
169
170
|
def summary
|
170
171
|
summary = InspecTools::Summary.new(File.read(options[:inspec_json])).to_summary
|
171
|
-
|
172
|
+
|
173
|
+
summary[:status].keys.each do |status|
|
174
|
+
puts status
|
175
|
+
summary[:status][status.to_sym].keys.each do |impact|
|
176
|
+
print "\t#{impact} : #{summary[:status][status.to_sym][impact.to_sym]}\n"
|
177
|
+
end
|
178
|
+
end if options[:cli]
|
179
|
+
|
180
|
+
File.write(options[:output], summary.to_json) if options[:output]
|
172
181
|
end
|
173
182
|
|
174
183
|
desc 'compliance', 'compliance parses an inspec results json to check if the compliance level meets a specified threshold'
|
data/lib/inspec_tools/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: inspec_tools
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robert Thew
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: exe
|
13
13
|
cert_chain: []
|
14
|
-
date: 2019-
|
14
|
+
date: 2019-06-20 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: colorize
|
@@ -31,16 +31,22 @@ dependencies:
|
|
31
31
|
name: inspec
|
32
32
|
requirement: !ruby/object:Gem::Requirement
|
33
33
|
requirements:
|
34
|
-
- - "
|
34
|
+
- - ">="
|
35
35
|
- !ruby/object:Gem::Version
|
36
36
|
version: '3.0'
|
37
|
+
- - "<"
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '5.0'
|
37
40
|
type: :runtime
|
38
41
|
prerelease: false
|
39
42
|
version_requirements: !ruby/object:Gem::Requirement
|
40
43
|
requirements:
|
41
|
-
- - "
|
44
|
+
- - ">="
|
42
45
|
- !ruby/object:Gem::Version
|
43
46
|
version: '3.0'
|
47
|
+
- - "<"
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: '5.0'
|
44
50
|
- !ruby/object:Gem::Dependency
|
45
51
|
name: nokogiri
|
46
52
|
requirement: !ruby/object:Gem::Requirement
|