Skip to content

ci(security): gate security alert issues on high/critical severity with Snyk SARIF fallback - #112

Merged
NicoGenti merged 2 commits into
mainfrom
feat/issue-108-security-alert-severity-gate
Nov 20, 2026
Merged

NicoGenti merged 2 commits into
mainfrom
feat/issue-108-security-alert-severity-gate

Conversation

@NicoGenti

Copy link
Copy Markdown
Owner

Closes #108

Summary

Pipeline Security alert issues opens issues only for material findings (effective severity high/critical), reducing noise from Snyk Code SARIF alerts whose rule.security_severity_level is absent/unknown.

Changes

  • .github/workflows/security-alert-issues.yml
    • Resolve effective severity from rule.security_severity_level when present (normalized).
    • Otherwise map from the most recent Snyk Code analysis (category=snyk-code) by downloading its SARIF (Accept: application/sarif+json) and deriving the level from security-severity score (GitHub cut-offs), then properties.severity/problem.severity, then defaultConfiguration.level (error→high, warning→medium, note→low).
    • Skip unknown/none/medium/low with a visible ::notice:: line (unknown skips with notice for deterministic handling).
    • Severity gate placed immediately after marker-based dedup, so already tracked alerts still don't create duplicates.
    • Logs the resolved SARIF severity map.
    • Cron/dispatch/workflow_run share the same job → identical behavior.
  • .github/workflows/snyk-code.yml
    • Add a sanitization step before upload that drops invalid (non-numeric) properties.security-severity values from the SARIF (prevents Code Scanning upload rejection; scan args/self-skip unchanged).
  • CONTRIBUTING.md
    • Align stale doc statements to verified state: TypeScript 7.0.2 and 828 tests.

Verification

  • npm run check: green in the isolated worktree — tsc/tsc:tui clean (0 errors), 828/828 tests passing.
  • npm ci reproduced the committed lockfile unchanged; no edits to src/ beyond workflow/docs.

Scope notes (per issue #108)

  • In scope only: severity gate + effective-severity mapping + sanitization + doc alignment.
  • Out of scope: issue template content, marker dedup logic, triage labels, the Snyk scan itself, and excluding already-dismissed alerts (proposed follow-up).
  • Unknown/missing effective severity: skipped with notice (per confirmed recommendation).

@NicoGenti
NicoGenti merged commit 34f665c into main Nov 20, 2026
7 checks passed
@NicoGenti
NicoGenti deleted the feat/issue-108-security-alert-severity-gate branch November 20, 2026 13:19
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.

ci: create Snyk Code security issues only for severity above medium

1 participant