Skip to content

feat(p5): add settings-template.json with extended bypass patterns#15

Open
rocklambros wants to merge 1 commit into
v2/modernizationfrom
feat/p5-settings-template
Open

feat(p5): add settings-template.json with extended bypass patterns#15
rocklambros wants to merge 1 commit into
v2/modernizationfrom
feat/p5-settings-template

Conversation

@rocklambros

Copy link
Copy Markdown
Member

Summary

P5 Task 115 deliverable. Static permission-rule template the user merges manually into their own Claude Code settings (Layer 1 of the B-pure architecture). CSCR ships zero merger code.

24 deny rules covering:

  • Secret-file reads: .env, secrets/, AWS credentials, SSH private keys
  • Secret-file writes/edits: .env variants
  • Curl/wget pipe-to-shell: 4 direct (curl|sh, curl|bash, wget|sh, wget|bash) + 3 shell-of-curl indirect variants (sh -c *curl*, bash -c *curl*, eval *curl*) per fresh-round F7
  • Git force-push to main/master: both --force and --force-with-lease
  • Destructive rm: rm -rf /, rm -rf ~, rm -rf $HOME

Contents verbatim from docs/superpowers/specs/2026-05-24-cscr-modernization-design.md § "What the template covers".

Honest framing

This template catches the specific patterns enumerated. Documented bypass classes it does NOT catch (and which require hooks per the upcoming write-your-own-hook.md):

  • Process substitution: bash <(curl ...)
  • Download-then-exec: curl ... -o /tmp/x && sh /tmp/x
  • Tee-then-exec: curl ... | tee /tmp/x; sh /tmp/x
  • Multi-step variable construction: URL=...; curl $URL | sh

These are noted in the design doc and will be repeated in docs/explanation/enforcement-coverage.md (separate task).

Test plan

  • uv run python -c "import json; json.load(open('settings-template.json'))" — 24 deny rules parse cleanly

Reviewer

@fewdisc — verbatim content from the design doc. Worth confirming the rule strings match the Claude Code permission-rule format you expect (the format follows <Tool>(<pattern>) per the platform docs; please flag if any specific rule string would be rejected by the current settings parser).

Related

  • Followup: PR-16 (P5 Task 116 — docs/how-to/merge-settings-template.md)
  • Followup: P5 Tasks 117-127 — docs/how-to/write-your-own-hook.md (11 hook patterns)

P5 Task 115. Static permission-rule template the user merges into their own
Claude Code settings.json manually (no CSCR-shipped merger code — Layer 1 of
the B-pure architecture per docs/superpowers/specs/2026-05-24-cscr-modernization-design.md).

Contents (24 deny rules) mirror the design doc § "What the template covers"
verbatim, including the fresh-round F7 extended bypass patterns:
- secret-file reads: .env, secrets/, AWS credentials, SSH private keys
- secret-file writes/edits: .env variants
- curl/wget pipe-to-shell: 4 direct + 3 shell-of-curl indirect variants
  (sh -c, bash -c, eval)
- git force-push to main/master: --force + --force-with-lease
- rm -rf on root and home

Documented bypass classes the template does NOT catch (and which require
hooks per the docs/how-to/write-your-own-hook.md guidance) include process
substitution `bash <(curl ...)`, download-then-exec, tee-then-exec, and
multi-step variable construction. Those are enumerated in the design doc
§ "What the template does NOT cover" and will be repeated in
docs/explanation/enforcement-coverage.md per P5 Task 116+.

The merge guide is a separate task (Task 116 → PR-16); this PR ships only
the template JSON.

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

Pull request overview

Adds a static Claude Code permission-rule template that users can manually merge into their settings as Layer 1 of the CSCR v2 B-pure architecture.

Changes:

  • Adds settings-template.json with 24 permissions.deny entries.
  • Covers secret-file access, curl/wget pipe-to-shell patterns, git force-push patterns, and destructive rm -rf commands.

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

Comment thread settings-template.json
Comment on lines +22 to +24
"Bash(git push --force master)",
"Bash(git push --force-with-lease main)",
"Bash(git push --force-with-lease master)",
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