Token导航 LogoToken导航

Agent Skill · 研究检索

secrets-scanner(秘密扫描仪)

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

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

总安装 212周安装 9GitHub Stars 2下载 74核验 2026-05-01

安装说明

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

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/monkey1sai/openai-cli --skill secrets-scanner

这个 Skill 是做什么的

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

用于辅助安全审计、权限检查和凭据风险排查。适合梳理敏感配置、分析鉴权逻辑或生成安全复核清单。不能将工具输出直接当最终结论,涉及密钥或生产系统时应先确认最小权限。

安装命令:npx skills add https://github.com/monkey1sai/openai-cli --skill secrets-scanner 适用于 Codex、Claude、Cursor、Gemini CLI,通过 GitHub 安装

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

上手步骤

4 步
  1. 1

    确认自己的宿主工具

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

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/monkey1sai/openai-cli --skill secrets-scanner;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

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

  4. 4

    按最小权限试用

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

常见问题

6 条

secrets-scanner 怎么安装?

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

secrets-scanner 支持哪些 AI 工具?

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

secrets-scanner 需要什么权限?

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

secrets-scanner 是免费的吗?

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

secrets-scanner 用的人多吗?

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

secrets-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调用外部服务未明确有提醒
secrets-scanner

秘密扫描仪 · 本页

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

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

SKILL.md 原文

Secrets Scanner

Detect and prevent leaked credentials in your codebase.

Secret Detection Patterns

# .gitleaks.toml
title = "Gitleaks Configuration"

[[rules]]
id = "aws-access-key"
description = "AWS Access Key"
regex = '''(A3T[A-Z0-9]|AKIA|AGPA|AIDA|AROA|AIPA|ANPA|ANVA|ASIA)[A-Z0-9]{16}'''
tags = ["key", "AWS"]

[[rules]]
id = "aws-secret-key"
description = "AWS Secret Key"
regex = '''(?i)aws(.{0,20})?(?-i)['\"][0-9a-zA-Z\/+]{40}['\"]'''
tags = ["key", "AWS"]

[[rules]]
id = "github-token"
description = "GitHub Personal Access Token"
regex = '''ghp_[0-9a-zA-Z]{36}'''
tags = ["key", "GitHub"]

[[rules]]
id = "github-oauth"
description = "GitHub OAuth Token"
regex = '''gho_[0-9a-zA-Z]{36}'''
tags = ["key", "GitHub"]

[[rules]]
id = "slack-webhook"
description = "Slack Webhook URL"
regex = '''https://hooks\.slack\.com/services/T[a-zA-Z0-9_]{8,10}/B[a-zA-Z0-9_]{8,10}/[a-zA-Z0-9_]{24}'''
tags = ["webhook", "Slack"]

[[rules]]
id = "private-key"
description = "Private Key"
regex = '''-----BEGIN (RSA|OPENSSH|DSA|EC|PGP) PRIVATE KEY-----'''
tags = ["key", "private"]

[[rules]]
id = "generic-api-key"
description = "Generic API Key"
regex = '''(?i)(api[_-]?key|apikey|access[_-]?key)(.{0,20})?['"][0-9a-zA-Z]{32,}['"]'''
tags = ["key", "generic"]

[[rules]]
id = "database-connection"
description = "Database Connection String"
regex = '''(?i)(postgresql|mysql|mongodb):\/\/[^\s:]+:[^\s@]+@[^\s\/]+'''
tags = ["database", "credentials"]

[allowlist]
description = "Allowlist"
paths = [
  '''node_modules/''',
  '''\.git/''',
  '''\.lock$''',
]

regexes = [
  '''EXAMPLE_KEY_123''',
  '''your_api_key_here''',
  '''<API_KEY>''',
]

## Pre-commit Hook Setup

.pre-commit-config.yaml

repos: - repo: https://github.com/gitleaks/gitleaks rev: v8.18.0 hooks: - id: gitleaks

- repo: https://github.com/Yelp/detect-secrets rev: v1.4.0 hooks: - id: detect-secrets args: ['--baseline', '.secrets.baseline']

- repo: local hooks: - id: check-env-files name: Check for .env files entry: bash -c 'if git diff --cached --name-only | grep -E "\.env$"; then echo "❌ .env file detected! Add to .gitignore"; exit 1; fi' language: system pass_filenames: false

