Add benchmark#18
Conversation
| include OpenscapParser::RuleReferences | ||
|
|
||
| def initialize(parsed_xml: nil) | ||
| @parsed_xml = parsed_xml |
There was a problem hiding this comment.
IMO we should just call this @parsed_xml everywhere so it's easier to use.
|
|
||
| def reference_nodes | ||
| @reference_nodes ||= @rule_xml.xpath('reference') | ||
| alias :rule_reference_nodes_old :rule_reference_nodes |
There was a problem hiding this comment.
We're overriding RuleReferences#rule_reference_nodes https://github.com/dLobatog/openscap_parser/pull/18/files#diff-c883c147fe302a85453f4dc58d46c051R20.
| context 'scap content' do | ||
| should 'be able to parse profiles' do | ||
| parser = create_parser('ssg-rhel7-ds.xml') | ||
| profile_titles = [ |
There was a problem hiding this comment.
Titles are not unique. Checking IDs should be more robust.
| end | ||
| end | ||
|
|
||
| context 'tailoring file' do |
There was a problem hiding this comment.
@xprazak2 I'm not sure who uses openscap_parser for tailoring, but it's a whole different file type from Datastream. The profiles are not <Profile... but <profile ... as they aren't defining a profile but selecting/deselecting Rules from that Profile. It wouldn't be very difficult to patch up the tailoring workflow - but I'm just wondering if it's used anywhere you know.
There was a problem hiding this comment.
I think nobody uses it at the moment, but smart_proxy_openscap plans to 😁.
But I agree it is a different file type and we should find a better way how to handle it rather than lump it together with Datastream.
There was a problem hiding this comment.
We'll be starting to implement tailoring later this month, so I'll revisit this then.
Signed-off-by: Andrew Kofink <akofink@redhat.com>
|
Works for me 👍 |
Now the openscap_parser will recognize XCCDF
<Benchmark />types! This is what actually defines all the Rule, Profile, Group, etc (everything but TestResult or RuleResult basically).