gathering-security

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Gathering Security 🌲🕷️🦝🐢

安全集结 🌲🕷️🦝🐢

The drum echoes in the shadows. The Spider weaves intricate webs of authentication, each strand placed with precision. The Raccoon rummages through every corner, finding what doesn't belong, cleaning what could harm. The Turtle moves with ancient patience, layering defense upon defense, testing every plate of the shell. Together they secure the forest — doors locked tight, secrets safe, paths protected, and the ground itself hardened against anything that comes.
鼓声在阴影中回荡。蜘蛛精心编织身份认证的复杂网络,每一根丝线都精准排布。浣熊翻遍每一个角落,找出不合规内容,清理潜在威胁。乌龟带着古老的耐心,层层叠加防御,测试每一块“龟壳”的坚固性。它们共同守护这片“森林”——大门紧锁,秘密安全,路径受保护,连地面都已加固,抵御一切来犯之敌。

When to Summon

召唤时机

  • Implementing authentication systems
  • Adding OAuth or session management
  • Security auditing before launch
  • After security incidents
  • Preparing for production deployment
  • When auth, security audit, and deep hardening must work together
  • Building a new feature that handles sensitive data
  • Hardening existing code for defense in depth

  • 实现身份认证系统
  • 添加OAuth或会话管理
  • 上线前的安全审计
  • 安全事件发生后
  • 为生产部署做准备
  • 身份认证、安全审计与深度加固需协同工作时
  • 开发处理敏感数据的新功能
  • 对现有代码进行纵深防御加固

Grove Tools for This Gathering

本次集结可用的Grove工具

Use
gw
and
gf
throughout. Quick reference for security work:
bash
undefined
全程使用
gw
gf
。安全工作快速参考:
bash
undefined

Find security-relevant code patterns

查找安全相关代码模式

gf --agent search "sanitize|escape|validate" # Security patterns gf --agent auth # Find auth code and middleware
gf --agent search "sanitize|escape|validate" # 安全模式 gf --agent auth # 查找身份认证代码及中间件

Verify security changes don't break anything

验证安全变更不会破坏现有功能

gw ci --affected --diagnose # Run CI on affected packages

---
gw ci --affected --diagnose # 对受影响的包运行CI

---

The Gathering

集结流程

SUMMON --> ORGANIZE --> EXECUTE --> VALIDATE --> COMPLETE
   |          |           |           |            |
Receive   Dispatch     Animals     Verify      Security
Request   Animals      Work        Check       Hardened
召唤 --> 组织 --> 执行 --> 验证 --> 完成
   |          |           |           |            |
接收请求   分派角色     执行任务     验证检查      安全加固完成

Animals Mobilized

动员的“动物角色”

  1. 🕷️ Spider — Weave authentication webs with patient precision
  2. 🦝 Raccoon — Rummage for security risks and cleanup
  3. 🐢 Turtle — Harden with layered, defense-in-depth protection

  1. 🕷️ 蜘蛛 —— 精心编织身份认证网络
  2. 🦝 浣熊 —— 排查安全风险并清理隐患
  3. 🐢 乌龟 —— 采用纵深防御策略进行加固

Phase 1: SUMMON

阶段1:召唤

The drum sounds. The shadows shift...
Receive and parse the request:
Clarify the Security Work:
  • Adding new auth provider? (OAuth, SSO)
  • Securing routes and APIs?
  • General security audit?
  • Deep security hardening?
  • Post-incident cleanup?
  • Pre-production hardening?
Error Codes as Security Posture: All errors MUST use Signpost codes — this is a security requirement, not just a convention:
  • All server errors use codes from the appropriate catalog (
    API_ERRORS
    ,
    AUTH_ERRORS
    , etc.)
  • userMessage
    is always generic and warm — no technical details leak to clients
  • adminMessage
    is detailed — stays in server logs only
  • Auth errors NEVER reveal user existence ("Invalid credentials" — not "user not found")
  • logGroveError()
    for all server errors — never
    console.error
    alone
