cognium Buildkite plugin
Buildkite plugin for cognium, the open-source checking engine behind Cognium Autonomous Loop. It runs cognium scan (deterministic static analysis with taint tracking, SARIF output) in your pipeline.
v2.0.0 moves from
cognium-devtocognium5.cognium-devis replaced bycognium; the options below are unchanged, andpackage-versionnow names acogniumversion (default5.0.0). Pin#v1.1.0to keep the oldcognium-devinstall.
Example
steps:
- label: ":shield: cognium scan"
command: ":"
plugins:
- cogniumhq/cognium#v2.0.0:
path: .
The plugin provides the Buildkite command hook, so you do not need to add a separate command: step for the Cognium scan.
Configuration
| Option | Type | Default | Description |
|---|---|---|---|
path |
string | . |
Path to scan |
package-version |
string | 5.0.0 |
Version of cognium to install |
format |
string | text |
Output format: text, json, or sarif |
output |
string | — | Output file |
severity |
string | — | Severity filter |
category |
string | — | Category filter |
fail-on-findings |
boolean | false |
Whether security findings should cause the Buildkite step to fail |
Finding behavior
By default, security findings are reported without failing the Buildkite step:
steps:
- label: ":shield: cognium scan"
command: ":"
plugins:
- cogniumhq/cognium#v2.0.0:
path: .
fail-on-findings: false
To use Cognium as a blocking security gate, set fail-on-findings to true:
steps:
- label: ":shield: cognium scan"
command: ":"
plugins:
- cogniumhq/cognium#v2.0.0:
path: .
fail-on-findings: true
Scanner errors and installation failures remain non-zero regardless of fail-on-findings. cognium exits 1 for findings at or above severity, 2 for a usage or config error and 3 only when asked to fail on files it could not fully analyse.
SARIF / JSON artifacts
To make a SARIF or JSON report available as a Buildkite artifact, configure the plugin’s output and the step’s artifact_paths:
steps:
- label: ":shield: cognium scan"
artifact_paths:
- "cognium-results.sarif"
plugins:
- cogniumhq/cognium#v2.0.0:
path: .
format: sarif
output: cognium-results.sarif
Requirements
- Buildkite Agent
- Node.js >= 20.19.0
- npm
How It Works
The plugin installs the specified version of cognium into a temporary directory using npm and runs cognium scan against the configured path.
Buildkite
|
v
Cognium Buildkite Plugin
|
v
Install cognium
|
v
cognium scan
|
v
Security findings
If cognium reports security findings, the plugin follows the fail-on-findings setting. When false, findings are reported without failing the Buildkite step. When true, findings cause the step to fail.
Scanner and installation errors remain non-zero regardless of fail-on-findings.
Development
Run the Buildkite plugin linter:
docker run -it --rm -v "$PWD:/plugin:ro" buildkite/plugin-linter --id cogniumhq/cognium --path /plugin
Run the plugin tests:
docker run -it --rm -v "$PWD:/plugin:ro" buildkite/plugin-tester
LICENSE
MIT