ci(sast): add Semgrep OSS scan complementing CodeQL (#172) - #270
Merged
Conversation
Closes #172. Adds `semgrep-sast.yaml` running Semgrep OSS with the public `p/csharp` + `p/security-audit` rulesets on every PR (main / vNext), push-to-main, weekly Mondays 06:30 UTC (drift catch — public registry rulesets change independent of code), and manual dispatch. Findings upload as SARIF to GitHub Code Scanning where they appear alongside CodeQL alerts. Chose Semgrep OSS over Snyk / Veracode / Fortify / SonarQube because: - Zero-account: pulls rulesets over HTTPS from the public registry, no API key / license procurement / user sign-up needed. - Genuine "beyond CodeQL" coverage: distinct rule engine, catches class of issues CodeQL surfaces at low confidence (patterns encoded as YAML rules vs CodeQL's semantic-taint queries). - Per issue: "Snyk Code has a free OSS tier (worth trying first)" — Semgrep OSS is the true no-friction equivalent. Semgrep version pinned (1.144.0) so ruleset-parser changes in a future release don't silently flip PR status without any repo change. Workflow exit code intentionally decouples findings from tool-error: rc=1 (findings present) does NOT fail the job (Code Scanning gates severity); rc>=2 (real tool error) does. Also adds `docs/SEMGREP-AUDIT.md` — the AC-required audit log where triaged findings are recorded chronologically (fixed / false-positive / accepted-risk + rationale + PR). First entries land after the initial baseline scan. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Initial pin used a non-existent commit (`27d1e8c7db9c6dabdd57f00cae67e2fbb9d5ce3e`); CI failed with `Unable to resolve action`. Replaced with `54f647b7e1bb85c95cddabcd46b0c578ec92bc1a # v4`, the SHA used by the rest of the Wolfgang.* fleet (verified in AuditTrail). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool. What Enabling Code Scanning Means:
For more information about GitHub Code Scanning, check out the documentation. |
This was referenced Jul 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #172.
Summary
.github/workflows/semgrep-sast.yaml. Semgrep OSS1.144.0(pinned) with rulesetsp/csharp+p/security-audit. SARIF upload to Code Scanning → PR annotations + Security tab.docs/SEMGREP-AUDIT.md— the AC-required committed audit log for triaged findings (fixed / false-positive / accepted-risk).Why Semgrep OSS (not Snyk / Veracode / SonarQube)
feedback_confirm_before_api_spend— no user action gate.Findings vs. failures
The workflow does NOT fail the PR on findings (that's Code Scanning's job to gate by severity). It only fails on real Semgrep tool errors (
rc >= 2).Baseline scan
Per AC, "a baseline scan of the current main is committed so per-PR scans report only new findings." Code Scanning enforces this automatically once the first push-to-main run establishes baseline; no committed file needed. The
docs/SEMGREP-AUDIT.mdpicks up the human-readable triage decisions from there.Stacked-PR base
Base =
vNext. Seventh of the 11-PR batch (#178 closed as N/A, so 7 stacked PRs open on vNext so far).Protected-file guard
Adds a new workflow file → protected. Expected admin-bypass at merge.
Test plan
docs/SEMGREP-AUDIT.mdin the follow-up commit that addresses them