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:

  1. Be automatically scanned for security vulnerabilities using Polaris by Black Duck.

  2. Upload the scan results in SARIF format onto GitHub.

  3. Trigger Mobb to analyze the findings and provide fixes.

  4. Allow developers to review and apply fixes directly within GitHub.

Prerequisites

Before starting this integration, you will need:

Initial Setup - Secrets and Variables

Store the following in your GitHub repository under Settings -> Secrets and variables -> Actions:

Name
Type
Description

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

circle-exclamation
circle-info

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.

circle-info

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