Rapid Scan Static allows Polaris users to perform fast and lightweight static analysis scans in your CI/CD pipeline. The Rapid Scan Static feature downloads the Black Duck Rapid Scan Static tool (Sigma) to the system on which the scan is performed. For example, if you use Bridge to trigger Rapid Scan Static on your build server, the Sigma tool will be downloaded to that server, and it will run the scan. Rapid Scan Static is built for speed, making it suitable for performing scans early and often.
Before you begin, please review SAST Capture File Types and Supported Frameworks (Rapid Scan Static) for basic requirements.
CLI instructions
We will walk through the steps to run a rapid scan in the CLI.
-
You will need the following parameters:
Table 1. List of mandatory parameters for rapid scan SAST Input parameter Description Mandatory / optional BRIDGE_POLARIS_ACCESSTOKENEnvironment variable to pass sensitive information such as your password or access token to Bridge CLI (recommended for security purposes). Note that Bridge CLI automatically picks up values passed through this environment variable. Mandatory --stageSpecifies the Black Duck security product you are integrating with. Mandatory polaris.serverurlYour Polaris server URL. Mandatory polaris.application.nameName for Polaris application. The specified application must exist on Polaris with appropriate entitlements. Mandatory polaris.project.nameName for Polaris project. If the project doesn’t exist on Polaris, it’ll be created. If you don’t want the project to be created, set polaris.onboardingtofalse.Mandatory polaris.branch.nameBranch name in the Polaris server. Bridge will error out if a branch name is not provided. If the branch doesn’t exist in Polaris, Bridge will create the branch. If you don’t want the branch to be created in Polaris, set
polaris.onboardingtofalse..Mandatory polaris.assessment.typesSpecifies the type of test to be run: SASTSCASAST,SCA
Mandatory polaris.test.sast.typeThis parameter allows you to run a full SAST scan, or a rapid SAST scan. If this parameter is not set, the default value will be used. Default value:
SAST-FULLAcceptable values:SAST-FULLSAST-RAPID
Optional (This parameter is optional forSAST-FULLscans, but it is mandatory forSAST-RAPIDscans.)Important: Before you can test a project with Rapid Scan Static, a full SAST test (using the latest version of Coverity that Polaris supports) must be completed. If you attempt to run a rapid scan before a full SAST test is completed, Bridge starts a full SAST scan automatically. The full SAST scan must be run with the latest version of Coverity that Polaris supports. This ensures your project has the necessary baseline before performing rapid scans. - Make your Polaris access token available as an environment variable.
export BRIDGE_POLARIS_ACCESSTOKEN=<POLARIS_ACCESSTOKEN>Note: You can use either a user access token (created in the Polaris UI) or a service account token here. - Use the Bridge CLI to run a rapid scan. Example:
bridge-cli --stage polaris polaris.project.name="<PROJECT_NAME>" \ polaris.branch.name="<BRANCH_NAME>" \ polaris.application.name="<APPLICATION_NAME>" \ polaris.serverurl="<SERVERURL>" \ polaris.assessment.types=SAST \ polaris.test.sast.type=SAST-RAPIDImportant: Before you can test a project with Rapid Scan Static, a full SAST test (using the latest version of Coverity that Polaris supports) must be completed. If you attempt to run a rapid scan before a full SAST test is completed, Bridge starts a full SAST scan automatically. The full SAST scan must be run with the latest version of Coverity that Polaris supports. This ensures your project has the necessary baseline before performing rapid scans. - When the scan completes successfully, the results will be available in your Polaris dashboard.