Declarative .mdcกฎ Cursor/Claude/Windsurf และเวิร์กโฟลว์ n8nกฎ IDEตรวจสอบการรั่วไหลแบบ Zero-Secret แล้ว
Zero-Secret MCP Manifest & Agentic Security Constitution
นโยบายความปลอดภัย .mdc และ CLAUDE.md ที่ประกาศจะบล็อกโทเค็น API แบบฮาร์ดโค้ดใน mcp.json บังคับใช้ SQL แบบกำหนดพารามิเตอร์ และจำกัดการโทร CIDR SSRF ส่วนตัว
ไฟล์กฎตัวแทนและ IDE ที่ประกาศ
---
description: Prevent hardcoded credentials in MCP manifests, enforce parameterized SQL, and block SSRF to RFC1918 networks
globs: **/{*mcp*.json,.env*,*.go,*.ts,*.py}
alwaysApply: true
---
# Zero-Secret MCP & Agentic Security Policy
- NEVER hardcode literal API keys (`sk-*`, `ghp_*`, `github_pat_*`, `AKIA*`, `xoxb-*`) or database passwords in `.cursor/mcp.json`, `.vscode/mcp.json`, or `claude_desktop_config.json`.
- Reference host keychain or `.env` variables exclusively via `${ENV_VAR}` syntax, and omit the `"env"` object entirely when no secret is required.
- Pin exact package versions or container image SHA-256 digests for production STDIO servers; never wrap MCP commands in `sh -c` or `bash -c`.
- Block outbound agent HTTP fetchers from reaching loopback (`127.0.0.0/8`), link-local cloud metadata (`169.254.169.254`), and RFC1918 private subnets.
- Bind database inspection MCP servers to read-only PostgreSQL/MySQL roles with `SET default_transaction_read_only = on` and `statement_timeout = '5s'`.
## Verification Check
```bash
git grep -En '(sk-[A-Za-z0-9_-]{16,}|ghp_[A-Za-z0-9]{20,}|AKIA[0-9A-Z]{16})' && exit 1 || echo 'Zero secret leaks detected'
```หมายเหตุการตั้งค่าชุมชนและบทวิจารณ์การผลิต (0)
ยังไม่มีบันทึกของชุมชน แบ่งปันเคล็ดลับการกำหนดค่าการใช้งานจริงของคุณด้านล่าง
เครื่องมือ MCP ที่เปิดเผยและตัวตรวจสอบสคีมาทรัพยากร
| เครื่องมือ / ตัวระบุทรัพยากร | พารามิเตอร์อินพุต | พฤติกรรมการดำเนินการ |
|---|---|---|
| forbid_plaintext_mcp_env | .cursor/mcp.json, claude_desktop_config.json | Rejects literal sk-*, ghp_*, AKIA*, and DSN credentials inside MCP env blocks; mandates ${VAR} interpolation. |
| enforce_readonly_db_roles | db/**/*.sql, internal/db/**/*.go | Mandates read-only database sessions with bounded statement_timeout for analytical agent tools. |