GitHub Fixer for Polaris
Introduction
This guide provides step-by-step instructions on how to set up a GitHub Actions workflow that runs a Polaris SAST scan and automatically fixes vulnerabilities using Mobb.
Goal
Once this integration is complete, you will achieve the following:
Be automatically scanned for security vulnerabilities using Polaris by Black Duck.
Upload the scan results in SARIF format onto GitHub.
Trigger Mobb to analyze the findings and provide fixes.
Allow developers to review and apply fixes directly within GitHub.
Prerequisites
Before starting this integration, you will need:
A Polaris account with an active access token. See Generating a Polaris Access Token for instructions.
GitHub Advanced Security enabled for your repository (required for SARIF upload).
A Mobb API Token. See Generating a Mobb API Token for instructions.
Initial Setup - Secrets and Variables
Store the following in your GitHub repository under Settings -> Secrets and variables -> Actions:
POLARIS_ACCESS_TOKEN
Secret
Your Polaris access token
MOBB_API_TOKEN
Secret
Your Mobb API token
POLARIS_SERVER_URL
Variable
Your Polaris server URL (e.g. https://polaris.blackduck.com)
Sample GitHub Action YAML
Example - Full Scan + Mobb autofixer triggered manually
Polaris SARIF report generation is not supported for Pull Request scans. This workflow should only be triggered on push events or manually via workflow_dispatch. Enabling it on pull_request events will result in no SARIF being generated.
The SARIF report is written to .blackduck/integrations/polaris/sarif/report.sarif.json when using Bridge CLI version 3.5.0 or later. If you are using an older version of Bridge, the path will be .bridge/Polaris SARIF Generator/report.sarif.json — update the sarif_file and report-file fields accordingly.
For projects that require compilation (e.g. Java with Maven or Gradle), add the appropriate coverity_build_command and coverity_clean_command parameters to the Polaris scan step. See Generating a Polaris SAST Report for examples.
Last updated