Install pre-commit

pip install pre-commit

Install hooks

pre-commit install

Run on all files

pre-commit run --all-files


## CI Integration

.github/workflows/secrets-scan.yml

name: Secrets Scan

on: push: branches: [main, develop] pull_request: branches: [main, develop]

jobs: gitleaks: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 with: fetch-depth: 0 # Full history for scanning

- name: Run Gitleaks uses: gitleaks/gitleaks-action@v2 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITLEAKS_LICENSE: ${{ secrets.GITLEAKS_LICENSE }}

trufflehog: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 with: fetch-depth: 0

- name: TruffleHog OSS uses: trufflesecurity/trufflehog@main with: path: ./ base: ${{ github.event.repository.default_branch }} head: HEAD extra_args: --debug --only-verified


## Custom Secret Scanner

// scripts/scan-secrets.ts import * as fs from "fs"; import * as path from "path";

interface SecretPattern { name: string; regex: RegExp; severity: "critical" | "high" | "medium"; }

const SECRET_PATTERNS: SecretPattern[] = [ { name: "AWS Access Key", regex: /(A3T[A-Z0-9]|AKIA|AGPA|AIDA|AROA|AIPA|ANPA|ANVA|ASIA)[A-Z0-9]{16}/g, severity: "critical", }, { name: "Private Key", regex: /-----BEGIN (RSA|OPENSSH|DSA|EC|PGP) PRIVATE KEY-----/g, severity: "critical", }, { name: "Generic API Key", regex: /['"]?[a-zA-Z0-9_-]*api[_-]?key['"]?\s*[:=]\s*['"][a-zA-Z0-9]{32,}['"]/gi, severity: "high", }, { name: "Database URL", regex: /(postgresql|mysql|mongodb):\/\/[^\s:]+:[^\s@]+@[^\s\/]+/gi, severity: "critical", }, { name: "JWT Token", regex: /eyJ[a-zA-Z0-9_-]*\.eyJ[a-zA-Z0-9_-]*\.[a-zA-Z0-9_-]*/g, severity: "high", }, ];

interface SecretFinding { file: string; line: number; column: number; pattern: string; match: string; severity: string; }

function scanFile(filePath: string): SecretFinding[] { const findings: SecretFinding[] = []; const content = fs.readFileSync(filePath, "utf-8"); const lines = content.split("\n");

lines.forEach((line, lineIndex) => { SECRET_PATTERNS.forEach((pattern) => { const matches = line.matchAll(pattern.regex);

for (const match of matches) { findings.push({ file: filePath, line: lineIndex + 1, column: match.index || 0, pattern: pattern.name, match: match[0].substring(0, 50) + "...", severity: pattern.severity, }); } }); });

return findings; }

function scanDirectory(dir: string): SecretFinding[] { const findings: SecretFinding[] = []; const files = fs.readdirSync(dir, { withFileTypes: true });

const ignorePaths = ["node_modules", ".git", "dist", "build"];

files.forEach((file) => { const fullPath = path.join(dir, file.name);

if (file.isDirectory() && !ignorePaths.includes(file.name)) { findings.push(...scanDirectory(fullPath)); } else if (file.isFile()) { findings.push(...scanFile(fullPath)); } });

return findings; }

// Run scan const findings = scanDirectory("./src");

if (findings.length > 0) { console.error("🚨 Secrets detected!\n");

findings.forEach((f) => { console.error( [${f.severity.toUpperCase()}] ${f.file}:${f.line}:${f.column} ); console.error( Pattern: ${f.pattern}); console.error( Match: ${f.match}\n); });

process.exit(1); } else { console.log("✅ No secrets detected"); }


## Remediation Steps

Secret Leak Remediation Checklist

Immediate Actions (< 1 hour)

  1. Revoke the compromised secret

- [ ] Deactivate API key/token immediately - [ ] Rotate credentials in production - [ ] Update all services using the secret

  1. Remove from git history
   # Using BFG Repo-Cleaner
   bfg --replace-text secrets.txt repo.git
   git reflog expire --expire=now --all
   git gc --prune=now --aggressive

   # Force push (requires team coordination)
   git push --force --all

1. **Notify stakeholders**
  - Security team
  - DevOps team
  - Service owners
  - Management (if public repo)

## Short-term Actions (< 24 hours)

1. **Audit access logs**
  - Check CloudWatch/CloudTrail for suspicious activity
  - Review API usage for unauthorized access
  - Check for data exfiltration
2. **Update secret management**
  - Store in vault (AWS Secrets Manager, HashiCorp Vault)
  - Use environment variables
  - Remove hardcoded secrets
3. **Add scanning**
  - Install pre-commit hooks
  - Add CI secret scanning
  - Set up monitoring alerts

## Long-term Actions (< 1 week)

1. **Review and improve**
  - Conduct security training
  - Update secret management policies
  - Implement secret rotation schedule
  - Document incident and lessons learned

Secret Management Best Practices

// ❌ BAD: Hardcoded secrets
const API_KEY = 'sk_live_abc123xyz789';
const db = connect('mongodb://admin:password@localhost');

// ✅ GOOD: Environment variables
const API_KEY = process.env.API_KEY;
const db = connect(process.env.DATABASE_URL);

// ✅ BETTER: Secret management service
import { SecretsManagerClient, GetSecretValueCommand } from '@aws-sdk/client-secrets-manager';

async function getSecret(secretName: string): Promise<string> {
  const client = new SecretsManagerClient({ region: 'us-east-1' });
  const response = await client.send(
    new GetSecretValueCommand({ SecretId: secretName })
  );
  return response.SecretString!;
}

const apiKey = await getSecret('prod/api/stripe-key');

GitHub Secret Scanning

# Enable GitHub secret scanning (Enterprise)
# Settings → Security & analysis → Secret scanning

# Configure custom patterns
# .github/secret_scanning.yml
patterns:
  - name: Company API Key
    pattern: "company_[a-zA-Z0-9]{32}"
    secret_type: company_api_key

Environment Variable Validation

// config/env-validation.ts
import { z } from "zod";

const envSchema = z
  .object({
    NODE_ENV: z.enum(["development", "production", "test"]),
    DATABASE_URL: z.string().url(),
    API_KEY: z.string().min(32),
    JWT_SECRET: z.string().min(64),
    // Never allow default/example values in production
  })
  .refine((env) => {
    if (env.NODE_ENV === "production") {
      const invalidValues = ["example", "test", "localhost", "changeme"];
      return !invalidValues.some((val) =>
        Object.values(env).some((envVal) =>
          String(envVal).toLowerCase().includes(val)
        )
      );
    }
    return true;
  }, "Production environment cannot use example/test values");

// Validate on startup
try {
  envSchema.parse(process.env);
} catch (error) {
  console.error("❌ Invalid environment configuration:", error);
  process.exit(1);
}

Monitoring & Alerts

// monitoring/secret-monitoring.ts
import {
  CloudWatchClient,
  PutMetricDataCommand,
} from "@aws-sdk/client-cloudwatch";

async function monitorSecretUsage(secretName: string) {
  const cloudwatch = new CloudWatchClient();

  await cloudwatch.send(
    new PutMetricDataCommand({
      Namespace: "Security/Secrets",
      MetricData: [
        {
          MetricName: "SecretAccess",
          Value: 1,
          Unit: "Count",
          Dimensions: [
            {
              Name: "SecretName",
              Value: secretName,
            },
          ],
        },
      ],
    })
  );
}

// Alert on unusual secret access patterns

Best Practices

  1. Never commit secrets: Use.gitignore for.env files
  2. Use secret managers: AWS Secrets Manager, Vault
  3. Rotate regularly: 90-day rotation policy
  4. Scan continuously: Pre-commit + CI + scheduled scans
  5. Least privilege: Minimal secret access
  6. Audit logs: Track secret access
  7. Incident response: Have remediation playbook ready

Output Checklist

  • Gitleaks configuration created
  • Pre-commit hooks installed
  • CI secret scanning configured
  • Custom scanner implemented (optional)
  • Remediation playbook documented
  • Secret management best practices
  • Environment validation
  • Monitoring and alerts
  • .gitignore includes.env files
  • Team trained on secret handling

平台分布

Codex

36.54%
按下载量换算27

Claude

30.41%
按下载量换算23

Cursor

20.42%
按下载量换算15

Gemini CLI

9.61%
按下载量换算7

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

未通过

权限和风险

接触敏感数据

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

安装前确认

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

继续浏览同类 Skills