Snyk Issue Api Scan "sca" import implementation#13263
Snyk Issue Api Scan "sca" import implementation#13263mtesauro merged 9 commits intoDefectDojo:devfrom
Conversation
|
@valentijnscholten referencing you for review as well. |
valentijnscholten
left a comment
There was a problem hiding this comment.
Thanks for the PR, it looks good. I have one question around deduplication. I notice that the existing Snyk Scan and Snyk Code Scan have different deduplication settings for the hash code generation. I wonder if this means that our "API" scanners should be two separate parsers to allow each of them to have their own hash code configuration?
|
@valentijnscholten great point, I haven't actually focused on deduplication feature, let me spend more time testing that part. Also if I may ask leading question:
|
|
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
|
Conflicts have been resolved. A maintainer will review the pull request shortly. |
|
So I took a look at de-duplication of snyk plugins, and I can say that it is impossible to match those results, the way it is currently implemented:
Below are example values for the fields, for reference: Tools / Snyk / Parser (SCA)
API Parser - SCA
Tools / Snyk Code / Parser (SAST)
API Parser - Code / SAST
|
* implementation * docu update * removed unnecessary tests to ruff it out * deduplication for snyk api fields added * tests update * ruff --------- Co-authored-by: valentijnscholten <valentijnscholten@gmail.com>






Description
This code implements "sca" ( as opposed to "code" ) import feature for "Snyk Issue Api Scan" tool.
So we can only get if issue is "ignored", "open" or "resolved".
You cannot distinguish between "Not Vulnerable, Won't Fix, or Accepted".
With what we have from .json file:
--
See table below for transitions.
Test results
I've extracted / updated 2 test files:
test_snyk_issue_api_parser.py- unit tests - atomic feature teststest_snyk_issue_api_parser_with_json.py- line by line comparison of input Json and resulting finding, so it would be easy to follow value comparison.Snyk issue transition state table:
Below is table transitioning from Open -> Ignored and Back.
Documentation
Updated contents of:
docs/content/en/connecting_your_tools/parsers/file/snyk_issue_api.md
Checklist
This checklist is for your information.
dev.dev.bugfixbranch.