Droid Shieldとは?
Droid Shieldは、コミットしてリモートにプッシュする前に、未コミットの変更を自動的にスキャンして潜在的なシークレットを検出する組み込みセキュリティ機能です。APIキー、トークン、パスワードなどの機密認証情報がバージョン管理履歴に誤って公開されることを防ぐセーフティネットとして機能します。Droid Shieldの動作原理
Droidを使用してgit commitまたはgit push操作を実行すると、Droid Shieldは自動的に以下を行います:
- 差分をスキャン - 追加される行のみを分析(削除や変更されていない行は対象外)
- シークレットを検出 - パターンマッチングを使用して潜在的な認証情報を識別
- 実行をブロック - シークレットが検出された場合、git操作を停止
- 検出結果を報告 - 潜在的なシークレットが見つかった正確な場所を表示
Droid Shield only scans git operations performed through Droid. Manual git commands run outside of Droid are not affected.
Droid Shieldが検出する対象
Droid Shieldは、以下を含む幅広い認証情報パターンをスキャンします:API Keys & Tokens
Factory API keys, GitHub tokens, GitLab tokens, npm tokens, and API keys from (e.g. AWS, Google Cloud, Stripe, SendGrid) and more.
Authentication Credentials
(e.g. JWT, OAuth, session tokens), and URLs with embedded credentials.
Private Keys
(e.g. SSH private keys, PGP keys, age secret keys, OpenSSH keys), and other cryptographic key formats.
Service-Specific Secrets
(e.g. Slack webhooks and tokens, Twilio credentials, Mailchimp keys, Square OAuth secrets, Azure storage keys).
検出アルゴリズム
Droid Shieldは、ランダム性検証を伴うスマートパターンマッチングを使用します:- パターンマッチング - フォーマットによる認証情報の識別
- ランダム性チェック - キャプチャされた値が実際のシークレットのように見えるかを検証
- コンテキスト認識 - 変数名と代入パターンを考慮して誤検出を減らす
Droid Shieldが起動するタイミング
Droid Shieldは以下のgit操作中に自動的に起動します:git commit- コミット作成前にステージされた変更をスキャンgit push- リモートにプッシュされるコミットをスキャン
Droid Shield設定の管理
CLIでの操作
設定メニューからDroid Shieldのオン/オフを切り替えることができます:droidを実行/settingsを入力- **「Droid Shield」**設定を切り替え
- 変更は即座に有効になります
Droid Shield is enabled by default for your protection. We strongly recommend keeping it enabled.
シークレットが検出された場合の対処法
Droid Shieldが潜在的なシークレットを検出すると、以下のようなエラーメッセージが表示されます:推奨される対処方法
Remove the secrets
- Use environment variables instead of hardcoded credentials
- Move secrets to secure credential stores
- Add sensitive files to
.gitignore - Use git filter-branch or BFG Repo-Cleaner if secrets were already committed
誤検出の場合
Droid Shieldは慎重を期すために保守的なパターンを使用します。検出が誤検出だと思われる場合:- 実際のシークレットでないことを確認 - その値が機密情報でないことを再確認
- 手動コミットを使用 - Droid以外でgit操作を直接実行
- パターンを報告 - 繰り返し発生する誤検出がある場合はsupport@factory.aiまでご連絡ください
ベストプラクティス
Use environment variables
Use environment variables
Store all secrets in environment variables or secure credential managers, never hardcode them in source files.
Keep Droid Shield enabled
Keep Droid Shield enabled
Droid Shield provides an essential safety layer. Keep it enabled at all times, especially in team environments.
Review before committing
Review before committing
Even with Droid Shield, manually review your changes before committing to ensure no sensitive data is included.
Educate your team
Educate your team
Make sure all team members understand how Droid Shield works and why it’s important to keep it enabled.
制限事項
Droid Shield is a detection tool, not a guarantee. While it catches many common secret patterns, it cannot detect:
- Custom secret formats not in the pattern database
- Secrets that don’t follow recognizable patterns
- Obfuscated or encoded credentials
- Business logic vulnerabilities or code security issues
関連リソース
Security Overview
Learn about Factory’s comprehensive security features and best practices.
Settings
Configure Droid settings including Droid Shield preferences.
サポートが必要ですか?
Security Questions
Email our security team: security@factory.ai
False Positives
Contact support@factory.ai to report persistent false positive patterns.