Scope Check:
"I'll mobilize a security gathering for: [security work]
This will involve:
  • 🕷️ Spider weaving authentication
    • OAuth/PKCE flow
    • Session management
    • Route protection
    • Token handling
  • 🦝 Raccoon auditing security
    • Secret scanning
    • Vulnerability check
    • Dependency audit
    • Dead code removal
  • 🐢 Turtle hardening defenses
    • Input/output validation
    • Security headers & CSP
    • Defense-in-depth enforcement
    • Exotic attack vector testing
    • Hardening report
Proceed with the gathering?"
Selective Mobilization: Not every gathering needs all three animals:
SituationAnimals Needed
New auth system + full securityAll three: Spider → Raccoon → Turtle
Auth already exists, need hardeningRaccoon → Turtle
New feature, ensure secure by designTurtle only (or Turtle → Raccoon)
Secrets leak / incident responseRaccoon → Spider (rotate creds) → Turtle (verify)
Pre-production deployRaccoon → Turtle

鼓声响起,阴影开始移动...
接收并解析需求:
明确安全工作内容:
  • 是否添加新的身份认证提供商?(OAuth、SSO)
  • 是否要保护路由和API?
  • 是否需要全面安全审计?
  • 是否需要深度安全加固?
  • 是否需要安全事件后的清理工作?
  • 是否需要为生产环境做前置加固?
错误码作为安全态势的一部分: 所有错误必须使用Signpost代码——这是安全要求,而非仅仅是规范:
  • 所有服务器错误使用对应目录中的代码(
    API_ERRORS
    AUTH_ERRORS
    等)
  • userMessage
    始终为通用友好提示——不得向客户端泄露技术细节
  • adminMessage
    需详细记录——仅保留在服务器日志中
  • 身份认证错误绝不能泄露用户存在性(提示“凭据无效”而非“用户不存在”)
  • 所有服务器错误使用
    logGroveError()
    ——不得仅使用
    console.error
范围确认:
"我将为以下安全工作动员集结:[安全工作内容]
工作内容包括:
  • 🕷️ 蜘蛛编织身份认证网络
    • OAuth/PKCE流程
    • 会话管理
    • 路由保护
    • Token处理
  • 🦝 浣熊开展安全审计
    • 密钥扫描
    • 漏洞检查
    • 依赖审计
    • 无用代码清理
  • 🐢 乌龟进行纵深防御加固
    • 输入/输出验证
    • 安全头与CSP
    • 纵深防御实施
    • 特殊攻击向量测试
    • 加固报告
是否启动本次集结?"
选择性动员: 并非每次集结都需要三个角色:
场景需要动员的角色
新身份认证系统+全面安全保障全部三个:蜘蛛 → 浣熊 → 乌龟
已有身份认证,需进行加固浣熊 → 乌龟
开发新功能,需从设计阶段保障安全仅乌龟(或乌龟 → 浣熊)
密钥泄露/安全事件响应浣熊 → 蜘蛛(轮换凭据) → 乌龟(验证)
生产环境部署前置检查浣熊 → 乌龟

Phase 2: ORGANIZE

阶段2:组织

The animals take their positions in the shadows...
Dispatch in sequence:
Full Dispatch Order:
Spider ──→ Raccoon ──→ Turtle
   │          │            │
   │          │            │
Weave      Audit       Harden
Auth       Secrets     Defenses
Dependencies:
  • Spider must complete before Raccoon (needs auth to audit)
  • Raccoon should complete before Turtle (clean first, then harden)
  • May iterate: Turtle findings → Spider/Raccoon fixes → Turtle re-verify
Iteration Cycle (When Vulnerabilities Found):
┌──────────────────────────────────────────────────────────────────┐
│                   SECURITY ITERATION                              │
├──────────────────────────────────────────────────────────────────┤
│                                                                   │
│  🕷️ Spider ──► 🦝 Raccoon ──► 🐢 Turtle                       │
│  weaves auth    audits          hardens & tests                   │
│       ▲                              │                            │
│       │                              ▼                            │
│       │                     Deep vulnerabilities?                 │
│       │                        /          \                       │
│       │                     Yes            No                     │
│       │                      │              │                     │
│       │         ┌────────────┘              ▼                     │
│       │         ▼                     ✅ Hardened                 │
│       │    Auth issue?                                            │
│       │    /         \                                            │
│       │  Yes          No                                          │
│       │   │           │                                           │
│       └───┘    Raccoon/Turtle                                   │
│                fixes directly                                     │
└──────────────────────────────────────────────────────────────────┘
Iteration Rules:
  • Turtle finds auth vulnerability → Spider patches → Turtle re-verifies
  • Turtle finds non-auth vulnerability → Fix directly → Turtle re-verifies
  • Raccoon finds secrets → Raccoon cleans → Turtle verifies no residual exposure
  • Maximum 3 iterations per issue (if more needed, architectural review required)
  • Each iteration focuses only on newly found/fixed items
  • Document all iterations in final report

动物们在阴影中各就各位...
按顺序分派任务:
完整分派顺序:
蜘蛛 ──→ 浣熊 ──→ 乌龟
   │          │            │
   │          │            │
编织身份认证   开展审计       实施防御加固
依赖关系:
  • 蜘蛛必须先完成工作,浣熊才能开展审计(需要身份认证基础进行审计)
  • 浣熊应先完成审计,乌龟再进行加固(先清理隐患,再加固防御)
  • 可能需要迭代:乌龟发现问题 → 蜘蛛/浣熊修复 → 乌龟重新验证
迭代循环(发现漏洞时):
┌──────────────────────────────────────────────────────────────────┐
│                   安全迭代循环                              │
├──────────────────────────────────────────────────────────────────┤
│                                                                   │
│  🕷️ 蜘蛛 ──► 🦝 浣熊 ──► 🐢 乌龟                       │
│  编织身份认证    开展审计          实施加固与测试                   │
│       ▲                              │                            │
│       │                              ▼                            │
│       │                     发现深度漏洞?                 │
│       │                        /          \                       │
│       │                     是            否                     │
│       │                      │              │                     │
│       │         ┌────────────┘              ▼                     │
│       │         ▼                     ✅ 加固完成                 │
│       │    是否为身份认证问题?                                            │
│       │    /         \                                            │
│       │  是          否                                          │
│       │   │           │                                           │
│       └───┘    浣熊/乌龟直接修复                                   │
│                直接修复问题                                     │
└──────────────────────────────────────────────────────────────────┘
迭代规则:
  • 乌龟发现身份认证漏洞 → 蜘蛛修复 → 乌龟重新验证
  • 乌龟发现非身份认证漏洞 → 直接修复 → 乌龟重新验证
  • 浣熊发现密钥 → 浣熊清理 → 乌龟验证无残留泄露
  • 每个问题最多迭代3次(若需更多,需进行架构评审)
  • 每次迭代仅聚焦于新发现/修复的问题
  • 所有迭代需记录在最终报告中

Phase 3: EXECUTE

阶段3:执行

The web is woven. The audit begins. The shell hardens...
Execute each animal's phase:
🕷️ SPIDER — WEAVE
"Spinning the authentication threads..."

Phase: SPIN
- Choose auth pattern (OAuth 2.0 + PKCE, JWT, Session)
- Set up infrastructure (client registration, secrets)

Phase: CONNECT
- Implement OAuth flow (login/callback)
- Session/token management
- User info fetching

Phase: SECURE
- Route protection middleware
- CSRF protection
- Rate limiting
- Security headers

Phase: TEST
- Auth flow end-to-end
- Error handling
- Edge cases

Phase: BIND
- Documentation
- Environment variables
- Monitoring

Output:
- Working authentication system
- Protected routes
- Session management
🦝 RACCOON — AUDIT
"Rummaging through every corner..."

Phase: RUMMAGE
- Search for secrets in code
- Check git history
- Scan dependencies for vulnerabilities

Phase: INSPECT
- Validate auth implementation
- Check input validation
- Review access controls
- Examine error messages

Phase: SANITIZE
- Remove any secrets found
- Rotate exposed credentials
- Patch vulnerabilities

Phase: PURGE
- Clean git history if needed
- Remove dead code
- Clear old tokens

