fix qualys parser: Finding object inconsistencies - use a copy of the issue_row object #9792
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.
Use a copy of the issue_row object for the _temp-Finding variable because otherwise changes in _temp will reflect to issue_row which is a bad idea
We are narrowing the scope of acceptable enhancements to DefectDojo in preparation for v3. Learn more here:
https://github.com/DefectDojo/django-DefectDojo/blob/master/readme-docs/CONTRIBUTING.md
Description
The problem was detected when we uploaded relatively large Qualys Scan results to dojo. All of a sudden the cvss_scores have been set to 0.0 for some findings. We found that the changes that are made to the
_temp
object are automatically transferred to the issue_row object in the parser. Thus fields, such as title, port_status, active, cvss_score and cvss_vector are set in the issue_row variable. For the next finding iteration those values are already present from the previous finding.The issue was detected for cvss_score because here we test if the value is already set in the
split_cvss
function. Thus the "old" cvss_score from the previous finding is used several times.Test results
No tests have been provided.
Checklist
This checklist is for your information.
dev
.dev
.bugfix
branch.Extra information
Please clear everything below when submitting your pull request, it's here purely for your information.
Moderators: Labels currently accepted for PRs:
Contributors: Git Tips
Rebase on dev branch
If the dev branch has changed since you started working on it, please rebase your work after the current dev.
On your working branch
mybranch
:In case of conflict:
When everything's fine on your local branch, force push to your
myOrigin
remote:To cancel everything:
Squashing commits
pick
byfixup
on the commits you want squashed outpick
byreword
on the first commit if you want to change the commit messageForce push to your
myOrigin
remote: