Token导航 LogoToken导航TokenDH.com
研究检索敏感数据github未标认证来源可访问许可证需确认审计提醒

detecting-secrets侦查秘密

Agent Skill

用于辅助安全审计、权限检查、凭据风险、认证流程和常见漏洞排查。它适合让 Agent 梳理敏感配置、检查依赖风险、分析鉴权逻辑或生成安全复核清单。使用时不能把工具输出直接当最终结论,涉及密钥、令牌、用户数据或生产系统时,应先确认最小权限、脱敏方式和操作边界。

总安装

661

周安装

27

GitHub Stars

84

下载量

212
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:detecting-secrets(侦查秘密)
来源仓库:https://github.com/bitwarden/ai-plugins
仓库路径:skills/detecting-secrets
安装命令:
npx skills add https://github.com/bitwarden/ai-plugins --skill detecting-secrets
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/bitwarden/ai-plugins --skill detecting-secrets

简介

用于辅助安全审计、权限检查和凭据风险排查,适合梳理敏感配置或生成安全复核清单。

  • 可分析代码中的 API 密钥、连接字符串和令牌模式,识别常见漏洞。
  • 通过命令行安装并使用,需结合具体代码库进行扫描验证。
  • 涉及密钥或生产系统时,应确认最小权限和操作边界,避免直接依赖工具输出。
  • detecting-secrets 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Secret Patterns

Look for these categories of hardcoded secrets in code:

High-Confidence Patterns

TypeExample Patterns
API KeysAKIA[0-9A-Z]{16} (AWS), AIza[0-9A-Za-z_-]{35} (Google), strings assigned to variables named *apiKey*, *api_key*
Connection StringsServer=...;Password=..., mongodb://user:pass@host, postgres://user:pass@host
Private Keys-----BEGIN RSA PRIVATE KEY-----, -----BEGIN OPENSSH PRIVATE KEY-----
Tokensghp_[A-Za-z0-9]{36} (GitHub PAT), xoxb- (Slack bot), sk- (OpenAI)
PasswordsValues assigned to variables named *password*, *passwd*, *secret*, *credential*
CertificatesPFX/P12 files with embedded passwords, PEM files with private keys