Phase: VERIFY
- Re-scan for secrets
- Verify fixes
- Install pre-commit hooks

Output:
- Security audit report
- Issues fixed
- Preventive measures in place
🐢 TURTLE — HARDEN
"Withdrawing to study the terrain..."

Phase: WITHDRAW
- Survey the attack surface
- Map all entry/exit points
- Catalog data flows
- Identify tech-stack-specific risks

Phase: LAYER
- Input validation (Zod schemas, allowlists)
- Output encoding (context-aware)
- Parameterized queries (zero concatenation)
- Type safety (strict mode, no 'any')
- Error handling (generic messages, no leaks)

Phase: FORTIFY
- Security headers (CSP, HSTS, X-Frame-Options, etc.)
- CORS strict configuration
- Session/cookie hardening
- CSRF enforcement
- Rate limiting
- Multi-tenant isolation
- File upload security
- Data protection (encryption, least privilege)

Phase: SIEGE
- Test for exotic attacks:
  Prototype pollution, timing attacks, race conditions,
  ReDoS, SSRF bypasses, CRLF injection, Unicode attacks,
  deserialization, postMessage vulns, WebSocket hijacking,
  CSS injection, SVG XSS, cache poisoning, HTTP verb
  tampering, second-order vulnerabilities, supply chain

Phase: SEAL
- Defense-in-depth compliance (2+ layers per critical function)
- Logging & monitoring verification
- Final scan for remaining issues
- Generate hardening report

Output:
- Defense-in-depth verified
- Exotic attack vectors tested
- Complete hardening report

身份认证网络已编织完成。审计开始。防御开始加固...
执行每个角色的任务:
🕷️ 蜘蛛 —— 编织
"正在编织身份认证的丝线..."

阶段:纺线
- 选择身份认证模式(OAuth 2.0 + PKCE、JWT、会话)
- 搭建基础设施(客户端注册、密钥)

阶段:连接
- 实现OAuth流程(登录/回调)
- 会话/Token管理
- 用户信息获取

阶段:加固
- 路由保护中间件
- CSRF防护
- 速率限制
- 安全头配置

阶段:测试
- 端到端身份认证流程
- 错误处理
- 边缘场景

阶段:绑定
- 文档编写
- 环境变量配置
- 监控设置

输出:
- 可用的身份认证系统
- 受保护的路由
- 会话管理机制
🦝 浣熊 —— 审计
"正在翻遍每一个角落..."

阶段:排查
- 搜索代码中的密钥
- 检查git历史
- 扫描依赖包漏洞

阶段:检查
- 验证身份认证实现
- 检查输入验证
- 评审访问控制
- 检查错误消息

阶段:清理
- 移除所有发现的密钥
- 轮换泄露的凭据
- 修复漏洞

阶段:清除
- 若需清理git历史
- 移除无用代码
- 清除旧Token

阶段:验证
- 重新扫描密钥
- 验证修复效果
- 安装提交前钩子

输出:
- 安全审计报告
- 已修复的问题
- 已部署的预防措施
🐢 乌龟 —— 加固
"正在退隐研究地形..."

阶段:退隐
- 评估攻击面
- 映射所有入口/出口点
- 梳理数据流
- 识别技术栈特定风险

阶段:分层
- 输入验证(Zod schemas、允许列表)
- 输出编码(上下文感知)
- 参数化查询(无字符串拼接)
- 类型安全(严格模式,禁用'any')
- 错误处理(通用消息,无信息泄露)

阶段:强化
- 安全头(CSP、HSTS、X-Frame-Options等)
- 严格CORS配置
- 会话/ Cookie加固
- CSRF强制防护
- 速率限制
- 多租户隔离
- 文件上传安全
- 数据保护(加密、最小权限)

阶段:模拟攻击
- 测试特殊攻击向量:
  原型污染、时序攻击、竞态条件、
  ReDoS、SSRF绕过、CRLF注入、Unicode攻击、
  反序列化、postMessage漏洞、WebSocket劫持、
  CSS注入、SVG XSS、缓存投毒、HTTP方法篡改、
  二阶漏洞、供应链攻击

