Skip to content

fix(sast): scope curl-pipe-shell off the declarative check corpus - #21

Merged
p4gs merged 1 commit into
mainfrom
claude/ci-failures-root-cause-du0l4t
Sep 1, 2026
Merged

fix(sast): scope curl-pipe-shell off the declarative check corpus#21
p4gs merged 1 commit into
mainfrom
claude/ci-failures-root-cause-du0l4t

Conversation

@p4gs

@p4gs p4gs commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

Summary

Closes the one still-open defect behind the Aug 10–19 CI red streak: the sscsb.curl-pipe-shell ERROR rule (generic-language regex over *.yml/*.yaml) matches prose inside declarative checks/** YAML. It broke the ona PR (run 32213773362) on ONA-2.02's description sentence naming the curl | sh attack the check defends against; that PR got green only by rewording the prose, which left the class open — any future check description that literally names the attack re-breaks CI.

Fix: add exclude: ["checks/**"] to the rule's paths. Check YAMLs are data interpreted by src/check/interpreter.rs (HTTP + CEL — no field ever reaches a shell), so a match there is false by construction; this mirrors the workflow's existing --exclude .sscsb/rules and the npm rule's comment-guard precedent. Every executable surface (*.sh, *.bash, *.zsh, Makefile, workflow/CI YAML) keeps full coverage, --error gating stays, and no true finding is suppressed.

Verified with semgrep 1.175.0 against the edited ruleset: ONA-2.02 prose → 0 findings; a real curl … | sh in a .sh fixture → still flagged; a real curl … | bash in a workflow .yml outside checks/ → still flagged; whole-repo ERROR count under the workflow's own excludes → 0.

For context, the rest of that red streak was already fixed on main by PR #20 / commit 3720145 (gitleaks license gate → pinned OSS binary; RUSTSEC-2024-0436 pastecel 0.14; fuzz.yml's missing ../grc-controls sibling checkout; the 14 pre-existing Semgrep findings → loaders hardening) — nothing further needed there. One structural item is left as an owner decision, not changed here: Dependabot's cargo security-update jobs have failed since 2026-03-13 because Cargo.toml's ../grc-controls path deps can't resolve in Dependabot's isolated clone; fixing it properly means pinned git deps + granting Dependabot access to the private repo + reworking the 10 CI sibling-checkout steps, which touches credentials and org settings.

AI Provenance Declaration

  • AI generated or assisted with code in this PR
  • AI generated or assisted with tests in this PR
  • AI introduced or suggested new dependencies in this PR
  • AI generated or assisted with documentation in this PR

AI tool(s)/model(s) used (if any): Claude Code

Human review performed on AI-generated parts (what/how): None yet — this draft PR is the review vehicle. The rule-scope change was validated empirically with semgrep before/after (details above).

Dependency Changes

  • No new dependencies
  • New dependencies validated (sscsb deps check) and approved

Merge Policy Reminder

AI involvement is declared above, so the merge to main needs an approved human hardware-backed key and review evidence (Reviewed-by: trailer). See docs/signing.md.

🤖 Generated with Claude Code

https://claude.ai/code/session_016qAUyZgpei6EhKL6jXdu1C


Generated by Claude Code

The generic-language rule matched the phrase "to run \`curl ... | sh\`"
inside a check description block scalar and failed the ona PR's SAST
gate (run 32213773362) — prose documenting the attack a control defends
against, in a .check.yaml file that src/check/interpreter.rs treats as
pure data (template resolution -> HTTP -> JSONPath -> CEL; no field ever
reaches a shell). Any match under checks/ is therefore false by
construction, and the in-branch "fix" of rewording the prose left the
class open: the next check that names curl|sh in its description would
re-break CI.

Exclude checks/** from this rule — the same rationale the workflow
already applies to .sscsb/rules ("a scanner must not scan its own rule
definitions") — while every executable surface (*.sh, *.bash, *.zsh,
Makefile, workflow/CI YAML) stays covered. Verified with semgrep
1.175.0: the ONA-2.02 prose no longer matches; a real curl|sh in a
shell script and in a workflow yml still does; the repo-wide ERROR
count under the gate's own excludes is zero.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016qAUyZgpei6EhKL6jXdu1C
@p4gs
p4gs marked this pull request as ready for review September 1, 2026 09:25
@p4gs
p4gs merged commit f565d53 into main Sep 1, 2026
30 checks passed
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.

2 participants