openscap_parser 1.6.0 → 1.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/openscap_parser/profile.rb +22 -1
- data/lib/openscap_parser/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ce0283dd70cb4bd3915601b3b8af328c6204a6e726944e3e500c0349c077d573
|
4
|
+
data.tar.gz: d550c9a264579c57668a39e83cb1294aab294caabc7e2a07232f55f4d4d09031
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ce05d654865ec030cb866c4b48da4dd3b0ded8b2884825745f525dc7ea396f2aebbf8bef29e6f04f5dac5c5440f256db706743ee056ca00706def25297ff02d3
|
7
|
+
data.tar.gz: 463109c35f867f37ab57e96d59c0360e4af4d91ecf73c14b813b1b9fe1294f9b4ca5364a4521ac40b5ef551c33fa6da631c1655580da60328f664d0f64e36377
|
@@ -52,12 +52,33 @@ module OpenscapParser
|
|
52
52
|
end
|
53
53
|
end
|
54
54
|
|
55
|
+
def refined_rules(attribute)
|
56
|
+
@refined_rules ||= @parsed_xml.xpath("refine-rule[@#{attribute}]").each_with_object({}) do |element, rr|
|
57
|
+
rr[element.at_xpath('@idref').text] = element.at_xpath("@#{attribute}")&.text
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
def refined_rule_severity
|
62
|
+
refined_rules('severity')
|
63
|
+
end
|
64
|
+
|
65
|
+
def refined_rule_role
|
66
|
+
refined_rules('role')
|
67
|
+
end
|
68
|
+
|
69
|
+
def refined_rule_weight
|
70
|
+
refined_rules('weight')
|
71
|
+
end
|
72
|
+
|
55
73
|
def to_h
|
56
74
|
{
|
57
75
|
:id => id,
|
58
76
|
:title => title,
|
59
77
|
:description => description,
|
60
|
-
:refined_values => refined_values
|
78
|
+
:refined_values => refined_values,
|
79
|
+
:refined_rule_severity => refined_rule_severity,
|
80
|
+
:refined_rule_role => refined_rule_role,
|
81
|
+
:refined_rule_weight => refined_rule_weight
|
61
82
|
}
|
62
83
|
end
|
63
84
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: openscap_parser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Lobato Garcia
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2023-02-16 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: nokogiri
|