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 +4 -4
- data/lib/inspec_tools/inspec.rb +1 -1
- data/lib/inspec_tools/plugin_cli.rb +3 -2
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5b88a75ec28d6491c6f8070b70402898b70d0971eb1d467aaab58e8f1671c50f
|
4
|
+
data.tar.gz: acad2a4ee5d9c23e972e98b175575915213ea55bb8546b942191ba037392d0a8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aab806365dba6a0878a2351cd6e433655ddcd8dcfbf5136228a5e2b79b1110709a9f714d13e801b7cbf836564a82f72b462f1cd4e4ba319d78f8c9d35f0b6950
|
7
|
+
data.tar.gz: 245322d7e8d84eb755aa644dbc4fe8cba3098e467c2f055a56dd66a4ee05fc4ff30beabecf13fea9eed060e26199f9b9b6da87dbcb1cc2ff0658ee959beefef6
|
data/lib/inspec_tools/inspec.rb
CHANGED
@@ -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
|
-
|
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(
|
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:
|
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-
|
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
|
-
-
|
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.
|
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.
|
375
|
+
rubygems_version: 3.2.22
|
376
376
|
signing_key:
|
377
377
|
specification_version: 4
|
378
378
|
summary: Converter utils for Inspec
|