Skip to content

Fix: [for cherry-picking] Credential and private-key rules now bypass l - #65

Closed
qodo-code-review[bot] wants to merge 1 commit into
ci/1747-public-repo-guard-body-scanfrom
fix/remediation-bc25fb50-1e102a
Closed

Fix: [for cherry-picking] Credential and private-key rules now bypass l#65
qodo-code-review[bot] wants to merge 1 commit into
ci/1747-public-repo-guard-body-scanfrom
fix/remediation-bc25fb50-1e102a

Conversation

@qodo-code-review

@qodo-code-review qodo-code-review Bot commented Aug 6, 2026

Copy link
Copy Markdown

Fixed Findings

  • Prevent allowlist bypasses for credential matches

Automated fix from agentic review of #64

Qodo Logo


Open in Devin Review

Review in cubic

Note

Bypass allowlist filtering for credential and private-key rules in body policy

  • For rules stripe-live-key, stripe-account, anthropic-key, github-pat, supabase-pat, aws-akid, and private-key, the check function in body-policy.sh now skips both inline guard:allow allowlisting and ABOUT_THE_CONTROL filtering, using raw ripgrep matches directly.
  • All other rules continue to use the existing filtering pipeline.
  • A new test in body-policy.test.sh asserts that an allowlisted AWS access key still counts as a violation.
  • Behavioral Change: guard:allow annotations no longer suppress violations for the listed credential rule names.

Macroscope summarized 6a60628.

@greptile-apps

greptile-apps Bot commented Aug 6, 2026

Copy link
Copy Markdown

PR author is in the excluded authors list.

@macroscopeapp

macroscopeapp Bot commented Aug 6, 2026

Copy link
Copy Markdown

Approvability

Verdict: Needs human review

Unable to check for correctness in 6a60628. This PR modifies security-related credential scanning scripts to make certain high-risk patterns (API keys, private keys) bypass allowlist filtering. Changes to security tooling warrant review by the designated code owners (wave-av/core-team).

You can customize Macroscope's approvability policy. Learn more.

@devin-ai-integration devin-ai-integration 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.

Devin Review found 1 potential issue.

Open in Devin Review

Comment on lines +52 to +64
# Credential and private-key formats are never allowlisted: a real secret must
# still block even when it appears in a policy example or an exempt line.
local matches
matches="$(printf '%s' "$raw" \
| rg -vN -- 'guard:allow[[:space:]]+[^[:space:]]' \
| rg -vNiP -- "$ABOUT_THE_CONTROL" || true)"
case "$name" in
stripe-live-key|stripe-account|anthropic-key|github-pat|supabase-pat|aws-akid|private-key)
matches="$raw"
;;
*)
matches="$(printf '%s' "$raw" \
| rg -vN -- 'guard:allow[[:space:]]+[^[:space:]]' \
| rg -vNiP -- "$ABOUT_THE_CONTROL" || true)"
;;
esac

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔍 Body gate now diverges from the tree gate on credential allowlisting

scripts/public-repo-guard/content-policy.sh:56-60 still lets # guard:allow <reason> suppress its credential rules (stripe-live-key, stripe-account). After this change the two halves of the same gate disagree: the same credential-shaped string is exemptible in a committed file but unconditionally blocking in a PR body. If the intent is "a real secret always blocks", the tree scanner deserves the same treatment; otherwise the divergence should be documented so operators know which surface enforces which policy.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

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.

0 participants