阶段:密封
- 验证纵深防御合规性(每个关键功能至少2层防御)
- 验证日志与监控
- 最终扫描剩余问题
- 生成加固报告

输出:
- 已验证的纵深防御
- 已测试的特殊攻击向量
- 完整的加固报告

Phase 4: VALIDATE

阶段4:验证

The web holds. The audit confirms. The shell endures...
Validation Checklist:
  • Spider: Auth flow works end-to-end
  • Spider: Routes properly protected
  • Spider: Sessions expire correctly
  • Spider: CSRF protection active
  • Raccoon: No secrets in codebase
  • Raccoon: Dependencies up to date
  • Raccoon: No sensitive data in logs
  • Raccoon: Pre-commit hooks installed
  • Turtle: Input validation on all entry points
  • Turtle: Output encoding on all exit points
  • Turtle: Security headers complete
  • Turtle: CSP enforced (nonce-based)
  • Turtle: CORS restricted to exact origins
  • Turtle: Defense-in-depth verified (2+ layers per critical function)
  • Turtle: Exotic attack vectors tested and clear
  • Turtle: Multi-tenant isolation verified (if applicable)
Security Test Cases:
Authentication:
[ ] Login redirects to provider
[ ] Callback exchanges code for tokens
[ ] Sessions created correctly
[ ] Logout clears sessions server-side
[ ] Expired tokens rejected
[ ] Session fixation prevented

Authorization:
[ ] Protected routes require auth
[ ] Admin routes check roles
[ ] API endpoints verify tokens
[ ] Users can't access others' data (IDOR tested)
[ ] Horizontal escalation prevented
[ ] Vertical escalation prevented

Hardening:
[ ] SQL injection prevented (parameterized queries)
[ ] XSS prevented (output encoding + CSP)
[ ] CSRF prevented (tokens + SameSite cookies)
[ ] File uploads sanitized (type + size + rename)
[ ] Rate limiting active on all sensitive endpoints
[ ] Prototype pollution vectors blocked
[ ] Timing attacks mitigated (constant-time comparison)
[ ] Race conditions prevented (atomic operations)
[ ] SSRF prevented (URL allowlist, no redirect following)

身份认证网络稳固。审计通过。防御加固完成...
验证清单:
  • 蜘蛛:身份认证流程端到端可用
  • 蜘蛛:路由已正确保护
  • 蜘蛛:会话可正确过期
  • 蜘蛛:CSRF防护已启用
  • 浣熊:代码库中无密钥
  • 浣熊:依赖包已更新
  • 浣熊:日志中无敏感数据
  • 浣熊:已安装提交前钩子
  • 乌龟:所有入口点已配置输入验证
  • 乌龟:所有出口点已配置输出编码
  • 乌龟:安全头配置完整
  • 乌龟:已启用CSP(基于nonce)
  • 乌龟:CORS已限制为精确来源
  • 乌龟:已验证纵深防御(每个关键功能至少2层)
  • 乌龟:已测试特殊攻击向量且无问题
  • 乌龟:已验证多租户隔离(如适用)
安全测试用例:
身份认证:
[ ] 登录重定向到提供商
[ ] 回调通过代码交换Token
[ ] 会话已正确创建
[ ] 登出可在服务器端清除会话
[ ] 过期Token已被拒绝
[ ] 会话固定攻击已被阻止

授权:
[ ] 受保护路由需要身份认证
[ ] 管理员路由检查角色权限
[ ] API端点验证Token
[ ] 用户无法访问他人数据(已测试IDOR)
[ ] 横向越权已被阻止
[ ] 纵向越权已被阻止

加固:
[ ] 已阻止SQL注入(参数化查询)
[ ] 已阻止XSS(输出编码 + CSP)
[ ] 已阻止CSRF(Token + SameSite cookies)
[ ] 文件上传已被清理(类型 + 大小 + 重命名)
[ ] 所有敏感端点已启用速率限制
[ ] 原型污染向量已被阻止
[ ] 时序攻击已被缓解(恒时比较)
[ ] 竞态条件已被阻止(原子操作)
[ ] SSRF已被阻止(URL允许列表,不跟随重定向)

Phase 5: COMPLETE

阶段5:完成

The gathering ends. The forest is fortified...
Completion Report:
markdown
undefined
集结结束。森林已被加固...
完成报告:
markdown
undefined

GATHERING SECURITY COMPLETE

安全集结完成

Security Work: [Description]

安全工作内容:[描述]

Animals Mobilized

动员的角色

🕷️ Spider → 🦝 Raccoon → 🐢 Turtle
🕷️ 蜘蛛 → 🦝 浣熊 → 🐢 乌龟

Authentication Implemented

已实现的身份认证

  • Provider: [OAuth 2.0 / GitHub / Google / etc.]
  • Flow: [PKCE / Authorization Code]
  • Session Type: [Token / Session Cookie]
  • Routes Protected: [count]
  • 提供商: [OAuth 2.0 / GitHub / Google / 等]
  • 流程: [PKCE / 授权码]
  • 会话类型: [Token / 会话Cookie]
  • 受保护路由数量: [数量]

Security Audit Results

安全审计结果

  • Secrets found: [count] (all rotated/removed)
  • Dependencies patched: [count]
  • Dead code removed: [lines]
  • Pre-commit hooks: Installed
  • 发现密钥数量:[数量](已全部轮换/移除)
  • 已修复依赖包漏洞:[数量]
  • 已移除无用代码:[行数]
  • 提交前钩子:已安装

Hardening Applied

已实施的加固措施

Defense LayerStatusDetails
Input Validation[PASS/FAIL]Zod schemas on all endpoints
Output Encoding[PASS/FAIL]Context-aware, DOMPurify for rich text
SQL Injection[PASS/FAIL]All queries parameterized
Security Headers[PASS/FAIL]CSP, HSTS, X-Frame, etc.
CORS[PASS/FAIL]Exact origin allowlist
Session Security[PASS/FAIL]HttpOnly, Secure, SameSite
CSRF Protection[PASS/FAIL]Tokens + SameSite
Rate Limiting[PASS/FAIL]Per-endpoint limits configured
Multi-Tenant[PASS/FAIL/N/A]Tenant scoping verified
File Uploads[PASS/FAIL/N/A]Type/size/rename enforced
防御层状态详情
输入验证[通过/失败]所有端点已配置Zod schemas
输出编码[通过/失败]上下文感知编码,富文本使用DOMPurify
SQL注入防护[通过/失败]所有查询均为参数化查询
安全头[通过/失败]已配置CSP、HSTS、X-Frame等
CORS[通过/失败]精确来源允许列表
会话安全[通过/失败]已配置HttpOnly、Secure、SameSite
CSRF防护[通过/失败]Token + SameSite防护
速率限制[通过/失败]已为每个端点配置限制
多租户隔离[通过/失败/不适用]已验证租户隔离
文件上传安全[通过/失败/不适用]已强制类型/大小/重命名

Exotic Attack Vectors Tested

已测试的特殊攻击向量

VectorStatus
Prototype Pollution[CLEAR/FOUND]
Timing Attacks[CLEAR/FOUND]
Race Conditions[CLEAR/FOUND]
ReDoS[CLEAR/FOUND]
SSRF[CLEAR/FOUND]
Unicode Attacks[CLEAR/FOUND]
Cache Poisoning[CLEAR/FOUND]
SVG XSS[CLEAR/FOUND]
攻击向量状态
原型污染[无风险/已发现]
时序攻击[无风险/已发现]
竞态条件[无风险/已发现]
ReDoS[无风险/已发现]
SSRF[无风险/已发现]
Unicode攻击[无风险/已发现]
缓存投毒[无风险/已发现]
SVG XSS[无风险/已发现]

Defense-in-Depth Compliance

纵深防御合规性

  • Layers verified: [X/5] (Network, Application, Data, Infrastructure, Process)
  • Critical functions with 2+ layers: [X/Y]
  • 已验证的防御层: [X/5](网络、应用、数据、基础设施、流程)
  • 具备2层以上防御的关键功能: [X/Y]

