inspec_tools 2.3.8 → 3.0.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: b6f754f4816775d8bb360ed2ce768b1f4a443f647a440a1fe04a371388af6fe0
4
- data.tar.gz: d31e79fb1477ab0b9fed85df8847f59f487d1ca5dc0bfc369e201dd2e0b87ba8
3
+ metadata.gz: 5b88a75ec28d6491c6f8070b70402898b70d0971eb1d467aaab58e8f1671c50f
4
+ data.tar.gz: acad2a4ee5d9c23e972e98b175575915213ea55bb8546b942191ba037392d0a8
5
5
  SHA512:
6
- metadata.gz: 5f4fe6b5f733d4654d179e0bbe651276afa3ccfff6527e6088f50c13da23324b1be9c6b695cad464895f13e53b442dd674d546c826b31632def647b73d50d26e
7
- data.tar.gz: bee2b9f2a53efa941413308ea6eaeb340493c8d581b07a4d348094ba1278c4177fd3de7ee6575226896d41d0156bf6eaf0934a5f0eb597956c1b4c5ff2c07c67
6
+ metadata.gz: aab806365dba6a0878a2351cd6e433655ddcd8dcfbf5136228a5e2b79b1110709a9f714d13e801b7cbf836564a82f72b462f1cd4e4ba319d78f8c9d35f0b6950
7
+ data.tar.gz: 245322d7e8d84eb755aa644dbc4fe8cba3098e467c2f055a56dd66a4ee05fc4ff30beabecf13fea9eed060e26199f9b9b6da87dbcb1cc2ff0658ee959beefef6
@@ -15,7 +15,7 @@ require_relative '../utilities/xccdf/to_xccdf'
15
15
  module InspecTools
16
16
  class Inspec
17
17
  def initialize(inspec_json, metadata = {})
18
- @json = JSON.parse(inspec_json.gsub(/\\+u0000/, ''))
18
+ @json = JSON.parse(inspec_json)
19
19
  @metadata = metadata
20
20
  end
21
21
 
@@ -62,9 +62,10 @@ module InspecPlugins
62
62
  option :metadata, required: false, type: :string, aliases: '-m',
63
63
  desc: 'path to JSON file with additional host metadata for the XCCDF file'
64
64
  def inspec2xccdf
65
- json = File.read(options[:inspec_json])
65
+ io = File.open(options[:inspec_json], 'rb')
66
+ io.set_encoding_by_bom
66
67
  metadata = options[:metadata] ? JSON.parse(File.read(options[:metadata])) : {}
67
- inspec_tool = InspecTools::Inspec.new(json, metadata)
68
+ inspec_tool = InspecTools::Inspec.new(io.read, metadata)
68
69
  attr_hsh = YAML.load_file(options[:attributes])
69
70
  xccdf = inspec_tool.to_xccdf(attr_hsh)
70
71
  File.write(options[:output], xccdf)
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: 2.3.8
4
+ version: 3.0.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: 2021-07-13 00:00:00.000000000 Z
14
+ date: 2021-07-28 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: colorize
@@ -288,7 +288,7 @@ dependencies:
288
288
  description: Converter utils for Inspec that can be included as a gem or used from
289
289
  the command line
290
290
  email:
291
- - rthew@mitre.org
291
+ - saf@mitre.org
292
292
  executables:
293
293
  - inspec_tools
294
294
  extensions: []
@@ -365,14 +365,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
365
365
  requirements:
366
366
  - - ">="
367
367
  - !ruby/object:Gem::Version
368
- version: '2.5'
368
+ version: '2.7'
369
369
  required_rubygems_version: !ruby/object:Gem::Requirement
370
370
  requirements:
371
371
  - - ">="
372
372
  - !ruby/object:Gem::Version
373
373
  version: '0'
374
374
  requirements: []
375
- rubygems_version: 3.2.15
375
+ rubygems_version: 3.2.22
376
376
  signing_key:
377
377
  specification_version: 4
378
378
  summary: Converter utils for Inspec