Lower-Confidence Patterns (Require Context)

  • Base64-encoded strings in configuration (may be encrypted or may be cleartext secrets)
  • JWT tokens (may be test tokens or production tokens)
  • Hex strings of 32+ characters (may be encryption keys or hashes)
  • URLs with embedded credentials (https://user:pass@host)

Context-Aware Detection

Distinguish real secrets from false positives. Not every pattern match indicates an actual secret — consider context:

Test Fixtures and Mock Data

// NOT a real secret — test fixture with obvious fake value
var testApiKey = "test-api-key-not-real-12345";
var mockPassword = "P@ssword123"; // Used only in unit tests

// REAL secret — production-looking value in non-test code
var apiKey = "sk-proj-abc123def456ghi789jkl012mno345pqr678stu901vwx";

Decision criteria:

  • Is it in a test directory (**/test/**, **/tests/**, **/*.Test/**)?
  • Does the value contain obvious placeholder text ("test", "fake", "mock", "example", "placeholder")?
  • Is the value used in assertions or mock setups?

Example and Placeholder Values

// NOT a real secret — documented example
{
  "apiKey": "YOUR_API_KEY_HERE"
}

// REAL secret — actual value in config
{
  "apiKey": "sk-proj-abc123def456ghi789jkl012mno345pqr678stu901vwx"
}

Encrypted or Hashed Values

  • Hashed passwords (bcrypt $2b$, argon2 $argon2id$) are NOT secrets — they're properly stored
  • Encrypted values with proper key management are NOT secrets in the same way
  • But the encryption KEY itself, if hardcoded, IS a secret

Common Hiding Spots

Search these locations when auditing for secrets:

LocationWhat to Look For
appsettings.json / appsettings.Development.jsonConnection strings, API keys, service credentials
.env / .env.localEnvironment variable definitions with real values
web.config / app.configMachine keys, connection strings
docker-compose.yml / DockerfileENV directives with credentials, build args with secrets
CI/CD files (.github/workflows/*.yml)Inline secrets instead of ${{secrets.*}} references
Test seed scripts / migration filesDatabase passwords, service account credentials
Comments and TODO notes"Temporary" credentials left in comments
Default parameter valuesfunction connect(password = "admin123")
Constants filesCentralized credential definitions

GitHub Secret Scanning Integration

# List all secret scanning alerts
gh api /repos/{owner}/{repo}/secret-scanning/alerts --jq '.[] | {number, state, secret_type, secret_type_display_name, created_at, push_protection_bypassed}'

# Get details for a specific alert
gh api /repos/{owner}/{repo}/secret-scanning/alerts/{alert_number}

# List alerts that bypassed push protection
gh api "/repos/{owner}/{repo}/secret-scanning/alerts?state=open" --jq '.[] | select(.push_protection_bypassed == true)'

Push protection prevents commits containing detected secrets from being pushed. When someone bypasses push protection, the alert is flagged — review these with extra scrutiny.

Remediation Workflow

When a secret is found in code, follow this sequence:

1. Rotate Immediately

Assume any committed secret is compromised. Even if the repo is private, the secret may have been cached, logged, or accessed by CI/CD systems.

  • Revoke the existing credential
  • Generate a new credential
  • Update the credential wherever it's used (services, deployments)

2. Remove from Code

Replace the hardcoded secret with a secure reference:

// WRONG — hardcoded secret
var connectionString = "Server=prod.db;Password=s3cr3t!";

// CORRECT — environment variable
var connectionString = Environment.GetEnvironmentVariable("DB_CONNECTION_STRING");

// CORRECT — Azure Key Vault (Bitwarden's approach)
var connectionString = await keyVaultClient.GetSecretAsync("db-connection-string");

3. Remove from Git History (If Needed)

If the secret was committed to a public repo or a repo that will become public:

# Using git filter-repo (preferred over filter-branch)
git filter-repo --path-glob '*.json' --replace-text expressions.txt

# expressions.txt format:
# literal:the-secret-value==>REDACTED

Warning: Rewriting git history is destructive and affects all collaborators. Only do this when the secret was exposed in a public or soon-to-be-public repository.

4. Prevent Recurrence

  • Add patterns to .gitignore for files that should never be committed (.env, *.pfx, appsettings.Development.json)
  • Enable GitHub push protection for the repository
  • Use secret scanning custom patterns for organization-specific secret formats

Secure Alternatives

Bitwarden uses Azure Key Vault for secrets management, provisioned by the BRE team:

Instead OfUse
Hardcoded connection stringsAzure Key Vault secrets
API keys in config filesEnvironment variables set at deployment
Certificates in sourceAzure Key Vault certificates
Shared team credentials in codeManaged identities (Azure)
Secrets in CI/CD workflow filesGitHub Actions secrets (${{secrets.NAME}})

For local development, use user-secrets or .env files that are .gitignored — never commit them.

Critical Rules

  • Assume any committed secret is compromised. Always rotate, even if the repo is private. No exceptions.
  • Never suppress secret scanning alerts without rotation. Dismissing an alert doesn't make the exposure go away.
  • Validation, not just detection. When a potential secret is found, verify it's real before raising an alarm. Check if it's a test value, placeholder, or encrypted content.
  • Check the full commit history. A secret removed in the latest commit may still exist in git history. Use git log -p -S "secret-pattern" to search history.
  • Bitwarden uses Azure Key Vault for secrets management. If a new secret needs to be stored, work with BRE to provision vault access for the repository.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

37.39%
按下载量换算79

Claude

31.01%
按下载量换算66

Cursor

16.76%
按下载量换算36

Gemini CLI

8.42%
按下载量换算18

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills