スキル secrets-gitleaks
📦

secrets-gitleaks

中リスク 🌐 ネットワークアクセス📁 ファイルシステムへのアクセス🔑 環境変数⚙️ 外部コマンド

Gitleaksでリポジトリのシークレットをスキャン

ハードコードされた認証情報は、コミット、サンプル、設定ファイルを通じてリポジトリに入り込む可能性があります。このスキルは、チームがGitleaksスキャン、CIゲート、ベースライン、修復ワークフローを追加するのに役立ちます。

対応: Claude Codex Code(CC)
⚠️ 50 貧弱
1

スキルZIPをダウンロード

2

Claudeでアップロード

設定 → 機能 → スキル → スキルをアップロードへ移動

3

オンにして利用開始

Agent向けリソース

AI Agent、クローラー、またはスクリプトがページ全体ではなくクリーンなコンテキストを必要とする場合は、これらのリンクを使ってください。

テストする

「secrets-gitleaks」を使用しています。 すべての古い検出結果でブロックせずに、レガシーリポジトリをスキャンする必要があります。

期待される結果:

  • 推奨アプローチ: フルスキャンを実行し、現在の検出結果を保護されたベースラインとして保存し、今後のビルドでは新しい検出結果のみで失敗させます。
  • ベースラインは、ファイル名、ルール名、シークレットの場所を明らかにする可能性があるため、機密情報として扱ってください。

「secrets-gitleaks」を使用しています。 Gitleaksレポートでgit履歴内のトークンが見つかりました。

期待される結果:

  • 即時対応: まずトークンをローテーションし、その後、現在のコードから削除し、必要に応じて履歴をクリーンアップします。
  • クリーンアップ後、リポジトリを再スキャンし、露出期間、影響を受けたシステム、防止策を記録します。

「secrets-gitleaks」を使用しています。 スキャンで多数のテストフィクスチャの検出結果があります。

期待される結果:

検出結果のサンプルを確認し、それらがプレースホルダーであることを確認してから、コメントと所有者を付けた狭いパスまたはストップワードのallowlistを追加します。

セキュリティ監査

中リスク
v6 • 6/28/2026

Static analysis reported many high-risk patterns, but review found they are mostly defensive Gitleaks rules, CI templates, and remediation examples rather than malicious code. No prompt injection or data exfiltration intent was found. Publication is acceptable with a warning because the CI examples execute external commands, read scan reports, upload artifacts, and include some fail-open examples.

12
スキャンされたファイル
3,311
解析された行数
9
検出結果
6
総監査数
中リスクの問題 (2)
Executable CI Templates Process Repository Contents
Verdict: TRUE_POSITIVE for external command and filesystem access, but legitimate for a Gitleaks skill. The GitHub and GitLab templates run Gitleaks in CI, read generated reports, and upload artifacts. This can expose sensitive findings if artifact access is too broad. Confidence: 0.82. Confidence reasoning: the commands and file reads are explicit, but their purpose is defensive scanning rather than covert exfiltration.
Fail-Open Secret Scanning Examples
Verdict: TRUE_POSITIVE as a workflow risk. Several examples suppress scanner exit codes with exit-code zero or shell true. Some sections add later checks, but users who copy only the command may create secret gates that pass after findings. Confidence: 0.76. Confidence reasoning: the fail-open commands are visible, while final impact depends on how users copy and deploy the templates.
低リスクの問題 (3)
Credential Pattern Findings Are Documentation Examples
Verdict: FALSE_POSITIVE for embedded secret theft. The API key, private key, token, and password strings are detection rules or placeholder patterns. They describe what Gitleaks should find and do not contain real credentials. Confidence: 0.91. Confidence reasoning: the surrounding headings and fields identify these as rule definitions and examples, not operational secrets.
Hardcoded URL Findings Are Expected References
Verdict: FALSE_POSITIVE for malicious network behavior. The URLs point to official Gitleaks, OWASP, CWE, pre-commit, GitHub, or CI API resources used by documentation and templates. Confidence: 0.88. Confidence reasoning: the URLs are visible references or platform endpoints, with no hidden outbound data channel found.
Malware Keyword Findings Are Contextual False Positives
Verdict: FALSE_POSITIVE. Static malware and C2 keyword hits appear in compliance and remediation reference material about security controls, not in instructions to deploy malware. No prompt injection language was found. Confidence: 0.84. Confidence reasoning: the reviewed files consistently discuss defensive secret detection and incident response, though broad markdown keyword matches require human context.