Vulnerabilities Found & Fixed

发现并修复的漏洞

SeverityCountStatus
CRITICAL[n]All fixed
HIGH[n]All fixed
MEDIUM[n][fixed/accepted]
LOW[n][fixed/deferred]
严重程度数量状态
关键[n]已全部修复
[n]已全部修复
[n][已修复/已接受]
[n][已修复/已推迟]

Files Created/Modified

创建/修改的文件

  • Auth routes: [files]
  • Middleware: [files]
  • Configuration: [files]
  • Security tests: [files]
Woven tight, audited clean, hardened deep — the forest endures. 🌲

---
  • 身份认证路由:[文件]
  • 中间件:[文件]
  • 配置文件:[文件]
  • 安全测试:[文件]
编织严密,审计干净,加固深入——森林将持续安全。 🌲

---

Example Gathering

集结示例

User: "/gathering-security Add GitHub OAuth, audit everything, and harden for production"
Gathering execution:
  1. 🌲 SUMMON — "Mobilizing full security gathering: GitHub OAuth + audit + hardening. All three animals needed."
  2. 🌲 ORGANIZE — "Spider implements auth → Raccoon audits for secrets/vulns → Turtle hardens everything"
  3. 🌲 EXECUTE
    • 🕷️ Spider: "OAuth client registered, PKCE flow implemented, sessions working, routes protected"
    • 🦝 Raccoon: "No secrets found, 2 dependency vulns patched, dead debug endpoint removed"
    • 🐢 Turtle: "CSP configured with nonces, CORS locked to exact origins, all inputs validated with Zod, constant-time token comparison added, prototype pollution vector in config merge fixed, defense-in-depth verified at 3 layers per critical function"
  4. 🌲 VALIDATE — "Auth works, audit clean, hardening verified, all exotic vectors tested clear"
  5. 🌲 COMPLETE — "GitHub OAuth live, secrets clean, shell hardened. The forest endures."

用户: "/gathering-security 添加GitHub OAuth,全面审计,并为生产环境加固"
集结执行流程:
  1. 🌲 召唤 —— "正在动员完整安全集结:GitHub OAuth集成 + 全面审计 + 生产环境加固。将启用全部三个角色。"
  2. 🌲 组织 —— "蜘蛛实现身份认证 → 浣熊进行密钥/漏洞审计 → 乌龟实施全面加固"
  3. 🌲 执行
    • 🕷️ 蜘蛛:"已完成OAuth客户端注册、PKCE流程实现、会话功能、路由保护"
    • 🦝 浣熊:"未发现密钥,已修复2个依赖包漏洞,已移除无用的调试端点"
    • 🐢 乌龟:"已配置带nonce的CSP,已锁定CORS为精确来源,所有输入已通过Zod验证,已添加Token恒时比较,已修复配置合并中的原型污染向量,已验证每个关键功能具备3层纵深防御"
  4. 🌲 验证 —— "身份认证可用,审计无问题,加固已验证,所有特殊攻击向量测试无风险"
  5. 🌲 完成 —— "GitHub OAuth已上线,密钥无泄露,防御已加固。森林持续安全。"

Quick Decision Guide

快速决策指南

SituationAnimals to Mobilize
New auth + full securitySpider → Raccoon → Turtle
Auth exists, need deep hardeningRaccoon → Turtle
New feature, secure by designTurtle (optionally + Raccoon)
Incident responseRaccoon → Spider → Turtle
Pre-production deployRaccoon → Turtle
Auth-only workSpider → Raccoon (no Turtle needed)

Woven tight, audited clean, hardened deep — the forest endures. 🌲
场景需动员的角色
新身份认证+全面安全保障蜘蛛 → 浣熊 → 乌龟
已有身份认证,需深度加固浣熊 → 乌龟
开发新功能,设计阶段保障安全乌龟(可选+浣熊)
安全事件响应浣熊 → 蜘蛛 → 乌龟
生产部署前置检查浣熊 → 乌龟
仅身份认证相关工作蜘蛛 → 浣熊(无需乌龟)

编织严密,审计干净,加固深入——森林将持续安全。 🌲