Use CloudBees platform’s security scanning features to maintain the security and integrity of your software assets. Configure your Jenkinsfile to run a security scan with a variety of popular tool types, including software composition analysis (SCA), static application security testing (SAST), and secret scanning. You can also set up automatic, implicit analysis of your integrated CI pipeline source code, ensuring that your software is continually assessed for vulnerabilities and risks.
Prerequisites
Set up CloudBees platform and your CI controller to work together. For more information, including technical requirements and limitations, refer to Getting started.
Set up security scanning on your Multibranch Pipeline
Set up your Jenkinsfile to install scanning tools, run scans, and publish security scan reports for ingestion to CloudBees platform, to leverage its enhanced analytics.
To enable security scan reports from your CI build to CloudBees platform:
-
Complete the five steps in CloudBees CI / Jenkins® and CloudBees platform: Getting started.
Scanning tool | Type |
---|---|
Black Duck |
SCA |
Checkov |
SAST |
CodeQL |
SAST |
findsecbugs |
SAST |
Gitleaks |
Secrets |
Gosec |
SAST |
Grype |
SAST |
njsscanner |
SAST |
Snyk |
SAST |
Trivy |
Container |
Configure your Jenkinsfile to install, run, and publish scans
In your Jenkinsfile, execute a shell command with sh
containing the CLI command for the selected security tool.
The output report must be archived as SARIF (Static Analysis Results Interchange Format), an OASIS Standard format. SARIF is a widely accepted standard used for sharing results from static analysis tools, especially in CI/CD environments.
Usage examples
Use the following examples as a guide to set up your security scans.
Jenkinsfile example that uses the Black Duck scanner.
Add the following steps to your Jenkinsfile to install, run, and publish the results of a Black Duck scan to CloudBees platform.
1 | Download and extract Bridge CLI. Use Black Duck Bridge, not Black Duck Detect, for scanning. |
2 | Run the scan with SARIF output.
The shell command should be formed as above.
You must include blackducksca_reports_sarif_groupSCAIssues=false . |
3 | Check the SARIF report. |
Jenkinsfile example that uses the Checkov scanner.
Add the following steps to your Jenkinsfile to install, run, and publish the results of a Checkov scan to CloudBees platform.
1 | Install the scanner. |
2 | Run the scan. |
3 | Format the report in SARIF. |
Jenkinsfile example that uses the Grype scanner.
Add the following steps to your Jenkinsfile to install, run, and publish the results of a Grype scan to CloudBees platform.
1 | Install the scanner. |
2 | Run the scan. |
3 | Format the report in SARIF. |
Run an automatically triggered implicit scan of your source code
Implicit scanning in the CloudBees platform refers to the automatic security analysis of source code without requiring explicit user intervention. This process ensures continuous security checks by automatically triggering scans whenever certain events occur, such as:
-
The creation of a new component.
-
Committing changes in a connected repository.
-
Generating an artifact from a CI build.
Enable implicit security scanning to provide ongoing security monitoring.