Skip to content

feat: scan gate mode via --fail-on=any|high and --strict - #13

Merged
segraef merged 1 commit into
mainfrom
feat/scan-fail-on-strict
Sep 2, 2026
Merged

segraef merged 1 commit into
mainfrom
feat/scan-fail-on-strict

Conversation

@segraef

@segraef segraef commented Sep 2, 2026

Copy link
Copy Markdown
Owner

What

Second slice of the deployment-gate plan: make the seckit scan exit code usable as a blocking gate.

  • --fail-on=any|high (PowerShell -FailOn). high keeps a blocking gate quiet on low-severity noise: secrets (gitleaks, trufflehog) always fail; osv fails only when its severity summary shows Critical+High > 0 (a missing summary counts as fail, noted on the terminal); semgrep runs with --severity ERROR; checkov and socket still report but never fail the run. Default any = today's behaviour. Below-threshold findings stay visible in the report - they just stop failing the run.
  • --strict (PowerShell -Strict): exit 3 when a selected scanner is not installed, so a gate cannot silently pass green on a machine that is missing a scanner. Default remains fail-open (skip + report note).
  • Exit-code contract documented: 0 clean, 1 findings at/above threshold, 2 usage error, 3 strict + missing scanner.
  • seckit.ps1 scan dispatch forwards the new switches; docs and both CI templates (GitHub + Azure Pipelines) gain the blocking-gate variant comment.

Verified

  • bash check.sh green (shellcheck, PSScriptAnalyzer, YAML).
  • 15 threshold unit cases (bash 9, PowerShell 6) covering osv low/high/missing-summary, checkov/socket report-only, secrets always-fail, and any mode.
  • Exit-code matrix: bad --fail-on value -> 2 (both shells), strict + missing scanner -> 3 (both, via stripped PATH), non-strict same setup -> 0, end-to-end gate run (--only=osv --fail-on=high --strict, direct and via the pwsh wrapper) -> 0.

🤖 Generated with Claude Code

https://claude.ai/code/session_01B9sELo4AqzS2NcvToDhdNy

- --fail-on=high (ps1 -FailOn high): secrets (gitleaks, trufflehog) always
  fail; osv fails only when Critical+High > 0 parsed from its severity
  summary (a missing summary counts as fail, stated on the terminal);
  semgrep runs with --severity ERROR; checkov and socket become
  report-only. Default any = unchanged behaviour. Below-threshold findings
  stay visible in the report; they just stop failing the run.
- --strict (ps1 -Strict): exit 3 when a selected scanner is not installed,
  for gates that must not silently pass green on a machine missing a
  scanner. Default stays fail-open (skip + report note).
- Exit codes documented: 0 clean, 1 findings at/above threshold, 2 usage,
  3 strict + missing scanner.
- seckit.ps1 scan dispatch forwards -FailOn/-Strict; docs and both CI
  templates gain the blocking-gate variant comment.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B9sELo4AqzS2NcvToDhdNy
@segraef
segraef merged commit 6c94280 into main Sep 2, 2026
6 checks passed
@segraef
segraef deleted the feat/scan-fail-on-strict branch September 2, 2026 02:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant