Skip to content

Add blocking Semgrep SAST gate - #752

Merged
Doezer merged 5 commits into
mainfrom
claude/sast-sca-status-checks-ysy3ze
Jul 3, 2026
Merged

Add blocking Semgrep SAST gate#752
Doezer merged 5 commits into
mainfrom
claude/sast-sca-status-checks-ysy3ze

Conversation

@Doezer

@Doezer Doezer commented Jul 3, 2026

Copy link
Copy Markdown
Owner

Description

Follow-up to #750, which added the SCA gate (npm audit + license-checker, blocking on Critical/High) and a docs/VULNERABILITY_MANAGEMENT.md policy — but explicitly left SAST as triage-only (§2.3): CodeQL's default setup has no per-PR pass/fail signal, so a SAST violation could merge without ever being blocked. That leaves OSPS-VM-06.02 (SAST violations must be blocked unless declared/suppressed as non-exploitable) unmet.

This PR adds that missing blocking gate:

  • New .github/workflows/sast.yml: a semgrep job that runs semgrep scan with the p/security-audit, p/secrets, p/owasp-top-ten, p/javascript, p/typescript, and p/react rulesets, restricted to ERROR-severity findings (--severity ERROR --error). Any match fails the job and blocks merge. Results are also uploaded to the repo's Code Scanning tab (separate SARIF "tool" from CodeQL, so it doesn't conflict with CodeQL's default setup).
  • Updated docs/VULNERABILITY_MANAGEMENT.md §2 to document Semgrep as the new pre-merge SAST gate (§2.3), including the suppression process for declaring a blocking finding non-exploitable (inline // nosemgrep: <rule-id> with a mandatory justification comment, reviewed like any other diff).
  • CodeQL default setup is left as-is for broader triage/SLA-based review (§2.2); this PR only adds the missing enforcement layer, it doesn't replace that.

Once merged, add semgrep as a required status check alongside the existing sca-scan check in the main branch protection rule (Settings → Branches).

Type of change

  • New feature (non-breaking change which adds functionality)
  • Documentation update

Checklist

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation (docs/VULNERABILITY_MANAGEMENT.md)
  • YAML validity of the new workflow checked with yaml.safe_load
  • Confirm the semgrep job runs green on this PR, then enable it as a required status check

🤖 Generated with Claude Code


Generated by Claude Code

CodeQL's default setup has no per-PR pass/fail signal, so a SAST
violation could merge without ever being blocked. Add a Semgrep job
that fails the build on ERROR-severity findings across security-audit,
secrets, OWASP Top 10, and JS/TS/React rulesets, satisfying
OSPS-VM-06.02's requirement that SAST violations block merge unless
declared non-exploitable via inline nosemgrep suppression.
@github-advanced-security

Copy link
Copy Markdown
Contributor

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:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the vulnerability management documentation to describe the integration of Semgrep as a second SAST layer alongside CodeQL, specifically serving as a pre-merge blocking gate. The review feedback suggests formatting a workflow file reference as a root-absolute link for consistency and correcting a multi-line nosemgrep suppression example, as Semgrep requires the directive to be on the line immediately preceding the flagged code to function correctly.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread docs/VULNERABILITY_MANAGEMENT.md Outdated
Comment thread docs/VULNERABILITY_MANAGEMENT.md
@codecov

codecov Bot commented Jul 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 829c90a12a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/workflows/sast.yml Outdated
Doezer and others added 4 commits July 3, 2026 11:59
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
- Run semgrep without --severity/--error so WARNING/INFO findings still
  reach the Code Scanning tab; enforce the ERROR-only blocking policy
  in a dedicated step that reads the JSON output instead, per Codex
  review feedback that filtering the scan itself dropped lower-severity
  findings from the SARIF upload the docs claimed stayed visible.
- Fix the nosemgrep suppression example: Semgrep only recognizes the
  directive on the flagged line or the line immediately before it, so
  the two-line comment in the docs wouldn't actually suppress anything.
- server/credential-crypto.ts: pass authTagLength explicitly to
  createCipheriv/createDecipheriv (gcm-no-tag-length) instead of relying
  on Node's default, hardening against tag-truncation attacks.
- Dockerfile: suppress the two missing-USER findings with nosemgrep and
  a justification -- the container intentionally starts as root so
  entrypoint.sh can chown/usermod to the host's PUID/PGID before
  dropping privileges itself via su-exec, per docs/VULNERABILITY_MANAGEMENT.md
  §2.3's suppression policy.
@sonarqubecloud

sonarqubecloud Bot commented Jul 3, 2026

Copy link
Copy Markdown

@Doezer
Doezer merged commit e444574 into main Jul 3, 2026
13 checks passed
@Doezer
Doezer deleted the claude/sast-sca-status-checks-ysy3ze branch July 3, 2026 11:17
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.

3 participants