Skip to main content

CI/CD integration

vulkro scan exits 1 when it finds a Critical or High issue and 0 otherwise, so it drops into any CI runner.

vulkro scan . # fails on Critical/High
vulkro scan . --fail-on critical,high,medium # also fail on Medium

--fail-on decides which severities fail the build; --min-confidence decides which findings are shown.

With Vulkro Cloud you need no pipeline step for pull requests: see Pull-request checks.

Licence the runner​

Create a CI key in the customer portal, store it as a secret, and expose it as VULKRO_ACCOUNT_TOKEN. Every scan signs in with it on its own: no vulkro login step. Air-gapped runners set VULKRO_LICENSE_B64 (a base64 .lic) instead. Without either, the scan exits 1 with license_required.

GitHub Actions​

.github/workflows/vulkro.yml
name: vulkro
on:
push:
branches: [main]
pull_request:

jobs:
scan:
runs-on: ubuntu-latest
permissions:
contents: read
security-events: write # to upload SARIF
env:
VULKRO_ACCOUNT_TOKEN: ${{ secrets.VULKRO_ACCOUNT_TOKEN }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # to scan git history for secrets
- name: Install Vulkro
run: |
curl -fsSL https://dist.vulkro.com/install.sh | VULKRO_BIN_DIR="$HOME/.local/bin" bash
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
- name: Scan (fails on Critical/High)
run: vulkro scan ci . --format sarif > vulkro.sarif
- name: Upload to code scanning
if: always()
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: vulkro.sarif

The upload runs even when the scan fails the build, so results always reach the Security tab.

Other CI systems: GitHub Actions, GitLab CI, CircleCI, Jenkins, Bitbucket Pipelines, and Salesforce CI.

Fail only on new findings​

vulkro gate --base origin/main

Scans your branch and the base, and fails only on findings that are new. Existing debt never fails the build. See vulkro gate and Baselines.

Comment on the pull request​

vulkro scan . --format gh-pr > comment.md
gh pr comment "$PR_NUMBER" --body-file comment.md

pre-commit​

.pre-commit-config.yaml
repos:
- repo: local
hooks:
- id: vulkro-fast
name: vulkro (fast, source only)
entry: vulkro scan . --min-confidence high --scope src
language: system
pass_filenames: false