scan-for-secrets 0.1 リリース
本文の状態
日本語全文を表示中
詳細モードで約1分の本文を読めます。
同じ出来事の情報源
この情報源を基点に整理
Simon Willison Blog
Simon W.が開発したPython製のシークレット検出ツールscan-for-secrets 0.1がリリースされた。このツールは、Claude CodeのログファイルにAPIキーなどの機密情報が含まれていないかを検出するためのもので、開発者のセキュリティ対策を支援する。
Continue in AI NEW LAB
このニュースを、実務の判断につなげる
AI NEW LABで、試したことや先に確認したい条件を共有できます。まずはログインなしで読めます。
AI NEW LABで論点を見るSource Article
元記事を日本語で読む
本文に関係しない購読案内、埋め込み通知、サイト内プロモーションは除いています。
リリース: scan-for-secrets 0.1
私は、claude-code-transcripts ツールを使用して、ローカルの Claude Code セッションのトランスクリプトを公開することが好きですが、詳細なログファイルに API キーやその他のシークレットが意図せず公開されていないかという不安(パラノイア)を抱くことがよくあります。
この新しい Python スキャンツールは、その不安を和らげるために作成しました。シークレットを入力として渡し、特定のディレクトリ内でそれらがスキャンされるようにできます:
uvx scan-for-secrets $OPENAI_API_KEY -d logs-to-publish/
-d オプションを省略すると、デフォルトで現在のディレクトリが対象となります。
このツールは、シークレットの文字列そのものだけでなく、それらの一般的なエンコーディング(例:バックスラッシュや JSON エスケープ)もスキャンします。詳細は README を参照してください。
常に保護したいシークレットのセットがある場合、それらを出力するコマンドを ~/.scan-for-secrets.conf.sh ファイルにリストとして記述できます。私の設定ファイルは以下のようになります:
llm keys get openai
llm keys get anthropic
llm keys get gemini
llm keys get mistral
awk -F= '/aws_secret_access_key/{print $2}' ~/.aws/credentials | xargs
私はこのツールを、README駆動開発(README-driven-development)を用いて構築しました。具体的には、ツールの動作を正確に記述したREADMEを慎重に作成し、それをClaude Codeに投入して実際のツールの構築を依頼しました(もちろん、赤/緑テスト駆動開発(red/green TDD)を用いてです)。
原文を表示
Release: scan-for-secrets 0.1
I like publishing transcripts of local Claude Code sessions using my claude-code-transcripts tool but I'm often paranoid that one of my API keys or similar secrets might inadvertently be revealed in the detailed log files.
I built this new Python scanning tool to help reassure me. You can feed it secrets and have it scan for them in a specified directory:
uvx scan-for-secrets $OPENAI_API_KEY -d logs-to-publish/
If you leave off the -d it defaults to the current directory.
It doesn't just scan for the literal secrets - it also scans for common encodings of those secrets e.g. backslash or JSON escaping, as described in the README.
If you have a set of secrets you always want to protect you can list commands to echo them in a ~/.scan-for-secrets.conf.sh file. Mine looks like this:
llm keys get openai
llm keys get anthropic
llm keys get gemini
llm keys get mistral
awk -F= '/aws_secret_access_key/{print $2}' ~/.aws/credentials | xargs
I built this tool using README-driven-development: I carefully constructed the README describing exactly how the tool should work, then dumped it into Claude Code and told it to build the actual tool (using red/green TDD, naturally.)
関連記事
今日のまとめ
AIデイリーブリーフで今日の重要ニュースをまとめ読み