Loading...
Loading...
The drum sounds. Spider, Raccoon, and Turtle gather for complete security work. Use when implementing auth, auditing security, or hardening code end-to-end.
npx skill4agent add autumnsgrove/groveengine gathering-securitygwgf# Find security-relevant code patterns
gf --agent search "sanitize|escape|validate" # Security patterns
gf --agent auth # Find auth code and middleware
# Verify security changes don't break anything
gw ci --affected --diagnose # Run CI on affected packagesSUMMON --> ORGANIZE --> EXECUTE --> VALIDATE --> COMPLETE
| | | | |
Receive Dispatch Animals Verify Security
Request Animals Work Check HardenedAPI_ERRORSAUTH_ERRORSuserMessageadminMessagelogGroveError()console.error"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?"
| Situation | Animals Needed |
|---|---|
| New auth system + full security | All three: Spider → Raccoon → Turtle |
| Auth already exists, need hardening | Raccoon → Turtle |
| New feature, ensure secure by design | Turtle only (or Turtle → Raccoon) |
| Secrets leak / incident response | Raccoon → Spider (rotate creds) → Turtle (verify) |
| Pre-production deploy | Raccoon → Turtle |
Spider ──→ Raccoon ──→ Turtle
│ │ │
│ │ │
Weave Audit Harden
Auth Secrets Defenses┌──────────────────────────────────────────────────────────────────┐
│ SECURITY ITERATION │
├──────────────────────────────────────────────────────────────────┤
│ │
│ 🕷️ Spider ──► 🦝 Raccoon ──► 🐢 Turtle │
│ weaves auth audits hardens & tests │
│ ▲ │ │
│ │ ▼ │
│ │ Deep vulnerabilities? │
│ │ / \ │
│ │ Yes No │
│ │ │ │ │
│ │ ┌────────────┘ ▼ │
│ │ ▼ ✅ Hardened │
│ │ Auth issue? │
│ │ / \ │
│ │ Yes No │
│ │ │ │ │
│ └───┘ Raccoon/Turtle │
│ fixes directly │
└──────────────────────────────────────────────────────────────────┘"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"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"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 reportAuthentication:
[ ] 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)## 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]
### Security Audit Results
- Secrets found: [count] (all rotated/removed)
- Dependencies patched: [count]
- Dead code removed: [lines]
- Pre-commit hooks: Installed
### Hardening Applied
| Defense Layer | Status | Details |
| ---------------- | --------------- | -------------------------------------- |
| 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 |
### Exotic Attack Vectors Tested
| Vector | Status |
| ------------------- | ------------- |
| 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] |
### Defense-in-Depth Compliance
- **Layers verified:** [X/5] (Network, Application, Data, Infrastructure, Process)
- **Critical functions with 2+ layers:** [X/Y]
### Vulnerabilities Found & Fixed
| Severity | Count | Status |
| -------- | ----- | ---------------- |
| CRITICAL | [n] | All fixed |
| HIGH | [n] | All fixed |
| MEDIUM | [n] | [fixed/accepted] |
| LOW | [n] | [fixed/deferred] |
### Files Created/Modified
- Auth routes: [files]
- Middleware: [files]
- Configuration: [files]
- Security tests: [files]
_Woven tight, audited clean, hardened deep — the forest endures._ 🌲| Situation | Animals to Mobilize |
|---|---|
| New auth + full security | Spider → Raccoon → Turtle |
| Auth exists, need deep hardening | Raccoon → Turtle |
| New feature, secure by design | Turtle (optionally + Raccoon) |
| Incident response | Raccoon → Spider → Turtle |
| Pre-production deploy | Raccoon → Turtle |
| Auth-only work | Spider → Raccoon (no Turtle needed) |