Bamboo Configuration
This example demonstrates how to set up a Bamboo plan that runs both SCA and SAST scans using Docker images hosted in Azure Container Registry (ACR). The configuration includes authentication to the ACR, pulling the scanner images, and executing the scans.- Define a Bamboo Plan with a Scan Job
- Create a Bamboo Plan and Stage with a Job that to run the security scan.
- Add Source Code Checkout task
- Add a Source Code Checkout task to check out the code from your repository. This is necessary for the scanner to access the source code.
- Add Script task.
- In the Script body field, paste the following code into your script.
- Save the configuration.
- Run the Pipeline
- Trigger a build in Bamboo to run the pipeline.
- Check the logs to ensure the scan completes successfully.
Explanation of the Configuration
- Docker Login
- Uses docker login to authenticate with a private registry.
- Pull the Image
- Fetches the latest version of sls-scanner from the container registry.
- Run the SLS Scanner
- Mounts the source code into the container.
- Executes the scan.
- The scan key for the asset (repo) is passed as an argument to the scanner.
- —secrets=true is used to enable secret scanning in the SAST scanner.
- Upon completion, uploads only the results into the SLS platform and destroys the container.
- Environment Variables - The following must be added to the plan configuration as environment variables:
- SLS_CLIENT_ID , SLS_CLIENT_SECRET - used to authenticate to Azure Container Registry and provided by SLS.
- SLS_SCAN_KEY - Can be found under Product Data Sources -> Start Left Scanner -> Scan Key (It is also available on the Asset details page.) The job will pass the SLS_SCAN_KEY to the scanner as an environment variable adn is used to identify the asset being scanned.