Skip to content

fix(ci): unblock SAST gate — fix workflow shell-injection, suppress 7 false positives - #32

Merged
Bihan-Banerjee merged 1 commit into
mainfrom
fix/sast-gate-false-positives
Jun 5, 2026
Merged

Bihan-Banerjee merged 1 commit into
mainfrom
fix/sast-gate-false-positives

Conversation

@Bihan-Banerjee

Copy link
Copy Markdown
Owner

Why

The SAST (semgrep) CI gate blocked the pipeline on 8 HIGH/MEDIUM findings. This is the
only remaining red gate — main already has the test/pusher and morning-start fixes
(PRs #30/#31); this commit (4af2840) was pushed after #31 merged and never reached main.

Build & Test is already green on main (verified in run for 23807f2); SAST is what's left.

What changed

1 real issue → fixed

  • ci.yaml provenance step interpolated ${{ github.repository/ref/sha/run_id }} directly
    into a shell heredoc (run-shell-injection). Now passed via env: and referenced as
    shell variables — the correct pattern, and it clears the finding.

7 false positives → justified entries in the documented SUPPRESSED allowlist

  • 5× sqlalchemy-execute-raw-query (sqlite_store.py) — queries are fully
    parameterized (user values bound via ?); only static column names / WHERE/JOIN
    structure are f-string interpolated. No injection path.
  • 1× insecure-hash-algorithm-sha1 (sqlite_store.py:386) — finding-dedup
    fingerprint, not a security digest. Marked usedforsecurity=False (keeps the digest
    byte-identical) and suppressed.
  • 1× no-iam-creds-exposure (kyverno/main.tf) — short-lived IRSA tokens, same
    rationale already accepted for the iam_oidc role.

Verification

  • Full test suite green with AWS creds unset; coverage 100%.
  • mypy clean; ci.yaml is valid YAML; gate is_suppressed substrings confirmed to match
    the reported check_id + path for all three new entries.

🤖 Generated with Claude Code

…alse positives

The semgrep gate blocked 8 HIGH/MEDIUM findings. One is a real best-practice issue (fixed); the rest are false positives added to the documented SUPPRESSED allowlist:

FIXED: provenance step interpolated GitHub context (repository/ref/sha/run_id) directly into the shell heredoc (run-shell-injection). Pass them via env vars and reference as shell variables instead.

SUPPRESSED (false positives, justified inline): sqlite_store raw queries are fully parameterized (user values bound via '?'; only static column/clause fragments are f-string interpolated); the finding-dedup fingerprint uses SHA-1 with usedforsecurity=False (not a security digest); the Kyverno ECR-read role uses short-lived IRSA tokens (same rationale as the existing iam_oidc suppression).

Suite green with AWS creds unset; coverage 100%.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 5, 2026

Copy link
Copy Markdown

Someone is attempting to deploy this pull request to the Bihan Banerjee's projects Team on Vercel.

No GitHub account was found matching the commit author email address.

To deploy this pull request, the commit author's email address needs to be associated with a GitHub account.

Learn more about how to change the commit author information.

@Bihan-Banerjee
Bihan-Banerjee merged commit d2d4325 into main Jun 5, 2026
6 of 7 checks passed

This branch had an error being deployed

1 failed deployment
Preview — 4af2840c Deployed Jun 5, 2026 by vercel[bot]
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.

1 participant