Skip to content

Conversation

@Honny1
Copy link
Member

@Honny1 Honny1 commented Mar 21, 2023

This PR adds multi-check rules to the HTML report.

Example:
image

Depend on: #140

@Honny1 Honny1 force-pushed the multi-check-rules branch 2 times, most recently from 4c2e208 to f1053be Compare March 29, 2023 13:22
@Honny1 Honny1 force-pushed the multi-check-rules branch from f1053be to ec5e8a4 Compare April 5, 2023 15:50
@Honny1 Honny1 marked this pull request as ready for review April 6, 2023 13:13
return self.reports_with_oval_definitions[self.cpe_source]
logging.warning((
"The given input does not contain a clear mapping of the OVAL definition used"
" for CPE checks. The results of the OVAL definition in the CPE checks could "
Copy link
Contributor

Choose a reason for hiding this comment

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

Spaces: at the end or at the start?

report.groups = groups

if len(report.profile_info.selected_rules_ids) > 0:
report.profile_info.selected_rules_ids.extend(rule_parser.to_select_rule_ids)
Copy link
Contributor

Choose a reason for hiding this comment

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

That should be a ProfileInfo mutate method, like extend_selected_rules_ids. Along with the logic how/when to do that if len(report.profile_info.selected_rules_ids) > 0:.

Why do you update it only when it is not empty by the way?

Copy link
Member Author

Choose a reason for hiding this comment

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

There are two approaches how to determine if the rule is selected.

  • First is to get information from elements <xccdf-1.2:select ...>. A list of selected_rules_ids represents these elements.
  • The second is to get information from the result of the rule.

The second approach is used if select elements aren't present in the ARF report. That is why the list is not extended when the list is empty.

@Honny1 Honny1 force-pushed the multi-check-rules branch from ec5e8a4 to 3edc61b Compare April 12, 2023 13:09
@Honny1 Honny1 force-pushed the multi-check-rules branch from 3edc61b to 208db6c Compare April 12, 2023 13:41
@Honny1
Copy link
Member Author

Honny1 commented Apr 12, 2023

Changes:

  • Created ProfileInfo mutate methods for selecting and deselecting rules
  • Consistently split strings (previous PR)

@evgenyz evgenyz merged commit fbe1e98 into OpenSCAP:main Apr 12, 2023
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