Skip to content

Fix Qualys parser to prevent merging findings on different ports#14269

Open
ArnaavSinghSandhu wants to merge 2 commits intoDefectDojo:masterfrom
ArnaavSinghSandhu:fix-qualys-port-deduplication
Open

Fix Qualys parser to prevent merging findings on different ports#14269
ArnaavSinghSandhu wants to merge 2 commits intoDefectDojo:masterfrom
ArnaavSinghSandhu:fix-qualys-port-deduplication

Conversation

@ArnaavSinghSandhu
Copy link

Description
Fix: Qualys Infrastructure Scan merging findings on different ports.

Currently, the Qualys parser collapses multiple findings of the same QID into a single finding if they occur on the same host, even if they are on different ports (e.g., a vulnerability found on both port 80 and port 443). This results in data loss during the import process.

This PR implements the following:

Updated parse_finding in dojo/tools/qualys/parser.py to correctly extract the tag from the Qualys XML.

Correctly maps these ports to the unsaved_endpoints and unsaved_locations attributes of the Finding object.

Ensures that findings remain distinct in DefectDojo by recognizing the unique port/endpoint combination.

Test results
I have verified this fix using the following steps:

New Unit Test: Added test_parse_file_with_multiple_ports_for_same_qid to unittests/tools/test_qualys_parser.py.

Sample Data: Created unittests/scans/qualys/test_qualys.xml which contains a single QID assigned to two different ports on the same host.

Execution: Ran the unit test suite inside the Docker environment.

Result: Ran 1 test in 0.009s. OK. The parser now correctly identifies 2 distinct findings instead of 1.
Screenshot 2026-02-08 at 10 15 38 PM

Documentation
No documentation changes are required as this is a bug fix for existing parser logic to bring it in line with expected DefectDojo behavior.

Checklist
[x] Bugfixes should be submitted against the bugfix branch.

[x] Give a meaningful name to your PR.

[x] Your code is flake8 compliant.

[x] Add applicable tests to the unit tests.

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.

1 participant