Add mitigation finding filters and complete mitigation filter tests#14790
Open
bendnema wants to merge 6 commits intoDefectDojo:devfrom
Open
Add mitigation finding filters and complete mitigation filter tests#14790bendnema wants to merge 6 commits intoDefectDojo:devfrom
bendnema wants to merge 6 commits intoDefectDojo:devfrom
Conversation
|
This pull request includes sensitive edits to
🔴 Configured Codepaths Edit in
|
| Vulnerability | Configured Codepaths Edit |
|---|---|
| Description | Sensitive edits detected for this file. Sensitive file paths and allowed authors can be configured in .dryrunsecurity.yaml. |
🔴 Configured Codepaths Edit in dojo/filters.py (drs_348e4a34)
| Vulnerability | Configured Codepaths Edit |
|---|---|
| Description | Sensitive edits detected for this file. Sensitive file paths and allowed authors can be configured in .dryrunsecurity.yaml. |
We've notified @mtesauro.
Comment to provide feedback on these findings.
Report false positive: @dryrunsecurity fp [FINDING ID] [FEEDBACK]
Report low-impact: @dryrunsecurity nit [FINDING ID] [FEEDBACK]
Example: @dryrunsecurity fp drs_90eda195 This code is not user-facing
All finding details can be found in the DryRun Security Dashboard.
82c2216 to
53fcf5e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR covers and addresses the existing issue #14558, and is within acceptable contribution scope as a bugfix/enhancement to existing filtering behavior and added/improved tests.
Description
This PR adds mitigation filtering support for Findings and validates that behavior with comprehensive unit tests.
Implementation:
mitigation_availableboolean filtering to finding filters.mitigationtext filtering (icontains) for mitigation content search.mitigation_available=true→ findings with mitigation set (non-null, non-empty string)mitigation_available=false→ findings with mitigation unset (null or empty string)mitigation=<text>→ case-insensitive partial text matching in mitigationCoverage is applied across API/UI/report finding filter paths through existing filter classes.
This PR also completes mitigation filter test coverage and ensures test data setup is valid for finding creation and FK constraints, tests can be found in
dojo/unittests/test_filter_finding_mitigation.pyRelated to #14556
Test results
Executed and passing:
docker compose run --rm --entrypoint "" uwsgi python manage.py test unittests.test_filter_finding_mitigation -v 2Ran 15 tests ... OKdocker compose -f docker-compose.yml -f docker-compose.override.unit_tests.yml run --rm --entrypoint "" uwsgi python3 manage.py test unittests.test_finding_group_filter_context -v 2Ran 7 tests ... OKMitigation test coverage includes:
mitigation_available=true/falseDocumentation
No documentation updates required:
Checklist
This checklist is for your information.
dev.dev.bugfixbranch.