Loading...
Loading...
Rummage through code with curious precision, inspecting every corner for security risks and cleaning up what doesn't belong. Use when auditing security, finding secrets, removing dead code, or sanitizing before deployment.
npx skill4agent add autumnsgrove/groveengine raccoon-audit/raccoon-auditspider-weavebeaver-buildRUMMAGE → INSPECT → SANITIZE → PURGE → VERIFY
↓ ↓ ↓ ↓ ↓
Search Examine Cleanse Remove Confirm
Everything Closely Contaminated Dead Clean# Search for common secret patterns
grep -r "api_key\|apikey\|api-key" . --include="*.{js,ts,py,json,yaml,yml,env,md}" 2>/dev/null | head -20
grep -r "password\|passwd\|pwd" . --include="*.{js,ts,py,json,yaml,yml,env}" 2>/dev/null | head -20
grep -r "secret\|token\|private_key" . --include="*.{js,ts,py,json,yaml,yml,env}" 2>/dev/null | head -20
grep -r "AKIA[0-9A-Z]{16}" . 2>/dev/null # AWS access keys
grep -r "ghp_[a-zA-Z0-9]{36}" . 2>/dev/null # GitHub personal tokens.env.gitignoreconfig.jsongit log -p# Find bare throw error() without throwGroveError
grep -r "throw error(" --include="*.ts" --include="*.js" | grep -v "throwGroveError\|node_modules\|\.test\."
# Find ad-hoc JSON error responses without buildErrorJson
grep -r "json.*error.*status" --include="*.ts" | grep -v "buildErrorJson\|node_modules"
# Find console.error without logGroveError
grep -r "console\.error" --include="*.ts" --include="*.svelte" | grep -v "logGroveError\|node_modules"
# Find bare alert() where toast should be used
grep -r "alert(" --include="*.svelte" --include="*.ts" | grep -v "node_modules"throw error()throwGroveError()buildErrorJson()console.errorlogGroveError()buildErrorJson()alert()toast@autumnsgrove/groveengine/uiadminMessage# Check for known vulnerabilities
npm audit
pip audit # if using Python┌──────────────────────────────────────────────────────────────┐
│ RISK EVALUATION MATRIX │
├──────────────────────────────────────────────────────────────┤
│ CRITICAL │ Active secrets in public repos │
│ │ SQL injection vulnerabilities │
│ │ Remote code execution paths │
├────────────┼────────────────────────────────────────────────┤
│ HIGH │ Dependencies with known CVEs │
│ │ Weak cryptography (MD5, SHA1) │
│ │ Missing authentication on admin endpoints │
├────────────┼────────────────────────────────────────────────┤
│ MEDIUM │ Information disclosure in error messages │
│ │ Missing rate limiting │
│ │ Verbose logging of sensitive data │
├────────────┼────────────────────────────────────────────────┤
│ LOW │ Outdated dependencies (no known CVEs) │
│ │ Unused code/dependencies │
│ │ Comments containing internal details │
└────────────┴────────────────────────────────────────────────┘# 1. Revoke the exposed secret immediately
curl -X DELETE https://api.service.com/keys/EXPOSED_KEY_ID \
-H "Authorization: Bearer ADMIN_TOKEN"
# 2. Generate new secret
NEW_KEY=$(curl -X POST https://api.service.com/keys \
-H "Authorization: Bearer ADMIN_TOKEN" | jq -r '.key')
# 3. Update configuration (environment variables, not code!)
echo "SERVICE_API_KEY=$NEW_KEY" >> .env.local// BEFORE: Secret in code
const API_KEY = 'sk-live-abc123xyz789';
// AFTER: Environment variable
const API_KEY = process.env.SERVICE_API_KEY;
if (!API_KEY) {
throw new Error('SERVICE_API_KEY environment variable required');
}// Add input validation
function sanitizeInput(input: string): string {
return input.replace(/[<>\"']/g, '');
}
// Add rate limiting
const rateLimiter = new Map<string, number[]>();
// Remove debug endpoints
// DELETE: app.get('/debug/users', ...)# Update vulnerable packages
npm update package-name
# or
pip install --upgrade package-name
# Verify fix
npm audit # Should show 0 vulnerabilities# Use BFG Repo-Cleaner or git-filter-branch
# WARNING: This rewrites history - coordinate with team!
# BFG approach (recommended):
bfg --delete-files '.*env' --replace-text secrets.txt my-repo.git
# Or specific file cleanup:
git filter-branch --force --index-filter \
'git rm --cached --ignore-unmatch path/to/secret-file' \
--prune-empty --tag-name-filter cat -- --all# Find unused exports
npx ts-prune # TypeScript
# Find unused dependencies
npx depcheck
# Remove with confidence after tests pass
git rm src/old-feature/
npm uninstall unused-package# Re-run secret scan - should find nothing
grep -r "sk-live\|sk-test" . --include="*.{js,ts,json}" 2>/dev/null
# Security tests pass
npm run test:security
# No new vulnerabilities
npm audit --audit-level=moderate# Install pre-commit hooks
npm install --save-dev husky
npx husky add .husky/pre-commit "npm run lint && npm run security-check"
# Add to CI/CD pipeline
# .github/workflows/security.yml
- name: Security Scan
run: |
npm audit --audit-level=moderate
npx secretlint "**/*"## 🦝 RACCOON AUDIT COMPLETE
### Secrets Found & Fixed
| Location | Severity | Action Taken |
|----------|----------|--------------|
| config.ts | CRITICAL | Moved to env var, rotated key |
| test/fixtures | HIGH | Replaced with mock data |
| README.md | MEDIUM | Removed internal URL |
### Dependencies
- 3 vulnerabilities patched
- 2 unused packages removed
- All packages up to date
### Verification
- [x] No secrets in current codebase
- [x] Git history cleaned (force push required)
- [x] Pre-commit hooks installed
- [x] All tests passing| Situation | Action |
|---|---|
| Secret committed to git | Rotate immediately, clean history, force push |
| Vulnerability in dependency | Update to patched version, test, deploy |
| Hardcoded credentials | Move to environment variables, rotate keys |
| Dead code detected | Remove if tests pass, document if uncertain |
| Debug code in production | Remove endpoints, check logs for exposure |
| Preparing for open source | Full audit: secrets, internals, history, docs |
bloodhound-scoutspider-weavebeaver-buildpanther-strikegrove-documentation