inspec_tools 1.3.6 → 1.4.0

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: 24173bba10e1af8511d10fb4251a37ec5152fa73ea2175b82e4feb254b5b9a13
4
- data.tar.gz: 54949534e7e9d879fa6c827c8e2022a1221d00031d63cff722cfb12edae2a21a
3
+ metadata.gz: 5a1dee9a9941b2324ad4e6c58f3033e8d642f64bc0a9acf92686aac51484bac6
4
+ data.tar.gz: 11954720bf60d4234d9833a04c7533e51cda15b32b83b499a230394868332f77
5
5
  SHA512:
6
- metadata.gz: d07bdc8f07b8c0f91388ea91052366813ecbc1e82d56db758c45414413810f9bc71adadaa906072e70edc2e1a1f37fd37511e954c9d45756f15743d3d7bd7b91
7
- data.tar.gz: bd1e95dcb865df3bd5cc33f6aafd523bcb662f028578d7e59521878bd54315af7e09d59d0afb87d813f27d66df8e870360c6e2386c0d3f983b882a6e5a31e975
6
+ metadata.gz: 81e3d4f1e59c9b2ebdc39063055d66950c1702dd03223dc6116aa089d21bea2fbb636b102032f88206bd2c6a1940c4d4878eba5fdcf6332188b66caaa08782b0
7
+ data.tar.gz: b7fd78e8af38c8dbaefaef49c518b5dd58983d209c8a8a112c515771fe39c00091a9971649d70d895b0f3f1cec2770d899e5e00afb7e248bd923c871c95bd90f
data/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # Change Log
2
2
 
3
+ ## [v1.3.6](https://github.com/mitre/inspec_tools/tree/v1.3.6) (2019-05-02)
4
+ [Full Changelog](https://github.com/mitre/inspec_tools/compare/v1.3.5...v1.3.6)
5
+
6
+ **Implemented enhancements:**
7
+
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
+ - document new metadata.json file and creation of file in README.md [\#53](https://github.com/mitre/inspec_tools/issues/53)
13
+
14
+ **Closed issues:**
15
+
16
+ - While working with STIGViewer there were some missing TAGs [\#50](https://github.com/mitre/inspec_tools/issues/50)
17
+ - remove severity tag in xccdf to inspec converted [\#44](https://github.com/mitre/inspec_tools/issues/44)
18
+
3
19
  ## [v1.3.5](https://github.com/mitre/inspec_tools/tree/v1.3.5) (2019-05-01)
4
20
  [Full Changelog](https://github.com/mitre/inspec_tools/compare/v1.3.4...v1.3.5)
5
21
 
data/lib/inspec_tools.rb CHANGED
@@ -1,8 +1,6 @@
1
1
  $LOAD_PATH.unshift(File.expand_path(__dir__))
2
2
  require 'inspec_tools/version'
3
3
  require 'rubygems'
4
- require 'bundler/setup'
5
- Bundler.setup(:default)
6
4
 
7
5
  module InspecTools
8
6
  autoload :Help, 'inspec_tools/help'
@@ -120,10 +120,27 @@ module InspecTools
120
120
  %w{
121
121
  Vuln_Num Severity Group_Title Rule_ID Rule_Ver Rule_Title Vuln_Discuss
122
122
  Check_Content Fix_Text CCI_REF
123
- }.each do |param|
123
+ }.each do |attrib|
124
+ if attrib == 'Severity'
125
+ key = :impact
126
+ else
127
+ key = attrib.downcase.to_sym
128
+ end
129
+
130
+ next if control[key].nil?
131
+
132
+ if attrib == 'Severity'
133
+ value = Utils::InspecUtil.get_impact_string(control[key])
134
+ next if value == 'none'
135
+
136
+ value = 'high' if value == 'critical'
137
+ else
138
+ value = control[key]
139
+ end
140
+
124
141
  stigdata = HappyMapperTools::StigChecklist::StigData.new
125
- stigdata.attrib = param
126
- stigdata.data = control[param.downcase.to_sym]
142
+ stigdata.attrib = attrib
143
+ stigdata.data = value
127
144
  stig_data_list.push(stigdata)
128
145
  end
129
146
 
@@ -1,3 +1,3 @@
1
1
  module InspecTools
2
- VERSION = '1.3.6'.freeze
2
+ VERSION = '1.4.0'.freeze
3
3
  end
@@ -1,4 +1,5 @@
1
1
  require 'inspec/objects'
2
+ require 'inspec/impact'
2
3
  require 'word_wrap'
3
4
  require 'pp'
4
5
  require 'uri'
@@ -176,6 +177,10 @@ module Utils
176
177
  end
177
178
  end
178
179
 
180
+ def self.get_impact_string(impact)
181
+ Inspec::Impact.string_from_impact(impact) unless impact.nil?
182
+ end
183
+
179
184
  def self.unpack_inspec_json(directory, inspec_json, separated, output_format)
180
185
  if directory == 'id'
181
186
  directory = inspec_json['name']
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.3.6
4
+ version: 1.4.0
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-02 00:00:00.000000000 Z
14
+ date: 2019-05-17 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: colorize