-
Notifications
You must be signed in to change notification settings - Fork 14
MLE-22024: Add BlackDuck scan for latest images #359
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
base: develop
Are you sure you want to change the base?
Conversation
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.
Pull Request Overview
This PR adds a dedicated BlackDuck security scan for Docker images built on the master branch by defining a new scan function and integrating it into the pipeline.
- Introduces
masterBranchBlackDuckScan()
function to run, archive, and notify on detailed BlackDuck scans - Updates the existing develop-stage BlackDuck scan to skip master builds
- Adds a new
Master-BlackDuck-Scan
stage that invokes the comprehensive scan on master
Jenkinsfile
Outdated
*/ | ||
void masterBranchBlackDuckScan() { | ||
// Create directory for scan results | ||
sh "mkdir -p blackduck-scan-results" |
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.
[nitpick] Consider cleaning or removing any existing blackduck-scan-results
directory before creating it (e.g., rm -rf blackduck-scan-results && mkdir -p blackduck-scan-results
) to avoid stale artifacts from previous runs.
sh "mkdir -p blackduck-scan-results" | |
sh "rm -rf blackduck-scan-results && mkdir -p blackduck-scan-results" |
Copilot uses AI. Check for mistakes.
Jenkinsfile
Outdated
export BLACKDUCK_URL='https://progresssoftware.app.blackduck.com' | ||
export BLACKDUCK_API_TOKEN='${BLACKDUCK_TOKEN}' | ||
|
||
# Run detect script for Docker image scan | ||
curl -s -L https://detect.synopsys.com/detect8.sh | bash -s -- \ | ||
--blackduck.trust.cert=true \ | ||
--detect.tools=DOCKER \ | ||
--detect.project.name='MarkLogic-Docker-Images' \ |
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.
[nitpick] The BlackDuck URL (and similarly the project name later) is hardcoded in multiple places; extract these values into variables or parameters at the top of the script to reduce duplication and simplify future updates.
export BLACKDUCK_URL='https://progresssoftware.app.blackduck.com' | |
export BLACKDUCK_API_TOKEN='${BLACKDUCK_TOKEN}' | |
# Run detect script for Docker image scan | |
curl -s -L https://detect.synopsys.com/detect8.sh | bash -s -- \ | |
--blackduck.trust.cert=true \ | |
--detect.tools=DOCKER \ | |
--detect.project.name='MarkLogic-Docker-Images' \ | |
export BLACKDUCK_URL='${blackDuckURL}' | |
export BLACKDUCK_API_TOKEN='${BLACKDUCK_TOKEN}' | |
# Run detect script for Docker image scan | |
curl -s -L https://detect.synopsys.com/detect8.sh | bash -s -- \ | |
--blackduck.trust.cert=true \ | |
--detect.tools=DOCKER \ | |
--detect.project.name='${blackDuckProjectName}' \ |
Copilot uses AI. Check for mistakes.
Description
Checklist:
Owner:
JIRA_ID as part of branch/PR name
Rebase the branch with upstream
Squashed all commits into a single commit
Added Tests
Reviewer:
Reviewed Tests
Added to Release Wiki/Jira