Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reorganization of OVAL Test results #221

Merged
merged 6 commits into from
Jan 24, 2024

Conversation

Honny1
Copy link
Member

@Honny1 Honny1 commented Jan 22, 2024

This PR changes the representation of components referenced by OVAL Tests, such as Objects, States, and Variables.

See the new representation:

image

Fixes: #216

@Honny1 Honny1 added enhancement New feature or request ux labels Jan 22, 2024
@Honny1 Honny1 requested a review from jan-cerny January 22, 2024 13:32
@jan-cerny jan-cerny self-assigned this Jan 24, 2024
Copy link
Member

@jan-cerny jan-cerny left a comment

Choose a reason for hiding this comment

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

This is an amazing improvement! It will be very useful for debugging fails of complex rules.

return body;
}

function generate_referenced_endpoints(test_info, children_id, div) {
Copy link
Member

Choose a reason for hiding this comment

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

Consider if the code complexity of this function can be reduced, for example by inverting the condition or extracting the inner for loop to a separate function.

Comment on lines 92 to 95
if data_id not in map_referenced_oval_endpoints:
map_referenced_oval_endpoints[data_id] = []
if value not in map_referenced_oval_endpoints[data_id]:
map_referenced_oval_endpoints[data_id].append(value)
Copy link
Member

Choose a reason for hiding this comment

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

Can the map be a collections.defaultdict? I think that would help you avoid this construction.

@Honny1 Honny1 requested a review from jan-cerny January 24, 2024 13:21
Copy link
Member

@jan-cerny jan-cerny left a comment

Choose a reason for hiding this comment

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

I have generated a report from scan results of rule audit_rules_privilieged_commands and I have seen how the details about referenced dependencies works in the HTML report.

@jan-cerny jan-cerny merged commit 92475b9 into OpenSCAP:main Jan 24, 2024
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request ux
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Test details in some rules aren't helpful
2 participants