Skip to content

Improve GitLab dependency scanning parser - #3786

Merged
damiencarol merged 7 commits into
DefectDojo:devfrom
macedogm:patch-1
Feb 4, 2021
Merged

damiencarol merged 7 commits into
DefectDojo:devfrom
macedogm:patch-1

Conversation

@macedogm

@macedogm macedogm commented Feb 3, 2021

Copy link
Copy Markdown
Contributor
  1. Improve GitLab dependency scanning parser, adding component name and version for the findings.
  2. Removed SAST components, since they are not present in this kind of report.

Current findings from GitLab dependency scanning have this structure:
image

Now they will appear as:
image

Improve GitLab dependency scanning parser, adding component name and version for the findings. Removed SAST components, since they are not present in this kind of report.

@valentijnscholten valentijnscholten left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

thanks. can you add some checks to make the parser not raise an expcetion if these fields aren't present in the report?

@macedogm

macedogm commented Feb 3, 2021

Copy link
Copy Markdown
Contributor Author

Thanks for the quick feedback @valentijnscholten .
That's an interesting point that I was thinking about. According to GitLab's Dependency Scanning documentation, those fields must be present, otherwise the finding would not make much sense.
Do you still find prudent to add the checks anyway?

@damiencarol

damiencarol commented Feb 3, 2021 •

Copy link
Copy Markdown
Contributor

also as you are adding more data to findings, could you add more checks in the unit tests on these attributes?

@valentijnscholten

Copy link
Copy Markdown
Member

Thanks for the quick feedback @valentijnscholten .
That's an interesting point that I was thinking about. According to GitLab's Dependency Scanning documentation, those fields must be present, otherwise the finding would not make much sense.
Do you still find prudent to add the checks anyway?

Yes. Everytime I agree not to add any checks, the parser has failed 3 weeks later and the PR author was gone and we had to deal with the slack support, github issues, bugfix PRs etc. The parsers should really be made fool proof otherwise we can't keep up.

Add checks in case the fields are missing in the report.
@macedogm

macedogm commented Feb 3, 2021

Copy link
Copy Markdown
Contributor Author

@valentijnscholten Can you please reopen the PR?
I was about to add the checks and test data. Just didn't had enough time to update before you closed it.

@valentijnscholten

valentijnscholten commented Feb 3, 2021 •

Copy link
Copy Markdown
Member

@macedogm I didn't mean to close it, sorry. Must have misclicked or something. Sorry!

Add unit test for GitLab Dependency Scanning report without component fields in 'vulnerabilities' - package 'name' and 'version‘.
Add unit test for GitLab Dependency Scanning report without component fields in 'vulnerabilities' - package 'name' and 'version‘.
@macedogm

macedogm commented Feb 3, 2021

Copy link
Copy Markdown
Contributor Author

No worries @valentijnscholten and thanks for reopening the PR.
I've added the checks and also a unit test. Please let me know if everything is as expected or not.

Additionally, could you also review the PRs DefectDojo/Documentation#173 and DefectDojo/sample-scan-files#69 to update the documentation regarding the new integration and to add the sample scan files, respectively, please?

@valentijnscholten

Copy link
Copy Markdown
Member

thanks for the PR, just one more approval needed....

@damiencarol
damiencarol merged commit 6cb5f44 into DefectDojo:dev Feb 4, 2021
@damiencarol damiencarol added this to the 1.13.0 milestone Feb 4, 2021
@macedogm
macedogm deleted the patch-1 branch February 4, 2021 14:47
9alexx3 pushed a commit to 9alexx3/django-DefectDojo that referenced this pull request Aug 12, 2026
* Improve GitLab dependency scanning parser, adding component name and version for the findings.
* Removed SAST components, since they are not present in this kind of report.
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.

3 participants