Skip to content

Add benchmark#18

Merged
akofink merged 1 commit intoOpenSCAP:masterfrom
akofink:add-benchmark
Oct 3, 2019
Merged

Add benchmark#18
akofink merged 1 commit intoOpenSCAP:masterfrom
akofink:add-benchmark

Conversation

@akofink
Copy link
Copy Markdown
Collaborator

@akofink akofink commented Sep 26, 2019

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).

@akofink akofink marked this pull request as ready for review September 30, 2019 12:32
include OpenscapParser::RuleReferences

def initialize(parsed_xml: nil)
@parsed_xml = parsed_xml
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Copy Markdown
Collaborator Author

@akofink akofink Sep 30, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread test/datastream_test.rb
context 'scap content' do
should 'be able to parse profiles' do
parser = create_parser('ssg-rhel7-ds.xml')
profile_titles = [
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Titles are not unique. Checking IDs should be more robust.

Comment thread test/datastream_test.rb
end
end

context 'tailoring file' do
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll be starting to implement tailoring later this month, so I'll revisit this then.

Signed-off-by: Andrew Kofink <akofink@redhat.com>
@xprazak2
Copy link
Copy Markdown
Collaborator

xprazak2 commented Oct 2, 2019

Works for me 👍

@akofink akofink merged commit 69a2d8a into OpenSCAP:master Oct 3, 2019
@akofink akofink deleted the add-benchmark branch October 3, 2019 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants