feat(claude): 権限プロンプト削減とセキュリティ強化のための設定を追加 - #75
Merged
Conversation
- 認証情報ファイルの読み取りや破壊的なgit操作を permissions.deny でブロック - terraform/kubectl/docker/gh merge 等の重要操作を permissions.ask で個別確認に - ネイティブサンドボックスを有効化し、サンドボックス内Bashを自動許可 - dangerouslyDisableSandbox使用時に承認を求めるPreToolUseフックを追加
3 tasks
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.
概要
dot_claude/settings.json) に、権限プロンプトを減らしつつ安全性を高めるための設定を追加変更内容
permissions.deny:.env/secrets/credentials/SSH秘密鍵/.pem/.key等の読み取り、sudo/su、git push --force/git reset --hard/git clean -fを恒久的にブロックpermissions.ask:terraform apply/destroy、kubectl apply/delete、docker push、gh pr mergeは個別確認を必須化permissions.allow: 汎用開発ドメイン(GitHub/Google/Slack/AWS/npm/Terraform Registry/Anthropic)への WebFetch と WebSearch を許可sandbox: macOSネイティブサンドボックスを有効化し、サンドボックス内のBashは自動許可(プロンプト削減の本体)。git/docker/gh/gcloud/kubectl/terraform/chezmoi等はサンドボックス対象外として従来の許可フローを維持hooks.PreToolUse:dangerouslyDisableSandbox: trueでのBash実行前に承認を求めるゲートを追加前職設定にあった組織ログイン強制系の項目(
forceLoginMethod等)や、Salesforce/HubSpot/dbt向けの許可ドメインは、現環境に不要なため除外しています。テスト
jqで設定ファイルのJSON構文とキー構造を検証PreToolUseフックをstdin JSONで手動テストし、dangerouslyDisableSandbox: trueの有無で正しく分岐することを確認chezmoiコマンド自体がサンドボックスでブロックされる問題を発見しexcludedCommandsにchezmoi *を追加して解消git/gh等が従来通り動作するかを継続確認