-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mend SCA imports contain locations which are similar to filePaths for SAST scans #11001
Mend SCA imports contain locations which are similar to filePaths for SAST scans #11001
Conversation
add impact since it is unused
DryRun Security SummaryThe provided code changes address several security-related improvements to the application's security scanning and vulnerability reporting capabilities, including the introduction of a new JSON file containing information about a security vulnerability, improvements to the parsing and deduplication logic in the Expand for full summarySummary: The provided code changes address several security-related improvements to the application's security scanning and vulnerability reporting capabilities. The first change introduces a new JSON file containing information about a security vulnerability found in the The second change improves the parsing and deduplication logic in the The third change introduces a new unit test case to verify the parsing of a Mend scan report that includes a Software Composition Analysis (SCA) vulnerability finding. This helps to ensure the robustness and reliability of the Files Changed:
Code AnalysisWe ran Riskiness🟢 Risk threshold not exceeded. |
0125e97
to
6c91f28
Compare
The force push was to rebase my branch against upstream/dev, vs upstream/master, as I accidentally made my branch originally off of the master branch and not dev. Apologies. |
6c91f28
to
905350b
Compare
905350b
to
05431b2
Compare
05431b2
to
354f488
Compare
… the SAST scans This code will use the 'locations' for SCA scan outputs to do the same thing that's done for SAST 'filePaths'. Since a Finding report will either be from SAST or SCA, it is unlikely that a collision will happen, since those findings are inherently different from Mend. Since the filepaths is already being joined for the SAST implementation, if it is indeed SCA results instead, the same thing will happen except now with the appropriate locations of the library and vulnerability. Note: this is not from Mend Platform or the CLI Agent output, but rather the Mend SCA portal. There is a new Platform API that combines both SAST and SCA vulnerabilities, so a new parser at some point for that would be good, and then it's possible to rename this to 'Legacy' for the Mend parser, since the 'Platform' should be the new.
Mend has gone through some updates. Historically they've been SAST and then SCA, with their own separate portals. They are joining to a Mend Platform that contains both SAST+SCA+other vulnerabilities. This parser originally looks like it was based on Mend SAST, but I have been using it for SCA also since the vulnerabilities.json output files were similarly structured. This parser change hopes to update this to extract the location and path from an SCA.json and provide that as the file path. SAST calls this in a different way than SCA, which is why I think file path can be reused for both - depending on the file context found. I hope this code reflects that goal. To note: this was not a CLI or Unified Agent generated output file, but rather from downloading the Mend SCA portal API vulnerability data and uploading the returned vuln.json files using this parser. There may be a need in the future to add a parser that can correctly accept the updated format from the Mend Portal which contains combined vulnerability data sets, and the API response .json is different, so the parser does not work for the new Mend Platform returned .json, as experienced.
354f488
to
72c6a87
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved
This code will use the 'locations' for SCA scan outputs to do the same thing that's done for SAST 'filePaths'. Since a Finding report will either be from SAST or SCA, it is unlikely that a collision will happen, since those findings are inherently different from Mend. Since the filepaths is already being joined for the SAST implementation, if it is indeed SCA results instead, the same thing will happen except now with the appropriate locations of the library and vulnerability.
Note: this is not from Mend Platform or the CLI Agent output, but rather the Mend SCA portal. There is a new Platform API that combines both SAST and SCA vulnerabilities, so a new parser at some point for that would be good, and then it's possible to rename this to 'Legacy' for the Mend parser, since the 'Platform' should be the new.
Test results
I've added a scrubbed sample file and unit test.
Documentation
I can update the respective documentation with regards to these changes.