Token导航 LogoToken导航

Agent Skill · 研究检索

secret-scanner(秘密扫描仪)

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

secret-scanner 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为接触敏感数据;许可证信息还不明确,第三方扫描有未通过项,按安装量在研究检索类的 73,675 个 Skill 里排第 68,015。

总安装 238周安装 10GitHub Stars 3下载 83核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/1mangesh1/dev-skills-collection --skill secret-scanner

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

可扫描代码仓库、配置文件及Git提交历史中的潜在泄露风险,覆盖AWS、GCP、GitHub等常见平台。核心能力包括基于熵值的字符串分析、200+正则模式匹配以及多格式文件支持。建议结合CI/CD流程自动化执行,并配合人工复核以减少误报干扰。

安装需通过npx命令添加指定GitHub仓库路径, 运行前应确认最小权限原则并避免在生产环境直接扫描敏感数据。

来源仓库内路径:skills/secret-scanner

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/1mangesh1/dev-skills-collection --skill secret…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要接触敏感数据,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

secret-scanner 怎么安装?

在终端执行 npx skills add https://github.com/1mangesh1/dev-skills-collection --skill secret-scanner。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

secret-scanner 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

secret-scanner 需要什么权限?

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

secret-scanner 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

secret-scanner 用的人多吗?

公开数据是累计安装 238 次,近一周安装 10 次,下载 83 次,GitHub 3 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

secret-scanner 安全吗?

第三方扫描有未通过项,风险较高。除非你确认过源码,否则不建议直接安装到常用环境。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。

先想清楚的地方

  • 需要接触敏感数据,装到常用环境前要先评估影响面。
  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 环境里有大量密钥、凭证,不方便给第三方 Skill 读取的人。
  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
secret-scanner

秘密扫描仪 · 本页

2383接触敏感数据未明确未通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Secret Scanner

A comprehensive secret detection skill for AI agents. Detects API keys, tokens, passwords, private keys, and credentials across 50+ services. Features entropy-based detection, git history scanning, and CI/CD integration.

Capabilities

  1. Secret Detection - Find hardcoded secrets using 200+ regex patterns
  2. Entropy Analysis - Detect high-entropy strings that may be secrets
  3. Provider Coverage - AWS, GCP, Azure, GitHub, Stripe, and 50+ more
  4. Git History Scan - Scan entire commit history for leaked secrets
  5. File Type Support - Code, configs, env files, JSON, YAML, and more
  6. Risk Scoring - Score findings by severity and exposure context
  7. False Positive Filtering - Smart exclusions for test data and examples
  8. Remediation Guidance - Step-by-step secret rotation instructions
  9. CI/CD Integration - Pre-commit hooks and GitHub Actions
  10. Allowlist Support - Configure known-safe patterns to skip

Usage

/secret-scanner [command] [path] [options]

Commands

  • scan <path> - Scan files or directories for secrets
  • scan-git <path> - Scan git history for leaked secrets
  • audit <path> - Full security audit with report generation
  • verify <secret> - Check if a specific string matches secret patterns
  • providers - List all supported secret providers
  • report - Generate report from existing findings

Options

  • --format <type> - Output format: json, markdown, sarif (default: markdown)
  • --output <file> - Write results to file
  • --severity <level> - Minimum severity: low, medium, high, critical
  • --include <patterns> - File patterns to include
  • --exclude <patterns> - File patterns to exclude
  • --entropy <threshold> - Entropy threshold (default: 4.5)
  • --no-entropy - Disable entropy-based detection
  • --allowlist <file> - Path to allowlist configuration
  • --git-depth <n> - Number of commits to scan (default: all)

Workflow

When invoked, follow this workflow:

Step 1: Determine Scan Scope

Ask the user to specify:

  • Target path (file, directory, or repository)
  • Scan type (current files, git history, or both)
  • Whether to include entropy-based detection

Step 2: File Discovery

Use Glob to find relevant files:

# Source code
**/*.{py,js,ts,tsx,jsx,java,go,rb,php,cs,swift,kt,rs,c,cpp,h}

# Configuration
**/*.{env,json,yaml,yml,xml,toml,ini,conf,cfg,properties}

# Infrastructure
**/*.{tf,tfvars,hcl,dockerfile,docker-compose*}

# Shell scripts
**/*.{sh,bash,zsh,ps1,bat,cmd}

# Certificates and keys
**/*.{pem,key,p12,pfx,jks,keystore}

Step 3: Pattern Matching

Apply detection patterns from references/secret-patterns.md:

Critical Severity
# AWS Access Keys
AKIA[0-9A-Z]{16}

# AWS Secret Keys
(?i)aws.{0,20}['"][0-9a-zA-Z/+]{40}['"]

# GitHub Tokens
gh[pousr]_[A-Za-z0-9_]{36,255}

# Private Keys
-----BEGIN (RSA |EC |DSA |OPENSSH )?PRIVATE KEY-----
High Severity
# Generic API Keys
(?i)(api[_-]?key|apikey)['"]?\s*[:=]\s*['"][a-zA-Z0-9_\-]{20,}['"]

# Generic Tokens
(?i)(token|bearer|auth)['"]?\s*[:=]\s*['"][a-zA-Z0-9_\-\.]{20,}['"]

# Passwords
(?i)(password|passwd|pwd)['"]?\s*[:=]\s*['"][^'"]{8,}['"]

Step 4: Entropy Analysis

For strings not matching known patterns, calculate Shannon entropy:

def calculate_entropy(string):
    """Calculate Shannon entropy of a string."""
    from collections import Counter
    import math

    if not string:
        return 0

    counts = Counter(string)
    length = len(string)

    entropy = -sum(
        (count / length) * math.log2(count / length)
        for count in counts.values()
    )

    return entropy

# Flag strings with entropy > 4.5 and length >= 20

Step 5: Context Analysis

For each potential secret:

  1. Check surrounding context (variable names, comments)
  2. Verify it's not in a test/example file
  3. Check against allowlist
  4. Determine exposure context (public repo,.env, etc.)

Step 6: Calculate Risk Score

Apply formula from references/risk-scoring.md:

Risk = (Sensitivity × 0.40) + (Exposure × 0.30) +
       (Verifiability × 0.15) + (Scope × 0.15)

Step 7: Generate Output

Format findings following examples/sample-finding.json:

{
  "id": "S-20260204-0001",
  "file": "config/settings.py",
  "line": 42,
  "secret_type": "aws_access_key",
  "provider": "AWS",
  "value_preview": "AKIA...XXXX",
  "confidence": 0.98,
  "risk_score": 95,
  "severity": "critical",
  "context": "AWS_ACCESS_KEY = 'AKIA[REDACTED]'",
  "remediation": [...],
  "verified": false
}

Supported Providers

Cloud Providers

ProviderSecret TypesPattern Count
AWSAccess Keys, Secret Keys, Session Tokens8
GCPAPI Keys, Service Account Keys, OAuth6
AzureStorage Keys, Connection Strings, SAS Tokens7
DigitalOceanAPI Tokens, Spaces Keys3
HerokuAPI Keys, OAuth Tokens2
Alibaba CloudAccess Keys, Secret Keys3

Code Platforms

ProviderSecret TypesPattern Count
GitHubPersonal Access Tokens, App Tokens, OAuth5
GitLabPersonal Tokens, Pipeline Tokens, Runner Tokens4
BitbucketApp Passwords, OAuth, Repository Tokens3
npmAuth Tokens, Publish Tokens2
PyPIAPI Tokens1

Payment Services

ProviderSecret TypesPattern Count
StripeSecret Keys, Publishable Keys, Restricted Keys4
PayPalClient Secrets, Access Tokens2
SquareAccess Tokens, Application IDs2
BraintreeAccess Tokens, Merchant IDs2

Communication Services

ProviderSecret TypesPattern Count
TwilioAccount SID, Auth Token, API Key4
SendGridAPI Keys2
MailchimpAPI Keys1
SlackBot Tokens, User Tokens, Webhooks4
DiscordBot Tokens, Webhooks2

Database Services

ProviderSecret TypesPattern Count
MongoDBConnection Strings2
PostgreSQLConnection Strings2
MySQLConnection Strings2
RedisConnection Strings, Auth Tokens2

Other Services

ProviderSecret TypesPattern Count
OpenAIAPI Keys2
AnthropicAPI Keys1
FirebaseAPI Keys, Admin SDK Keys3
CloudflareAPI Keys, API Tokens2
DatadogAPI Keys, App Keys2
New RelicLicense Keys, API Keys2
Auth0Client Secrets, API Tokens2
OktaAPI Tokens1
JWTTokens (signature analysis)1

Full pattern list: references/secret-patterns.md

Git History Scanning

Scan Modes

  1. Full History - Scan all commits
  2. Depth Limited - Scan last N commits
  3. Branch Specific - Scan specific branch
  4. Diff Mode - Only scan changed lines

Usage

# Scan entire history
/secret-scanner scan-git ./repo

# Scan last 100 commits
/secret-scanner scan-git ./repo --git-depth 100

# Scan specific branch
/secret-scanner scan-git ./repo --branch feature/auth

Git-Specific Findings

{
  "commit": "abc123",
  "author": "developer@example.com",
  "date": "2026-01-15T10:30:00Z",
  "message": "Add API configuration",
  "file": "config.py",
  "secret_type": "stripe_secret_key",
  "still_present": false,
  "removed_in": "def456"
}

Entropy-Based Detection

How It Works

  1. Extract string literals and values from files
  2. Calculate Shannon entropy for each string
  3. Flag high-entropy strings (> 4.5) that are:

- At least 20 characters long - Contain mixed character classes - In security-sensitive contexts

Entropy Thresholds

ThresholdDetection LevelFalse Positive Rate
3.5AggressiveHigh
4.0ModerateMedium
4.5Balanced (default)Low
5.0ConservativeVery Low

Context Boosting

Entropy findings are boosted if found in:

  • Variable names containing: key, secret, token, password, auth
  • Files: .env, secrets.*, credentials.*
  • Config sections: [credentials], [auth]

False Positive Handling

Built-in Exclusions

  1. Test Files - *_test.*, *_spec.*, test_*.*, __tests__/*
  2. Example Files - example.*, sample.*, demo.*
  3. Documentation - *.md, *.rst, docs/*
  4. Mock Data - Files containing "mock", "fake", "dummy"
  5. Known Safe Patterns:

- AKIAIOSFODNN7EXAMPLE (AWS example key) - sk_test_* (Stripe test keys) - pk_test_* (Stripe test publishable keys) - xoxb-PLACEHOLDER-EXAMPLE-TOKEN (Slack example)

Allowlist Configuration

Create .secret-scanner-allowlist.yaml:

# Allowlist configuration
patterns:
  # Regex patterns to ignore
  - "EXAMPLE_[A-Z_]+"
  - "test_api_key_\\d+"

paths:
  # Files/directories to skip
  - "test/"
  - "fixtures/"
  - "*.example"

hashes:
  # SHA256 hashes of known false positives
  - "abc123..."

comments:
  # Inline comments that suppress warnings
  - "# secret-scanner:ignore"
  - "// nosecret"

Risk Scoring

Severity Levels

ScoreSeverityResponseExamples
90-100CriticalImmediateAWS keys, private keys, prod DB passwords
70-89HighWithin 4 hoursAPI keys, OAuth tokens, service accounts
50-69MediumWithin 24 hoursTest API keys, internal tokens
25-49LowWithin 1 weekEntropy matches, partial credentials
0-24InfoReviewPossible false positives

Factor Weights

  • Sensitivity (40%): Type of secret and potential damage
  • Exposure (30%): Where the secret was found
  • Verifiability (15%): Can the secret be validated as real
  • Scope (15%): Blast radius if exploited

Full methodology: references/risk-scoring.md

Remediation Workflow

Step 1: Immediate Actions

  1. Revoke the secret - Invalidate immediately in provider console
  2. Rotate credentials - Generate new secret
  3. Update applications - Deploy new credentials
  4. Audit access logs - Check for unauthorized usage

Step 2: Clean Up

  1. Remove from code - Delete the hardcoded secret
  2. Clean git history - Use BFG or git filter-branch
  3. Force push - Update all branches
  4. Invalidate caches - Clear CI/CD caches

Step 3: Prevention

  1. Add to.gitignore - Prevent future commits
  2. Install pre-commit hook - Block commits with secrets
  3. Use secrets manager - AWS Secrets Manager, HashiCorp Vault
  4. Environment variables - Store secrets in environment

Provider-specific instructions: references/remediation.md

CI/CD Integration

Pre-Commit Hook

# Install the pre-commit hook
cp scripts/pre-commit-hook.sh .git/hooks/pre-commit
chmod +x .git/hooks/pre-commit

Pre-commit Framework

# .pre-commit-config.yaml
repos:
  - repo: local
    hooks:
      - id: secret-scanner
        name: Secret Scanner
        entry: python scripts/detect-secrets.py
        language: python
        types: [file]
        pass_filenames: true

GitHub Actions

# .github/workflows/secret-scan.yml
name: Secret Scan
on: [push, pull_request]
jobs:
  scan:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0  # Full history for git scanning
      - uses: actions/setup-python@v5
        with:
          python-version: '3.11'
      - name: Run Secret Scan
        run: |
          python scripts/detect-secrets.py . --format sarif --output results.sarif
      - name: Upload SARIF
        uses: github/codeql-action/upload-sarif@v3
        with:
          sarif_file: results.sarif

Environment Variables

# Configure behavior
export SECRET_SCANNER_SEVERITY=high      # Minimum severity to report
export SECRET_SCANNER_ENTROPY=4.5        # Entropy threshold
export SECRET_SCANNER_BLOCK=true         # Block on findings
export SECRET_SCANNER_ALLOWLIST=.secret-scanner-allowlist.yaml

Output Formats

JSON (findings.json)

Structured array with all findings and metadata.

Markdown (report.md)

Human-readable report with:

  • Executive summary
  • Findings by severity
  • Provider breakdown
  • Remediation checklist

SARIF

Static Analysis Results Interchange Format for GitHub Security tab integration.

Security Guardrails

  1. Never output full secrets - Show only prefix/suffix with masking
  2. Secure temporary files - Use scratchpad, clean up after
  3. No secret logging - Redact from all log output
  4. Verification is optional - Don't auto-verify against live APIs
  5. Respect allowlists - Honor configured exclusions

References

  • references/secret-patterns.md - All detection patterns
  • references/provider-patterns.md - Provider-specific patterns
  • references/entropy-detection.md - Entropy analysis methodology
  • references/risk-scoring.md - Risk scoring methodology
  • references/remediation.md - Secret rotation guides
  • references/allowlist-config.md - Allowlist configuration

Examples

  • examples/sample-finding.json - Example finding output
  • examples/sample-report.md - Example audit report
  • examples/allowlist.yaml - Example allowlist configuration

Scripts

  • scripts/detect-secrets.py - Main secret detection script
  • scripts/scan-git-history.py - Git history scanner
  • scripts/entropy-analyzer.py - Entropy-based detection
  • scripts/generate-report.py - Report generation
  • scripts/pre-commit-hook.sh - Git pre-commit hook

平台分布

Codex

36.49%
按下载量换算30

Claude

30.73%
按下载量换算26

Cursor

18.12%
按下载量换算15

Gemini CLI

9.99%
按下载量换算8

安全审计

Gen Agent Trust Hub

通过

Socket

未通过

Snyk

通过

权限和风险

接触敏感数据

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

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在提醒或未通过项,安装前请自行复核。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills