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

Added Severity Label validation to All Vulns table (CRASM-822) #720

Merged
merged 6 commits into from
Nov 18, 2024

Conversation

hawkishpolicy
Copy link
Collaborator

  • Extends severity level validation used in VulnerabilityBarChart.tsx to the All Vulnerabilities table.
  • This ensures continuity of Severity labels between the bar graph and table.
  • Also ensures that server side based filtering returns accurate results.

🗣 Description

  • Ensured that null or empty string values are displayed as 'N/A' in the severity column of the All Vulns table.
  • Ensured that values of Other or any value that does not include 'Critical', 'High', 'Medium', or 'Low' are displayed as 'Other' in the severity column of the All Vulns table..
  • Formatted the severity column of the All Vulns table to display the severity label in title case.
  • Updated the vulnerability search endpoint to return vulnerabilities with a severity of 'Other' if the severity is not 'Critical', 'High', 'Medium', or 'Low'.
  • Updated the vulnerability search endpoint to return vulnerabilities with a severity of 'N/A' if the severity is null or an empty string.
  • Updated the vulnerability search endpoint to return vulnerabilities regardless of the case of the severity value.

💭 Motivation and context

🧪 Testing

  • Seeded local database with numerous vulnerabilities containing irregular severity labels.
  • Filtered via table and bar graph to see if accurate results were returned.

📷 Screenshots (if appropriate)

Screenshot 2024-11-08 at 12 12 41 PM
Screenshot 2024-11-08 at 12 11 58 PM
Screenshot 2024-11-08 at 12 12 48 PM
Screenshot 2024-11-08 at 12 10 58 PM
Screenshot 2024-11-08 at 1 50 27 PM
Screenshot 2024-11-08 at 1 50 22 PM

✅ Pre-approval checklist

  • This PR has an informative and human-readable title.
  • Changes are limited to a single goal - eschew scope creep!
  • All future TODOs are captured in issues, which are referenced
    in code comments.
  • All relevant type-of-change labels have been added.
  • I have read the CONTRIBUTING document.
  • These code changes follow cisagov code standards.
  • All relevant repo and/or project documentation has been updated
    to reflect the changes in this PR.
  • Tests have been added and/or modified to cover the changes in this PR.
  • All new and existing tests pass.

✅ Pre-merge checklist

  • Revert dependencies to default branches.
  • Finalize version.

✅ Post-merge checklist

  • Create a release.

- Ensured that null or empty string values are displayed as 'N/A' in the severity column of the All Vulns table.
- Ensured that values of Other or any value that does not include 'Critical', 'High', 'Medium', or 'Low' are displayed as 'Other' in the severity column of the All Vulns table..
- Formatted the severity column of the All Vulns table to display the severity label in title case.
- Updated the vulnerability search endpoint to return vulnerabilities with a severity of 'Other' if the severity is not 'Critical', 'High', 'Medium', or 'Low'.
- Updated the vulnerability search endpoint to return vulnerabilities with a severity of 'N/A' if the severity is null or an empty string.
- Updated the vulnerability search endpoint to return vulnerabilities regardless of the case of the severity value.
- Could be from the HTML encodings for the org search introduced in CRASM-746/PR #691
- Added an if statement and a console.log to help troubleshoot a github actions issue.
- This change was reverted because it was erroneously included in the draft pull request.
Copy link
Collaborator

@lwersiy lwersiy left a comment

Choose a reason for hiding this comment

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

Looks good

Copy link
Collaborator

@jayjaybunce jayjaybunce left a comment

Choose a reason for hiding this comment

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

Found two small bugs, resolved these together with @hawkishpolicy

LGTM after checks pass

Copy link
Collaborator

@chrtorres chrtorres left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Collaborator

@schmelz21 schmelz21 left a comment

Choose a reason for hiding this comment

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

LGTM

@schmelz21 schmelz21 merged commit 36eb23c into develop Nov 18, 2024
18 of 22 checks passed
@schmelz21 schmelz21 deleted the Other-Severity-Label-for-All-Vulns-CRASM-822 branch November 18, 2024 17:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants