agentleFS
TienDat-VnaTienDat-Vna/BackSpec/.agents/skills/security-secret-scanner/SKILL.md

security-secret-scanner

Skill1 starsChanged 46 days agoMITView on GitHub

Quét thời gian thực phát hiện rò rỉ API Keys, Token, Private Key, Database Credentials, thông tin PII (CCCD, SĐT, OTP) trong code, log và git diff.

  • Reads credentials

The file

Files
SKILL.md
<!-- GENERATED FROM registry/skills/security-secret-scanner/SKILL.md — DO NOT EDIT DIRECTLY --><!-- GENERATED FROM .shared/skills/03-hooks/security-secret-scanner/SKILL.md — DO NOT EDIT DIRECTLY -->

Skill — Security & Secret Scanner (Bộ Quét Bảo Mật & Rò Rỉ Thông Tin)

Skill này cung cấp cơ chế quét liên tục và tự động phát hiện mọi rủi ro lộ bí mật (Secret Leakage) và dữ liệu khách hàng nhạy cảm (PII).

🔍 CÁC MẪU DỮ LIỆU CẤM TUYỆT ĐỐI (ZERO-TOLERANCE PATTERNS)

Danh mụcMẫu vi phạm (Regex / Pattern)Mức độ nghiêm trọngHành động
API Secret / Key`(?i)(client_secretclientsecretsecret_keyapi_key)\s*[:=]\s*["'][A-Za-z0-9_-]{8,}["']`🚨 CRITICALHALT & BLOCK
AWS / Cloud KeyAKIA[0-9A-Z]{16} / aws_secret_access_key🚨 CRITICALHALT & BLOCK
Private Key`-----BEGIN (RSAECOPENSSHPGP) PRIVATE KEY-----`🚨 CRITICALHALT & BLOCK
Raw JWT / TokeneyJ[A-Za-z0-9-_]+\.eyJ[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+🚨 CRITICALHALT & BLOCK
PII (CCCD 12 số)\b[0-9]{12}\b (khi in thẳng ra log mà không mask)⚠️ HIGHHALT & BLOCK
Password Hardcode`(?i)(passwordpassphrasedb_pass)\s*[:=]\s*["'][^"'\s]{4,}["']`🚨 CRITICALHALT & BLOCK

🛡️ QUY CHUẨN MASKING BẮT BUỘC

Mọi dữ liệu nhạy cảm trước khi đưa vào LogDTO phải đi qua hàm mask:

private String mask(String str) {
    if (!str) return str
    int len = str.length()
    if (len <= 4) return "*".repeat(len)
    return str.substring(0, 2) + "*".repeat(len - 4) + str.substring(len - 2)
}

🚨 KHI PHÁT HIỆN RÒ RỈ SECRET:

  1. Dừng ngay lập tức quá trình build / commit / execution.
  2. Xóa bỏ dòng code hoặc câu log vi phạm.
  3. Chuyển credentials sang biến môi trường (.env không commit) hoặc Vault/Secret Manager.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.