IALERT-3910 - Add ability to set code location name #30
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.
PROBLEM: When scanning Docker images, Detect uses the name of the version of the image as part of the scan location name. In the case of Alert, we do 'QA releases'. So, prior to release, we could have multiple versions for the images, meaning each will create a unique scan location name. This also means that if we address vulnerable dependencies in one QA version, they will still be present in the BOM because of the unique versioning we use. Detect already has the ability to address this with the option
--detect.code.location.name. See screenshot below for the number of scan locations we have for Alert 8.0.0SOLUTION: This change adds a boolean parameter to
DockerImage.groovy. If set to true, this will append--detect.code.location.name=parameter, with the image org, name, and "cleaned" version. The cleaned version is the version with -SIGQA and -SNAPSHOT stripped off. So this means if the input image isblackducksoftware/blackduck-alert:9.0.0-SNAPSHOT, this process will append--detect.code.location.name=blackducksoftware_blackduck-alert_9.0.0to the process. This was tested with the Alert 9.0.0 images.