Repository navigation
feat(claude): 業務用マシンでクラウド系 CLI をエージェントから実行させない - #273
Merged
Merged
Conversation
業務用マシンでは、AWS・GCP・Kubernetes・Terraform・SOPS などの状態に Bash から触れさせず、MCP サーバー経由か手作業に限る。business_use のときだけ、Claude の permissions.deny と Codex の execpolicy に同じ対象を禁止として足す。 既存の ask / prompt ルールは個人用マシンのために残す。業務用では deny / forbidden が優先されるので、そちらは効かない。 Claude の Bash(*aws *) はコマンド文字列のどこにあっても一致するが、Codex は argv の前方一致なので、連結したコマンドの後ろ側は捕まえられない。 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
業務用マシン(
business_use: true)では、AWS・GCP・Kubernetes・Terraform・SOPS などのクラウド系 CLI とsudo・gh authを、エージェントが Bash から実行できないようにする。これらの状態には MCP サーバーから触れるか、人が手で実行する。個人用マシンの設定は変えない。home/dot_claude/settings.json.tmpl:permissions.denyに 16 パターンを足す(Bash(*aws *)など)home/dot_codex/rules/custom.rules.tmpl: 同じ対象をforbiddenのprefix_rule3 本で足す(deny ブロックにある「両ファイルを揃える」という取り決めに従う)brucke@freee-ccplugins-marketplaceプラグインを有効にする(deny とは関係のない変更だが、同じファイルの業務用ブロックに入るので一緒に出す)レビューの観点
ask(Claude)とprompt(Codex)のルールは、個人用マシンのために残している。業務用では deny と forbidden が優先されるので、これらは効かないBash(*aws *)はコマンド文字列のどこにawsがあっても一致するので、grep aws fileのようなコマンドも止まる。Codex は argv の前方一致なので、foo && aws ...のような連結コマンドの後ろ側は捕まえられない確認したこと
settings.json.tmplをレンダリングしjqで読むdenyに入っている--override-data '{"business_use":false}')でレンダリングするcodex execpolicy check(業務用でレンダリングしたルール)aws s3 ls・helm get values r・gh auth token・sudo lsはforbidden。helm list・gh pr list・git statusはどのルールにもマッチしないjust testtest-zsh-featuresの「project environment state was not approved」で失敗。変更を退避した main でも同じように失敗するので、この PR とは関係ない🤖 Generated with Claude Code