検出されたパターン

CI Uses External Scanner CommandsCI Reads and Publishes Secret Scan Reports
監査者: codex 監査履歴を表示 →

品質スコア

59
アーキテクチャ
100
保守性
87
コンテンツ
70
コミュニティ
49
セキュリティ
87
仕様準拠

作れるもの

既存リポジトリを監査する

全履歴のGitleaksスキャンを実行し、検出結果を確認し、誤検知を分類して、今後のチェック用のベースラインを作成します。

コミット前にシークレットをブロックする

pre-commitスキャンをインストールし、キー、トークン、秘密鍵が共有ブランチに到達する前に開発者が検出できるようにします。

CIシークレット検出を追加する

GitHub ActionsまたはGitLab CIテンプレートを適用し、新しいシークレットが検出された場合にレポートを公開してビルドを失敗させます。

これらのプロンプトを試す

最初のシークレットスキャンを実行する
このリポジトリでGitleaksスキャンを実行し、初回監査に最も安全なレポートオプションを説明してください。
pre-commit保護を設定する
ステージ済みのシークレットをブロックし、検出結果をマスクしたままにするGitleaksのpre-commit設定計画を作成してください。
誤検知を調整する
これらのGitleaks検出結果を確認し、本物の認証情報を隠さないallowlistルールを提案してください。
CIベースラインワークフローを設計する
ベースラインを使用し、新しいシークレットのみに失敗し、レポートを保護するGitHub ActionsまたはGitLab CIワークフローを設計してください。

ベストプラクティス

  • ログ、プルリクエストコメント、共有レポートには常にマスク済み出力を使用します。
  • 履歴を書き換えたり検出結果をクローズしたりする前に、露出した認証情報をローテーションします。
  • allowlistは狭く、文書化され、セキュリティ担当者によってレビューされた状態に保ちます。

回避

  • マスクされていないGitleaksレポートを、広く閲覧可能なアーティファクトにアップロードしないでください。
  • レビューなしに、すべてのドキュメント、テスト、設定ファイルを除外するような広範なallowlistを使用しないでください。
  • 認証情報がすでに侵害されている可能性がある場合、シークレットの削除だけに依存しないでください。

よくある質問

このスキルはGitleaksを自動的に実行しますか?
いいえ。ガイダンスとテンプレートを提供します。ユーザーがGitleaksを実行するか、CIおよびpre-commit連携をインストールする必要があります。
公開されたシークレットをgit履歴から削除できますか?
修復オプションは説明しますが、履歴クリーンアップツールの実行やforce pushの調整はユーザー自身で行う必要があります。
スキャンレポートは共有しても安全ですか?
いいえ。レポートには機密性の高い場所やシークレットのメタデータが含まれる可能性があります。アクセスを制限したうえで、マスク済みレポートのみを共有してください。
誤検知は無視できますか?
レビュー後に限ります。本物の認証情報が隠れないよう、明確な理由を添えた狭いallowlistを追加してください。
これはシークレットマネージャーの代替になりますか?
いいえ。これはハードコードされたシークレットの発見に役立ちます。チームには引き続き安全なシークレットマネージャーとローテーションプロセスが必要です。
コンプライアンス作業に役立ちますか?
はい。参照資料では、ハードコードされた認証情報の管理策をCWE、OWASP、PCI-DSS、SOC2、GDPRのトピックに対応付けています。