Read name and version for Dependecy-Track from scan annotations#2062
Merged
o1oo11oo merged 2 commits intosecureCodeBox:mainfrom Nov 7, 2023
Merged
Conversation
added 2 commits
October 20, 2023 19:00
Instead of relying on the brittle docker image reference parsing, read the project name and version for sending the SBOM to Dependency-Track from annotations, simmilar to how other hooks (especially DefectDojo) already do this. If the annotations are missing fall back to the regex. The annotations use _project_ instead of _product_ because that is the terminology Dependency-Track uses. Signed-off-by: Lukas Fischer <lukas.fischer@iteratec.com>
Now that the Dependency-Track hook supports reading the project name and version from scan annotations, set the name and version of the docker image as annotations on the scan. Signed-off-by: Lukas Fischer <lukas.fischer@iteratec.com>
✅ Deploy Preview for docs-securecodebox canceled.
|
J12934
approved these changes
Nov 7, 2023
Member
J12934
left a comment
There was a problem hiding this comment.
wasn't able to test it myself, but this looks good 👍
would it be possible to also make this parsed image information available for the k8s container auto discovery? would probably be also be useful there and be good to have this consistent for both of our containery auto-discoveries?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Adds two possible scan annotations that the Dependency-Track hook checks to get the name and the version for matching/creating the project in Dependency-Track:
dependencytrack.securecodebox.io/project-namedependencytrack.securecodebox.io/project-versionIf the annotations are not available the name defaults to the docker image repository, the version defaults to the tag, digest and
latestin that order.This also configures the AWS Cloud AutoDiscovery to set the name and version as annotations for the SBOM scans it generates.
Closes #2061
Checklist