Skip to content

feat: add bootcamp security command for standalone security analysis#60

Merged
Arthur742Ramos merged 1 commit into
mainfrom
arthur742ramos/security-command
Jun 11, 2026
Merged

feat: add bootcamp security command for standalone security analysis#60
Arthur742Ramos merged 1 commit into
mainfrom
arthur742ramos/security-command

Conversation

@Arthur742Ramos

Copy link
Copy Markdown
Owner

Summary

Adds bootcamp security <repo-url> — the third deterministic, LLM-free report command, completing the health / metrics / security trio.

bootcamp health and bootcamp metrics already expose their generation engines as standalone, scannable, CI-gateable commands. The SECURITY.md engine (analyzeSecurityPatterns) had no standalone equivalent — this closes that gap.

What it reports

Scans any repo (local path or remote URL) and reports the deterministic security analysis that powers SECURITY.md:

  • Findings — title, severity (critical→info), file/line, and remediation, sorted most-severe-first
  • Protection coverage — security headers (helmet), CORS, CSP, rate limiting, input validation, SQL-injection prevention, secret handling (gitignored, .env.example)
  • Security-relevant dependencies
  • 0–100 score + A–F grade
$ bootcamp security ./my-repo
🔒 Security Analysis
Repository: local/my-repo
Scanned 224 files

🟢 100/100 (Grade: A)
Findings: ⚪ 6 info

Protections
  ✓ security headers (helmet)   · CORS   ✓ CSP
  ✓ rate limiting   ✓ input validation   · SQL-injection prevention
  ...

Flags

Mirror health/metrics: --json, --check / --min-score (CI gate), --branch, --max-files (routed past root-command flag collisions), --keep-temp, --verbose.

Implementation

Mirrors health-command.ts / metrics-command.ts in structure and reuses analyzeSecurityPatterns verbatim (reading package.json the same way the generation pipeline does), so the output can never drift from SECURITY.md.

Testing

  • 9 unit tests (DI-mocked resolve/scan/analyze): report, --json, --check both directions, custom --max-files, local path, --keep-temp, scan-failure cleanup, resolve-failure.
  • 3 E2E tests spawning the real CLI against a fixture with detectable patterns (helmet + rate-limit deps, .env gitignored): human report, JSON shape, and the --check gate in both directions.
  • Full suite green: npm test → 1124 passing; typecheck + lint + build clean.

🤖 Generated with Claude Code

Completes the deterministic, LLM-free report trio. `bootcamp health` and
`bootcamp metrics` already expose their generation engines as standalone
commands; this adds the third — `bootcamp security` — over the
`analyzeSecurityPatterns` engine that powers SECURITY.md.

`bootcamp security <repo-url>` (local path or remote URL) scans the repo and
reports:
- findings (severity, file/line, remediation), most-severe-first
- protection coverage matrix (helmet/CORS/CSP, rate limiting, input
  validation, SQL-injection prevention, secret handling)
- security-relevant dependencies
- a 0-100 score + A-F grade

Flags mirror health/metrics: --json, --check/--min-score (CI gate),
--branch, --max-files (routed past root-flag collisions), --keep-temp,
--verbose.

Tests: 9 unit (DI-mocked resolve/scan/analyze; report/JSON/check both
directions/local/keep-temp/scan-failure/resolve-failure) and 3 E2E spawning
the real CLI against a fixture with detectable patterns (human report, JSON
shape incl. helmet/rate-limit detection, --check gate both directions).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@Arthur742Ramos Arthur742Ramos force-pushed the arthur742ramos/security-command branch from e0ae5e5 to 743cc58 Compare June 11, 2026 20:02
@Arthur742Ramos Arthur742Ramos merged commit 6af17e3 into main Jun 11, 2026
13 checks passed
@Arthur742Ramos Arthur742Ramos deleted the arthur742ramos/security-command branch June 11, 2026 20:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants