Skip to content

docs: gate SAST on PR-introduced findings, not ruleset drift#104

Merged
CybotTM merged 1 commit into
mainfrom
docs/sast-diff-baseline-gating
Jul 4, 2026
Merged

docs: gate SAST on PR-introduced findings, not ruleset drift#104
CybotTM merged 1 commit into
mainfrom
docs/sast-diff-baseline-gating

Conversation

@CybotTM

@CybotTM CybotTM commented Jul 4, 2026

Copy link
Copy Markdown
Member

Field-tested during a netresearch/t3x-nr-llm docs PR: a required SAST (Opengrep) check (--config auto) flipped an unrelated docs PR from green to red because the community ruleset had drifted and now flagged 19 pre-existing findings on the repo's own workflow files — zero on the PR's changes.

Adds a reusable-workflow-security.md section on the correct fix: diff/baseline-aware gating (block only on findings the PR introduces vs the merge-base) — not pinning the ruleset (freezes new-rule adoption) and not report-only (lets real new vulns through). Mechanisms: Semgrep --baseline-commit (with a note to verify the fork's exact flag) or GitHub code-scanning 'new alerts only'.

markdownlint clean.

Copilot AI review requested due to automatic review settings July 4, 2026 16:13
@github-actions github-actions Bot added documentation Improvements or additions to documentation skill labels Jul 4, 2026
@github-actions

github-actions Bot commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@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 adds a new section to the reusable workflow security documentation explaining how to gate SAST checks on PR-introduced findings rather than ruleset drift. It details the problem of ruleset drift blocking unrelated PRs and outlines solutions such as scanner baselines and GitHub-native code scanning checks. The feedback suggests replacing the placeholder O/R with OWNER/REPO in the API path for better consistency with other reference files.

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 skills/github-project/references/reusable-workflow-security.md Outdated

Copilot AI 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.

Pull request overview

Adds guidance to the GitHub Project Skill docs on how to keep required SAST checks effective without letting auto-updating rulesets (e.g., --config auto) break unrelated PRs due to newly surfaced pre-existing findings (“ruleset drift”). The new section recommends baseline/diff-aware gating so required checks fail only on PR-introduced findings relative to the merge-base.

Changes:

  • Document the “ruleset drift” failure mode for required SAST checks using auto-updating rulesets.
  • Recommend diff/baseline-aware gating as the correct mitigation (vs pinning rulesets or switching to report-only).
  • Outline two implementation approaches: scanner-side baselining (e.g., Semgrep --baseline-commit) and GitHub code scanning PR checks (new alerts only).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@CybotTM
CybotTM force-pushed the docs/sast-diff-baseline-gating branch from 0c0f838 to 5103d72 Compare July 4, 2026 16:24
@CybotTM
CybotTM requested a review from Copilot July 4, 2026 16:24

Copilot AI 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.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.

Comment thread skills/github-project/references/reusable-workflow-security.md
Comment thread skills/github-project/references/reusable-workflow-security.md Outdated
…, not drift

A required SAST check with an auto-updating ruleset (opengrep/semgrep
--config auto) turns a green main red on unrelated PRs when the ruleset drifts.
Pinning stops new-rule adoption; report-only lets real new vulns through. The
right shape is diff/baseline-aware gating (Semgrep --baseline-commit — verify
the fork's flag — or GitHub code-scanning 'new alerts only').

Signed-off-by: Sebastian Mendel <info@sebastianmendel.de>
@CybotTM
CybotTM force-pushed the docs/sast-diff-baseline-gating branch from 5103d72 to a2ebb1a Compare July 4, 2026 16:38
@sonarqubecloud

sonarqubecloud Bot commented Jul 4, 2026

Copy link
Copy Markdown

Copilot AI 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.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

@CybotTM
CybotTM merged commit bf9c2a2 into main Jul 4, 2026
19 checks passed
@CybotTM
CybotTM deleted the docs/sast-diff-baseline-gating branch July 4, 2026 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation skill

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants