| name | boo-security |
| description | Deep security workflow for Ruby on Rails applications. Use when auditing or implementing controls for XSS, SQL injection, CSRF, file uploads, command injection, session/cookie hardening, and security monitoring. Triggers on appsec audit, security review, OWASP, CSP, CSRF, upload hardening, or secure coding requests. |
Rails Security
Overview
Use this skill for focused application security work in Rails. It complements broad safety and quality checks with deeper, security-specific analysis and remediations.
Execution Default (Required)
When shell execution is available and the user does not request inspect-only output, run:
bash ${CLAUDE_PLUGIN_ROOT}/skills/boo-security/scripts/run_security_audit.sh --project-dir "$PWD" --mode strict
- Add
--require-lsp when symbol-level confidence is required.
- For non-mutating audits, pair with
boo-framework in inspect/advisory mode.
Do not claim completion without reporting the generated summary path: tmp/rails-security-*/00-summary.md.
LSP Recommendation
Strongly recommend enabling LSP before running this skill:
ENABLE_LSP_TOOL=1 in the shell running Claude/Codex.
- Run from the Rails app root directory.
- Ensure a Ruby LSP backend is available in the app bundle (
ruby-lsp and/or solargraph).
If LSP is disabled, continue but mark reduced confidence for cross-file security findings.
Threat Scope
Prioritize these rails-relevant vectors:
- XSS in views/components/helpers.
- SQL injection in dynamic query composition.
- CSRF gaps in cookie/session-authenticated flows.
- File upload abuse (type spoofing, dangerous inline formats, oversized uploads).
- Command injection and path traversal.
- Weak session/cookie and header hardening.
Non-Negotiables
- Never allow SQL interpolation with user input.
- Never allow command execution with interpolated user input.
- Never skip CSRF checks for session-authenticated controllers.
- Never trust upload filename/content-type alone.
- Never mark security checks as pass without evidence.
Workflow
- Inspect: map auth model, input surfaces, upload paths, command execution points.
- Diagnose: run scripted audit and targeted grep-based checks.
- Design: choose primary fix and one alternative with tradeoffs.
- Implement: apply minimal, reversible hardening changes.
- Verify: run security checks/tests and explain residual risk.
- Improve: capture reusable guardrails/tests for recurrence prevention.
Scripted Execution
Use the bundled security runner:
scripts/run_security_audit.sh
scripts/run_security_audit.sh --project-dir /path/to/rails-app
scripts/run_security_audit.sh --mode advisory --output-file tmp/security-report.md
scripts/run_security_audit.sh --skip-brakeman (if Brakeman not available)
scripts/run_security_audit.sh --require-lsp (hard fail if ENABLE_LSP_TOOL!=1)
Default behavior:
- Runs Brakeman when available and summarizes confidence counts.
- Scans for critical rails security anti-patterns.
- Produces
PASS, WARN, or FAIL with blocker/warn split.
- Persists logs in
tmp/rails-security-<timestamp>/.
In strict mode, blockers return exit code 1.
Output Contract
- Surface map: where risky input enters and is rendered/executed.
- Blockers: must-fix items with file-level evidence.
- Warnings: important but non-blocking hardening gaps.
- Primary remediation plan + one alternative.
- Validation evidence (commands run and outputs).
- Residual risk and rollback notes.
- Change log summary (if implementation happened).
Final Summary (Required)
Always end with:
- Security outcome: pass, warn, or fail.
- Blockers that prevent merge/release.
- Key warnings and mitigations.
- Evidence used (reports/tests/logs).
- Single highest-priority next action.
References
Load these files only when needed:
- references/xss.md
- references/sql-injection.md
- references/csrf.md
- references/uploads.md
- references/command-injection.md
- references/checklist.md
- references/external-resources.md