inspec_tools 2.3.3 → 2.3.4
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6188a2ff394f6f733d23d032d4919e1f9e5e08267bbce30a2a4725631d5a5a13
|
4
|
+
data.tar.gz: 4b3b5fc70d53d4784ef84f881493ca361d998a254c96323e4e1e65c48e7e5630
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e537d4749c34eaac49e4c80355250949f02d0db6020596d4c73e1f2995e384742cefc5d72a12fb7c2a159ceca406dbc723aa5d8e36ea8272967e9bd37f49da08
|
7
|
+
data.tar.gz: 5a26c4b893a8646ae1e4ae62cd380b0603f0a45b1a88a7234af5a9a8d52a2cc71561d8d0ee784a8bedbbcda7abc26d88b58f999761649bcd29c0adfc464fec78
|
@@ -65,6 +65,14 @@ module HappyMapperTools
|
|
65
65
|
tag 'ident'
|
66
66
|
attribute :system, String, tag: 'system'
|
67
67
|
content :ident, String
|
68
|
+
def initialize(ident_str)
|
69
|
+
@ident = ident_str
|
70
|
+
if ident_str =~ /^(CCI-[0-9]{6})$/
|
71
|
+
@system = 'http://cyber.mil/cci'
|
72
|
+
else
|
73
|
+
@system = 'http://cyber.mil/legacy'
|
74
|
+
end
|
75
|
+
end
|
68
76
|
end
|
69
77
|
|
70
78
|
# Class Fixtext maps from the 'fixtext' from Benchmark XML file using HappyMapper
|
@@ -99,12 +99,12 @@ module Utils
|
|
99
99
|
status_list = control[:status].uniq
|
100
100
|
if control[:impact].to_f.zero?
|
101
101
|
'Not_Applicable'
|
102
|
+
elsif (status_list.include?('error') || status_list.empty?) && for_summary
|
103
|
+
'Profile_Error'
|
102
104
|
elsif status_list.include?('failed')
|
103
105
|
'Open'
|
104
106
|
elsif status_list.include?('passed')
|
105
107
|
'NotAFinding'
|
106
|
-
elsif status_list.include?('error') && for_summary
|
107
|
-
'Profile_Error'
|
108
108
|
else
|
109
109
|
# profile skipped or profile error
|
110
110
|
'Not_Reviewed'
|
@@ -34,6 +34,7 @@ module Utils
|
|
34
34
|
c_data[c_id]['rweight'] = control['tags']['rweight'] if control['tags']['rweight'] # Optional attribute where N/A is not schema compliant
|
35
35
|
c_data[c_id]['stig_id'] = control['tags']['stig_id'] || DATA_NOT_FOUND_MESSAGE
|
36
36
|
c_data[c_id]['cci'] = control['tags']['cci'] if control['tags']['cci'] # Optional attribute
|
37
|
+
c_data[c_id]['legacy'] = control['tags']['legacy'] if control['tags']['legacy'] # Optional attribute
|
37
38
|
c_data[c_id]['nist'] = control['tags']['nist'] || ['unmapped']
|
38
39
|
c_data[c_id]['check'] = control['tags']['check'] || DATA_NOT_FOUND_MESSAGE
|
39
40
|
c_data[c_id]['checkref'] = control['tags']['checkref'] || DATA_NOT_FOUND_MESSAGE
|
@@ -74,6 +74,7 @@ module Utils
|
|
74
74
|
end
|
75
75
|
|
76
76
|
group.rule.ident = build_rule_idents(control['cci']) if control['cci']
|
77
|
+
group.rule.ident += build_rule_idents(control['legacy']) if control['legacy']
|
77
78
|
|
78
79
|
group.rule.fixtext = HappyMapperTools::Benchmark::Fixtext.new
|
79
80
|
group.rule.fixtext.fixref = control['fix_id']
|
@@ -126,10 +127,7 @@ module Utils
|
|
126
127
|
|
127
128
|
# Each rule identifier is a different element
|
128
129
|
idents.map do |identifier|
|
129
|
-
ident = HappyMapperTools::Benchmark::Ident.new
|
130
|
-
ident.system = 'https://public.cyber.mil/stigs/cci/'
|
131
|
-
ident.ident = identifier
|
132
|
-
ident
|
130
|
+
ident = HappyMapperTools::Benchmark::Ident.new identifier
|
133
131
|
end
|
134
132
|
end
|
135
133
|
|
@@ -227,6 +225,7 @@ module Utils
|
|
227
225
|
rule_result.instance = result['code_desc']
|
228
226
|
|
229
227
|
rule_result.ident = build_rule_idents(control['cci']) if control['cci']
|
228
|
+
rule_result.ident += build_rule_idents(control['legacy']) if control['legacy']
|
230
229
|
|
231
230
|
# Fix information is only necessary when there are failed tests
|
232
231
|
rule_result.fix = build_rule_fix(control['fix_id']) if control['fix_id'] && result_status == 'fail'
|
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.
|
4
|
+
version: 2.3.4
|
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-
|
14
|
+
date: 2021-04-16 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: colorize
|
@@ -358,7 +358,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
358
358
|
- !ruby/object:Gem::Version
|
359
359
|
version: '0'
|
360
360
|
requirements: []
|
361
|
-
rubygems_version: 3.2.
|
361
|
+
rubygems_version: 3.2.15
|
362
362
|
signing_key:
|
363
363
|
specification_version: 4
|
364
364
|
summary: Converter utils for Inspec
|