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:
Run a CodeQL scan, either externally or as part of a Run step, and publish the results to SARIF.
Add the SARIF data to your pipeline. If you ran the scan outside the pipeline, do the following:
In the stage where you ingest the results, go to Overview > Shared Paths and create a folder under
/sharedsuch as/shared/scan_results.Use a Run step to add your scan results to the shared folder.
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?