Vulnerability scanning in CI/CD
noctis has no dedicated CI plugin and no command-line scan mode. It is a REST daemon in a small
container, so a pipeline drives it with curl and jq: start the container, submit a scan,
wait, and decide from the JSON findings. This page gives a script that does that and a way to
choose the threshold.
What makes it fit a pipeline
- One container, no setup. The image is a static binary with the feeds bundled. There is no database and no feed synchronisation at start.
- Findings carry their proof level. Each finding has a
qod(Quality of Detection) from 0 to 100. A gate onqod >= 75fails only on findings backed by observed behaviour, such as a file read or returned data, and leaves version-based hints for review. - Filters in the request.
filters.exclude_categories,exclude_tags,exclude_cveandexclude_uidsdrop checks you do not want in a pipeline, for exampledefault-credentials(login attempts) orrce(probes that may write on the target).
The scan request
noctis does not discover ports. In a pipeline that is an advantage: you already know what you
deployed. Save the request as scan.json:
{
"host": "127.0.0.1",
"services": [{ "port": 3000, "service": "http", "protocol": "tcp" }],
"tests": ["vulnerabilities/"],
"concurrency": 20,
"filters": { "exclude_categories": ["default-credentials"] }
}
A gate script
The script submits the scan, polls its status, prints one line per finding, and exits non-zero when any finding reaches the threshold:
#!/bin/sh
# Submit a scan, wait for it, fail when a finding has QoD >= 75.
set -eu
API=${NOCTIS_URL:-http://localhost:8080}
id=$(curl -sf -X POST "$API/scans" -H "Content-Type: application/json" \
-d @scan.json | jq -r .id)
while :; do
status=$(curl -sf "$API/scans/$id" | jq -r .status)
case "$status" in
completed) break ;;
failed|cancelled) echo "scan $status" >&2; exit 2 ;;
esac
sleep 5
done
curl -sf "$API/scans/$id/findings" > findings.json
jq -r '.[] | "\(.severity)\tQoD \(.qod)\t\(.cve_ids | join(","))\t\(.title)"' findings.json
# Gate: any finding proven by behaviour (QoD >= 75) fails the job.
jq -e '[.[] | select(.qod >= 75)] | length == 0' findings.json > /dev/null
Against a test service that answers like an open Elasticsearch, it prints the finding and exits 1:
critical QoD 75 Elasticsearch exposed without authentication
medium QoD 70 Missing Strict-Transport-Security (HSTS)
The exit codes are the script’s own: 0 when no finding reaches the threshold, 1 when one does, 2 when the scan did not complete.
Example: GitHub Actions
A starting point, to adapt to how your job starts the application under test. Host networking
lets the scanner reach a service listening on the runner’s localhost:
jobs:
scan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Start the application under test
run: docker compose up -d # listens on localhost:3000
- name: Start noctis
run: |
docker run -d --name noctis --network host ghcr.io/fdarkshadow/noctis:latest
until curl -sf http://localhost:8080/health; do sleep 1; done
- name: Scan and gate
run: ./ci/noctis-gate.sh
- name: Keep the findings
if: always()
uses: actions/upload-artifact@v4
with:
name: noctis-findings
path: findings.json
Pin the image to a release tag (:X.Y.Z) so the feed set does not change between runs. The
same three commands work in GitLab CI, Jenkins or any runner that can start a container.
Choosing the gate
| Gate | Fails the job on |
|---|---|
qod >= 97 |
confirmed code execution or an out-of-band callback only |
qod >= 75 |
any functional proof: file read, unauthenticated data |
severity is critical or high and qod >= 70 |
serious findings, including pattern matches |
Combine fields in jq as needed; every finding has severity, qod, confidence, cve_ids,
category and title.
Scheduled scans and webhooks
For scans outside a build, such as a nightly pass over staging, set webhook_url in the scan
request and noctis calls it when the scan completes, instead of the pipeline polling. Blind
vulnerabilities (Log4Shell, SSRF) are confirmed only when the out-of-band server is enabled
with --oob and the target can reach it; see
out-of-band detections.
Limits to know
- noctis tests running network services. It does not scan source code, dependencies or container image layers.
- It has no SARIF or JUnit output; findings are JSON over the REST API.
- A full feed set against many services takes minutes, not seconds. Narrow
teststo the products you run, or raiseconcurrency(performance figures).
Next: the REST API reference, the Docker page, or how findings are graded.