用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/diegosouzapw/awesome-omni-skill --skill secret-scanner命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
Token-efficient tracking for AI orchestration. CLI-first for status updates (~50 tokens), agent fallback for complex ops (~1KB). Use when: updating task status, querying blockers, creating progress files, validating phases.
AshAi extension guidelines for integrating AI capabilities with Ash Framework. Use when implementing vectorization/embeddings, exposing Ash actions as LLM tools, creating prompt-backed actions, or setting up MCP servers. Covers semantic search, LangChain integration, and structured outputs.
This skill should be used when solving hard questions, complex architectural problems, or debugging issues that benefit from GPT-5 Pro or GPT-5.1 thinking models with large file context. Use when standard Claude analysis needs deeper reasoning or extended context windows.
基于 SOC 职业分类
| name | secret-scanner |
| description | 自動掃描程式碼中的敏感資訊。當準備 commit、編輯設定檔、新增環境變數、或建立 PR 時自動執行。檢測 API keys、tokens、密碼、資料庫連線字串等敏感資訊,防止意外洩漏。 |
| allowed-tools | ["Read","Glob","Grep","Bash(git diff *)","Bash(git status *)"] |
Claude 會在以下情況自動執行此 skill:
| 觸發情境 | 說明 |
|---|---|
| 準備 Commit | 在 commit 前檢查 staged 檔案 |
| 編輯設定檔 | 修改 .env、config 等檔案 |
| 新增環境變數 | 任何涉及環境變數的變更 |
| 建立 PR | PR 建立前的最終檢查 |
| 新增檔案 | 建立新檔案時檢查內容 |
# AWS
AKIA[0-9A-Z]{16}
aws[_-]?(secret[_-]?access[_-]?key|access[_-]?key[_-]?id)
# Anthropic
sk-ant-[a-zA-Z0-9-_]{40,}
# OpenAI
sk-[a-zA-Z0-9]{48}
# Gemini/Google
AIza[0-9A-Za-z-_]{35}
# Groq
gsk_[a-zA-Z0-9]{52}
# Slack
xox[baprs]-[0-9]{10,13}-[a-zA-Z0-9-]+
# GitHub
gh[pousr]_[A-Za-z0-9_]{36,}
github_pat_[a-zA-Z0-9]{22}_[a-zA-Z0-9]{59}
# Generic
api[_-]?key\s*[:=]\s*['"][^'"]{20,}['"]
secret[_-]?key\s*[:=]\s*['"][^'"]{20,}['"]
# PostgreSQL
postgres(ql)?://[^:]+:[^@]+@[^/]+/\w+
# MySQL
mysql://[^:]+:[^@]+@[^/]+/\w+
# MongoDB
mongodb(\+srv)?://[^:]+:[^@]+@[^/]+
# Redis
redis://[^:]+:[^@]+@[^:]+:\d+
# Private Keys
-----BEGIN (RSA |EC |OPENSSH |DSA )?PRIVATE KEY-----
-----BEGIN PGP PRIVATE KEY BLOCK-----
# Certificates
-----BEGIN CERTIFICATE-----
password\s*[:=]\s*['"][^'"]+['"]
passwd\s*[:=]\s*['"][^'"]+['"]
pwd\s*[:=]\s*['"][^'"]+['"]
# 查看 staged 檔案
git diff --cached --name-only
# 或掃描特定目錄
find . -type f \( -name "*.ts" -o -name "*.js" -o -name "*.env*" -o -name "*.json" \)
白名單(不掃描):
.env.example - 範例檔案(無真實值)*.test.ts - 測試檔案中的 mock 值node_modules/ - 第三方套件.git/ - Git 內部檔案對每個檔案:
區分真正的敏感資訊和誤報:
| 類型 | 處理方式 |
|---|---|
| 真實 API Key | 🔴 立即警告,阻止提交 |
| 環境變數引用 | ✅ 安全(如 process.env.API_KEY) |
| 範例/Mock 值 | ✅ 安全(如 sk-test-xxx) |
| 文件說明 | ✅ 安全(文檔中的格式說明) |
## 🚨 Secret Scanner 警告
### 發現敏感資訊!
| 檔案 | 行號 | 類型 | 風險等級 |
|------|------|------|---------|
| `apps/server/config.ts` | 15 | API Key | 🔴 高 |
| `packages/env/index.ts` | 42 | DB Password | 🔴 高 |
### 詳細資訊
#### 🔴 apps/server/config.ts:15
**類型**: Gemini API Key
**發現內容**: `AIzaSyB...`(已遮蔽)
**建議**: 移至環境變數
\`\`\`typescript
// ❌ 不安全
const apiKey = "AIzaSyB...";
// ✅ 安全
const apiKey = process.env.GEMINI_API_KEY;
\`\`\`
### ⛔ 行動要求
1. **不要提交這些變更**
2. 將敏感資訊移至 `.env` 檔案
3. 確保 `.env` 在 `.gitignore` 中
4. 重新掃描確認安全
## ✅ Secret Scanner 通過
**掃描範圍**: X 個檔案
**掃描時間**: YYYY-MM-DD HH:mm
### 檢查項目
- [x] API Keys & Tokens
- [x] 資料庫連線字串
- [x] 私鑰與憑證
- [x] 硬編碼密碼
### 白名單排除
- `.env.example` (範例檔案)
- `tests/**` (測試 mock)
**結論**: 未發現敏感資訊,可以安全提交。
| 環境變數 | 用途 | 應在檔案 |
|---|---|---|
GEMINI_API_KEY | Gemini AI | .env |
GROQ_API_KEY | Groq Whisper | .env |
SLACK_BOT_TOKEN | Slack Bot | Cloudflare Secrets |
DATABASE_URL | PostgreSQL | .env / Cloudflare |
BETTER_AUTH_SECRET | Auth 加密 | .env |
// ✅ 正確:從環境變數讀取
import { env } from "@sales-ai/env";
const apiKey = env.GEMINI_API_KEY;
// ❌ 錯誤:硬編碼
const apiKey = "AIzaSyB...";
| 工具 | 用途 |
|---|---|
Grep | 執行正則匹配 |
Read | 讀取檔案內容 |
Glob | 找出需掃描的檔案 |
Bash(git) | 識別變更範圍 |
/commit - Commit 前自動執行掃描/pr-review - PR 前執行掃描/security-audit - 完整安全審計