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

Refactor scan results and findings to support multiple types #190

Merged
merged 9 commits into from Sep 6, 2023

Conversation

alex-nork
Copy link
Contributor

@alex-nork alex-nork commented Sep 5, 2023

The purpose of this PR is to refactor the scan_run template and associated view to work with multiple finding/result/rule types.

@alex-nork alex-nork self-assigned this Sep 5, 2023
@alex-nork alex-nork changed the title Refactor scan results and findings Refactor scan results and findings to support multiple types Sep 5, 2023
@alex-nork alex-nork marked this pull request as ready for review September 6, 2023 13:11
Comment on lines +85 to +86
{% include 'scan/_rule_table_rows.html' with unique_rules=unique_regex_rules %}
{% include 'scan/_rule_table_rows.html' with unique_rules=unique_multiquery_rules %}
Copy link
Contributor

Choose a reason for hiding this comment

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

viva reusable templates!!! 🍻

Comment on lines +55 to +61
for result in results:
rule = result.rule

if rule.id not in rule_dict:
rule.finding_count = 0
rule.findings = []
rule_dict[rule.id] = rule
Copy link
Contributor

Choose a reason for hiding this comment

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

Just an educational note:

If/when we finally get a postgres backend, using distinct() would be the way to go here.

Copy link
Contributor

@zimventures zimventures left a comment

Choose a reason for hiding this comment

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

👍👍

@alex-nork alex-nork merged commit fb8a56a into main Sep 6, 2023
5 checks passed
@alex-nork alex-nork deleted the AlexN/refactor-scan-results branch September 6, 2023 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants