Skip to content

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

Closed
ArnaavSinghSandhu wants to merge 26 commits intoDefectDojo:masterfrom
ArnaavSinghSandhu:fix-qualys-port-deduplication
Closed

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

Conversation

@ArnaavSinghSandhu
Copy link
Copy Markdown

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.

Oscar Martinez and others added 15 commits January 31, 2026 10:50
….55.0-2.56.0-dev

Release: Merge back 2.55.0 into dev from: master-into-dev/2.55.0-2.56.0-dev
Bumps [pyjwt](https://github.com/jpadilla/pyjwt) from 2.10.1 to 2.11.0.
- [Release notes](https://github.com/jpadilla/pyjwt/releases)
- [Changelog](https://github.com/jpadilla/pyjwt/blob/master/CHANGELOG.rst)
- [Commits](jpadilla/pyjwt@2.10.1...2.11.0)

---
updated-dependencies:
- dependency-name: pyjwt
  dependency-version: 2.11.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…ocker-compose.yml) (DefectDojo#14223)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
…43 (.github/workflows/renovate.yaml) (DefectDojo#14222)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Signed-off-by: kiblik <5609770+kiblik@users.noreply.github.com>
…efectDojo#14214)

Bumps [datatables.net](https://github.com/DataTables/Dist-DataTables) from 2.3.6 to 2.3.7.
- [Release notes](https://github.com/DataTables/Dist-DataTables/releases)
- [Commits](DataTables/Dist-DataTables@2.3.6...2.3.7)

---
updated-dependencies:
- dependency-name: datatables.net
  dependency-version: 2.3.7
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…3.11 to v (dockerfile.integration-tests-debian) (DefectDojo#14233)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
….55.1-2.56.0-dev

Release: Merge back 2.55.1 into dev from: master-into-dev/2.55.1-2.56.0-dev
…rfile.nginx-alpine) (DefectDojo#14245)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
…2.11 to v (docker-compose.yml) (DefectDojo#14252)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
rossops and others added 7 commits February 9, 2026 08:53
…dded-email-template

Fix email template rendering for product_type_added notification
….55.2-2.56.0-dev

Release: Merge back 2.55.2 into dev from: master-into-dev/2.55.2-2.56.0-dev
Bumps [ruff](https://github.com/astral-sh/ruff) from 0.14.14 to 0.15.0.
- [Release notes](https://github.com/astral-sh/ruff/releases)
- [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md)
- [Commits](astral-sh/ruff@0.14.14...0.15.0)

---
updated-dependencies:
- dependency-name: ruff
  dependency-version: 0.15.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
….12 to v (dockerfile.nginx-alpine) (DefectDojo#14263)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
…3.12 to v (dockerfile.integration-tests-debian) (DefectDojo#14264)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

@Maffooch Maffooch left a comment

Choose a reason for hiding this comment

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

This PR needs to be rebased against dev or bugfix. If there are extra unrelated commits in the PR as a result, best advice is to close the PR and open a new one based from the desired branch

Comment thread dojo/tools/qualys/parser.py Outdated
return [
"title",
"severity",
"endpoints",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
"endpoints",

The dedupelication fields are not being updated here (and they should not be) so this should be removed

Bumps [setuptools](https://github.com/pypa/setuptools) from 80.10.2 to 82.0.0.
- [Release notes](https://github.com/pypa/setuptools/releases)
- [Changelog](https://github.com/pypa/setuptools/blob/main/NEWS.rst)
- [Commits](pypa/setuptools@v80.10.2...v82.0.0)

---
updated-dependencies:
- dependency-name: setuptools
  dependency-version: 82.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown
Contributor

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@github-actions
Copy link
Copy Markdown
Contributor

Conflicts have been resolved. A maintainer will review the pull request shortly.

@ArnaavSinghSandhu
Copy link
Copy Markdown
Author

Hi @Maffooch, thanks for the review. You're right—the branch has drifted too far and picked up unrelated commits during the rebase attempt. I'm going to close this PR now and open a fresh one against the dev branch with the requested change (removing 'endpoints' from dedupe fields) to keep the history clean

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.

4 participants