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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5a1dee9a9941b2324ad4e6c58f3033e8d642f64bc0a9acf92686aac51484bac6
4
- data.tar.gz: 11954720bf60d4234d9833a04c7533e51cda15b32b83b499a230394868332f77
3
+ metadata.gz: e1624fa6a12ead98dfd354a493256ecbaeeb33627bc94aff46053fa673238e95
4
+ data.tar.gz: 753a011624c348b0c427366a69cb607a1c2f3155dab551d1dd01dc3f9ebfa2d8
5
5
  SHA512:
6
- metadata.gz: 81e3d4f1e59c9b2ebdc39063055d66950c1702dd03223dc6116aa089d21bea2fbb636b102032f88206bd2c6a1940c4d4878eba5fdcf6332188b66caaa08782b0
7
- data.tar.gz: b7fd78e8af38c8dbaefaef49c518b5dd58983d209c8a8a112c515771fe39c00091a9971649d70d895b0f3f1cec2770d899e5e00afb7e248bd923c871c95bd90f
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
- ##### Possible In-line and yaml file threshold definition styles:
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
- {compliance: {min: 80}, failed: {critical: {max: 0}, high: {max: 0}}}
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.min: 81, failed.critical.max: 10, failed.high.max: 0}
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
- ## NOTICE
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
 
@@ -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: true, aliases: '-o'
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
- File.write(options[:output], summary.to_json)
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'
@@ -1,3 +1,3 @@
1
1
  module InspecTools
2
- VERSION = '1.4.0'.freeze
2
+ VERSION = '1.4.1'.freeze
3
3
  end
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.0
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-05-17 00:00:00.000000000 Z
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