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

Fix Side Drawer Advance Filters (CRASM-967) #740

Open
wants to merge 20 commits into
base: develop
Choose a base branch
from

Conversation

hawkishpolicy
Copy link
Collaborator

@hawkishpolicy hawkishpolicy commented Dec 12, 2024

Applies a more user friendly and consistent display, plus increased functionality, to the checkbox controlled filters in the Advanced Filters section of the Side Drawer.

🗣 Description

  • Applied ascending sort to the following Advanced Filters:
    • Root Domain(s)
    • Ports
    • CVE
    • Severity
  • Added grouping and sorting logic similar to that of VulnerabilityBarChart to Severity Filters:
    • Null, undefined, empty string, and N/A values are placed into the "N/A" category.
    • Special characters, numbers, and Other are placed into the "Other" category.
    • All categories are now case insensitive.
  • Fixed issue with npm run syncdb (old TS backend):
    • searchSync was nested inside of syncdb -- -d populate.
    • This was preventing local db changes from syncing.
    • Issue is resolved.
  • Added aggregations to:
    • Returned result from /search.
    • SearchResponse (Base Model).
    • These are needed to form the facet filters used in the Filter Drawer.
  • Ensured Elastic Search returns accurate number of results based on the Severity Level filter passed in:
    • All versions of Null, N/A, undefined are returned with the N/A filter.
    • Case insensitive versions of Low, Medium, High, and Critical are returned with their respective filter.
    • Everything else, i.e. special characters, numbers, or some other severity level is returned with Other.
  • Ensured cve's were included in the vulnerabilities object used in searchSync.
  • Added a few random cve's modeled after real ones to be used for sample data in local db.

💭 Motivation and context

🧪 Testing

  • Tested locally.

📷 Screenshots (if appropriate)

Screenshot 2024-12-12 at 10 22 11 AM Screenshot 2024-12-12 at 10 22 32 AM Screenshot 2024-12-12 at 10 22 44 AM Screenshot 2024-12-12 at 10 22 55 AM

✅ Pre-approval checklist

  • This PR has an informative and human-readable title.
  • Changes are limited to a single goal - eschew scope creep!
  • All relevant type-of-change labels have been added.
  • I have read the CONTRIBUTING document.
  • These code changes follow cisagov code standards.
  • All new and existing tests pass.

✅ Pre-merge checklist

  • Revert dependencies to default branches.
  • Finalize version.

✅ Post-merge checklist

  • Create a release.

- Added sort to portFacet.
- Added sort to cveFacet.
- Severity levels are now sorted in order of Low, Medium, High, Critical.
- npm run syncdb was not syncing domains on run due to it being nested inside syncdb -- -d populate.
-- Thus changes to local db were not being reflected in the search index.
- Edited severityFacet logic to only show severity filters if there are severity filters to show.
- Added a sort to display severity filters in the following order: N/A, Low, Medium, High, Critical, Other.
- Added data validation logic to group irregular severity values into appropriate categories.
- Null, empty string, N/A, and undefined values are grouped into the "N/A" category.
- Special characters, numbers, and Other are grouped into the "Other" category.
- All categories are case insensitive.
- Edited vulnerability.severity agg in buildRequest.ts to inclues "null" values.
- Increased aggregation size to 50 to include all severity values.
- Removed console.logs.
- Removed commented out code.
- severity filter values are forced to be lowercase.
- N/A value returns Null, N/A, None, undefined, and empty strings.
- Other returns all other values not included in N/A or regular severity level values.
@hawkishpolicy hawkishpolicy changed the title Fix sort of Side Drawer Advance Filters (CRASM-967) Fix Side Drawer Advance Filters (CRASM-967) Jan 24, 2025
@hawkishpolicy hawkishpolicy marked this pull request as ready for review January 24, 2025 18:25
- Vulnerabilities.cve were not included in the searchSync handler that updates Elastic Search. They are now.
- Added some random CVE's for sample data population to aid in testing.
Copy link
Contributor

@aloftus23 aloftus23 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 to me!

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

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.

3 participants