Bridge can create SAST Fix Pull Requests (Fix PRs) from Polaris SAST scan results in CI workflows. Each Fix PR contains an AI-generated code fix for one static analysis vulnerability detected by a full baseline SAST scan on a monitored branch, such as main, develop, staging, or release.
When a full baseline SAST scan completes on a monitored branch, Bridge evaluates eligible SAST issues, applies the Fix PR severity and count filters, and creates Fix PRs in the configured SCM repository. Each Fix PR contains an AI-generated fix for one selected SAST vulnerability.
If both SAST and SCA Fix PRs are enabled, SAST issues are evaluated before SCA issues. The polaris.fixPR.maxCount value applies across both SAST and SCA assessment types.
When Fix PRs are enabled, Bridge selects issues in the following order:
- SAST issues are evaluated before SCA issues.
- Dismissed issues are excluded.
- The
polaris.fixPR.filter.severitiesallow list is applied. - Issues are sorted by severity in descending order.
- Issues with earlier first-detected dates are selected before newer issues. Issues without first-detected dates are selected last.
- The first issues up to
polaris.fixPR.maxCountare selected.
Prerequisites
- Bridge CLI 4.5.0 or newer.
- Read the related information links:
- Commands for integrating Bridge to connect with Polaris and a Source Code Management system (SCM) to raise Fix Pull Requests
- Polaris prerequisites
- Access to the SCM repository where Bridge Polaris will create Fix PRs.
- To enable Bridge CLI to create Fix PRs in an SCM repository, an access token is required. This can be an ephemeral build token if Bridge CLI is used directly in a CI pipeline or a Personal Access Token (PAT).
- The following secrets are required:
Secret Description BRIDGE_POLARIS_ACCESSTOKENPolaris access token to enable Bridge CLI to integrate with a Polaris server. Access token A Source Code Management system (SCM) ephemeral build token or Personal Access Token (PAT) that allows Bridge to raise Fix PRs. The token should be configured with permission to create pull requests in the target repository. Consult Complete list of Bridge arguments to determine the Bridge environment variable for the appropriate SCM system, for example,
BRIDGE_GITHUB_USER_TOKENfor GitHub.
Required parameters
The following configuration parameters are required for Polaris SAST Fix PRs.
| Parameter | Description |
|---|---|
BRIDGE_POLARIS_ACCESSTOKEN |
Environment variable that provides the Polaris access token at runtime. This value can be stored as a CI secret. |
polaris.serverUrl |
URL of the Polaris server. |
polaris.application.name |
Name of the Polaris application. |
polaris.project.name |
Name of the Polaris project. The type of Polaris project should support SAST scanning of branches. |
polaris.branch.name |
Name of the monitored branch, such as main.Note: If a SAST Fix PR scan is run on a pull request, Bridge CLI logs a warning and does not create Fix PRs.
|
polaris.assessment.types |
Must include SAST, for example SAST or SAST,SCA. |
polaris.fixPR.enabled |
Must be set to true to enable Fix PRs. |
Optional parameters
The following parameters are optional.
| Parameter | Description |
|---|---|
polaris.fixPR.filter.severities |
By default, Fix PRs are raised for CRITICAL and HIGH severity issues. This applies to both SAST and SCA. The severity filter can include any combination of CRITICAL, HIGH, MEDIUM, and LOW, such as MEDIUM,LOW. |
polaris.fixPR.maxCount |
By default, a maximum count of five Fix PRs can be raised across both SAST and SCA scans, with SAST evaluated first. Dismissed issues are excluded, then the polaris.fixPR.filter.severities allow list is applied. Issues are sorted by severity (descending) and first-detected date (ascending, with undated issues last), and only the first maxCount results are selected. |
polaris.test.sast.location |
Controls where SAST capture and analysis are performed for Fix PR workflows. Valid values are:
|
Instructions
Perform the following steps to create SAST Fix PRs with Bridge and Polaris.
Bridge creates Fix PRs in the configured source code repository for eligible SAST issues on the monitored branch.