For the complete documentation index, see llms.txt. This page is also available as Markdown.

CodeQL step configuration

Scan code repositories with CodeQL.

You can ingest scan results from CodeQL into Harness STO. The following steps outline the basic workflow:

The CodeQL step supports only Ingestion scan mode, refer to GitHub Advanced Security step documentation for Orchestration and other GHAS tools such as Dependabot, Secret Scanning.

  1. Run a CodeQL scan, either externally or as part of a Run step, and publish the results to SARIF.

  2. Add the SARIF data to your pipeline. If you ran the scan outside the pipeline, do the following:

    1. In the stage where you ingest the results, go to Overview > Shared Paths and create a folder under /shared such as /shared/scan_results.

    2. Use a Run step to add your scan results to the shared folder.

  3. Use a CodeQL step to ingest the results.

This topic includes an end-to-end YAML pipeline that illustrates this workflow.

Important notes for running CodeQL scans in STO

Root access requirements

For more information

CodeQL step settings for STO scans

The recommended workflow is to add a CodeQL step to a Security or Build stage and then configure it as described below.

Scan

Scan mode

Scan configuration

Target

Type

Target and Variant Detection

Name

Variant

Ingestion file

Log Level

Additional CLI flags

Use this field to run the CodeQL scanner binary with additional flags.

Fail on Severity

Settings

Additional Configuration

Advanced settings

CodeQL pipeline example

The following pipeline illustrates a simple ingestion scan. It consists of two steps. A Run step generates an example CodeQL data file in SARIF format. A CodeQL step then ingests the data.

Last updated

Was this helpful?