Skip to content

chore: Claude Code に機密ディレクトリの Read deny を追加 - #17

Merged
RyoSogawa merged 3 commits into
mainfrom
chore/claude-secret-read-deny
Aug 14, 2026
Merged

RyoSogawa merged 3 commits into
mainfrom
chore/claude-secret-read-deny

Conversation

@RyoSogawa

@RyoSogawa RyoSogawa commented Aug 14, 2026 •

Copy link
Copy Markdown
Member

概要

agent-skills プラグインの推奨設定に従い、Claude Code が機密情報(SSH 鍵・クラウド認証情報・GitHub CLI 認証情報・.env・GitHub トークン)へアクセスできないようにする deny 設定を追加します。

プラグインの block-exfiltration フックは Bash/Read の「形」で検知する ask/deny ですが、permissions の deny はツール層で確実にブロックできるため、多層防御として推奨されています(agent-skills の README 参照)。

変更内容

  • .claude/settings.json の permissions.deny に以下を追加

    • Read(~/.ssh/**)
    • Read(~/.aws/**)
    • Read(~/.config/gh/**)
    • Bash(gh auth token)
    • Bash(gh auth token *)
    • Bash(gh auth status --show-token)
    • Bash(gh auth status --show-token *)
    • Bash(gh auth status *--show-token*)
    • Bash(gh auth status -t)
    • Bash(gh auth status -t *)
    • Bash(gh auth status *-t*)
  • Read(.env) は既に設定済みのため追加していない

@RyoSogawa
RyoSogawa marked this pull request as ready for review August 14, 2026 08:37
Copilot AI lite review requested due to automatic review settings August 14, 2026 08:37

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Claude Code のツール権限設定(.claude/settings.json)に、機密情報が含まれやすいディレクトリ/コマンドへのアクセスを明示的に permissions.deny でブロックする設定を追加し、多層防御を強化する PR です。

Changes:

  • Read(~/.ssh/**), Read(~/.aws/**), Read(~/.config/gh/**) を permissions.deny に追加
  • GitHub CLI トークン取得のための gh auth token 実行を permissions.deny に追加(完全一致/ワイルドカードの両方)

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@RyoSogawa
RyoSogawa merged commit 2b4aac1 into main Aug 14, 2026
5 checks passed
@RyoSogawa
RyoSogawa deleted the chore/claude-secret-read-deny branch August 14, 2026 13:05
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