Skip to content

Fix Duplicate Findings in Github SAST Scan by Improving Hash Code#13683

Draft
Logicmn wants to merge 10000 commits intoDefectDojo:devfrom
Logicmn:github-sast-hash-code
Draft

Fix Duplicate Findings in Github SAST Scan by Improving Hash Code#13683
Logicmn wants to merge 10000 commits intoDefectDojo:devfrom
Logicmn:github-sast-hash-code

Conversation

@Logicmn
Copy link
Copy Markdown
Contributor

@Logicmn Logicmn commented Nov 11, 2025

Description

This is an update to the fields used to generate the hash code for Github SAST Scan findings. As explained in this issue, currently the line field is used in the hash code. Since these alerts in change lines in GitHub often, it creates duplicate findings for the same alert when re-uploading a scan.

To fix this, I propose replacing the line field with the url field in the hash code. The format of the url field is:
https://github.com/OWASP/test-repository/security/code-scanning/35

This includes the organization, the repository, as well as the alert id. Because the alert id is only unique at the repository level, including only the alert id would not be enough; The organization and repository name is necessary as well. The url field conveniently contains all three. The url field is already populated by the parser, which pulls it from the html_url field in the GitHub alert. It can be expected that this field will always exist.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

conflicts-detected docs pending-closure settings_changes Needs changes to settings.py based on changes in settings.dist.py included in this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.