Security baseline diffing in CI pipelines

Teams inheriting legacy web applications cannot fix every low-priority header on day one. Baseline diffing lets CI pipelines enforce zero regressions while keeping existing accepted issues tracked separately.

How baseline comparison classifies findings

Save a known JSON baseline report with --json baseline.json, then compare future runs against it:

web-vuln-scanner https://staging.example.com --baseline baseline.json --fail-on-regression
BucketMeaning during diffing
New issuesThe deterministic finding fingerprint was absent in the baseline JSON.
Worsened issuesThe finding existed earlier, and its severity increased.
Resolved issuesThe finding disappeared and its check category ran cleanly in the current scan.
Unverified issuesThe category timed out or hit the request budget, so resolution could not be confirmed.

Compatibility guards and local project history

The diff engine verifies that the scan profile (web vs api) and --auth-context label match the baseline before comparing findings. For local auditing across sprints, pass --project my-app --save-run to store history and finding triage states in local configuration storage.

Frequently asked questions

What exit code does --fail-on-regression return when a regression appears?

It exits with status code 2 when new or worsened issues are detected, matching --fail-on severity threshold behavior.

Why require matching --auth-context between baseline and target run?

Comparing an anonymous scan against an authenticated scan produces misleading diffs on protected pages. Enforcing matching auth context prevents false resolved alerts.

Related guides

GitHub Actions SARIF audit

Combine baseline files with SARIF alerts inside pull request workflows.

CLI reference and custom rules

Review --project, --save-run, and --max-requests flags.

OWASP ASVS automated checks

Understand CheckOutcome coverage tracking behind unverified diffs.