|
| 1 | +# VibeSafe MVP Development Plan |
| 2 | + |
| 3 | +## 1. Overview |
| 4 | + |
| 5 | +**Problem:** Developers ship code quickly but often miss basic security checks (secrets, stale deps, known CVEs). |
| 6 | +**Solution:** A zero‑config CLI that scans a repo for secrets, outdated packages, and CVEs, then generates an AI‑powered risk report. |
| 7 | +**MVP Goal:** Enable any developer to run `vibesafe scan` and get a readable security summary—including file paths and line numbers—in under 60 s. |
| 8 | + |
| 9 | +## 2. Personas & Use Cases |
| 10 | + |
| 11 | +| Persona | Scenario | Outcome | |
| 12 | +| ------------------ | ------------------------------------------------------------------- | ----------------------------------------- | |
| 13 | +| Solo "vibe" coder | Quickly wants to check a side‑project for exposed keys before release | Markdown/JSON report with file, location, and severity‑scored findings | |
| 14 | +| CI/CD integrator | Needs build to fail if any HIGH vulnerabilities are present | CI job exits non-zero on HIGH issues | |
| 15 | +| Security advocate | Reviews multiple repos for baseline security hygiene | Exports JSON for bulk analysis | |
| 16 | + |
| 17 | +## 3. Scope & Non‑Goals |
| 18 | + |
| 19 | +**In‑Scope (MVP):** |
| 20 | +- Secrets & plaintext key detection with file & line |
| 21 | +- Dependency parsing + CVE lookup |
| 22 | +- AI‑driven markdown risk report with fix suggestions |
| 23 | +- CLI UX: colorized terminal + `--output` flags |
| 24 | + |
| 25 | +**Out‑of‑Scope (v0.1+):** |
| 26 | +- Automatic patching (`--fix`) |
| 27 | +- Remote‑repo scanning |
| 28 | +- Real‑time IDE plugins |
| 29 | +- Telemetry collection (opt‑in only) |
| 30 | +- TODO: Proactively check `.gitignore` for `.env` exclusion patterns |
| 31 | + |
| 32 | +## 4. Success Metrics |
| 33 | + |
| 34 | +1. **Performance:** Full scan < 60 s on a 100 MB repo |
| 35 | +2. **Coverage:** Detects ≥ 5 unique issues in standard test repos |
| 36 | +3. **Adoption:** ≥ 10 installs in first week (npm/pip downloads) |
| 37 | +4. **Reliability:** CI exit code behavior consistent (HIGH → non-zero) |
| 38 | + |
| 39 | +## 5. Phases & Atomic Tasks |
| 40 | + |
| 41 | +### Phase 1: Setup & CI Integration |
| 42 | +1. **Repo scaffold** |
| 43 | + - [x] `mkdir vibesafe && cd vibesafe` |
| 44 | + - [x] Initialize Git + add `.gitignore`, `LICENSE`, `README.md` |
| 45 | + - [x] Choose language: TypeScript (commander.js) ~~_or_ Python (argparse)~~ |
| 46 | + - [x] Add basic `vibesafe scan` command stub |
| 47 | +2. **CI hook** |
| 48 | + - [x] Write a GitHub Actions workflow that runs `vibesafe scan --high-only` |
| 49 | + - [x] Ensure exit code propagates |
| 50 | + |
| 51 | +### Phase 2: Secrets Scanner |
| 52 | +1. **Regex & entropy engine** |
| 53 | + - [x] Define regex patterns for `.env`, AWS, JWT, SSH keys |
| 54 | + - [x] Integrate an entropy checker (e.g., Shannon entropy > threshold) |
| 55 | +2. **File traversal** |
| 56 | + - [x] Walk directory tree, skip default excludes (`node_modules`, `dist`) |
| 57 | + - [x] Honor `.vibesafeignore` entries |
| 58 | +3. **Scoring & output** |
| 59 | + - [x] Assign Low/Med/High severity based on pattern + entropy |
| 60 | + - [x] Emit JSON record per finding including `file`, `line`, `pattern`, and `severity` |
| 61 | + |
| 62 | +### Phase 3: Dependency & CVE Scanner |
| 63 | +1. **Detect package manager** |
| 64 | + - [x] Inspect files: `package.json`, `yarn.lock`, `requirements.txt` |
| 65 | +2. **Parse deps** |
| 66 | + - [x] Extract name + version pairs |
| 67 | +3. **CVE lookup** |
| 68 | + - [x] Call OSV.dev or NVD API with each dep |
| 69 | + - [x] Capture CVE IDs, severity, published date |
| 70 | +4. **Threshold filtering** |
| 71 | + - [x] Mark HIGH if any dep ≥ 7.0 severity |
| 72 | + |
| 73 | +### Phase 4: AI Risk Report |
| 74 | +1. **Markdown skeleton** |
| 75 | + - [x] Build template: |
| 76 | + ```md |
| 77 | + # VibeSafe Report |
| 78 | + |
| 79 | + ## Summary |
| 80 | + - Total Issues: 5 (2 High, 2 Medium, 1 Low) |
| 81 | + |
| 82 | + ## Details |
| 83 | + | File | Location | Issue | Severity | CVE/Pattern | |
| 84 | + | ------------------ | ---------- | ---------------- | -------- | ------------- | |
| 85 | + | `.env` | line 10 | AWS Key exposed | High | — | |
| 86 | + | `config/app.js` | line 45 | JWT secret | Medium | — | |
| 87 | + | `package.json` | line 23 | lodash 4.17 | Medium | CVE-2024-123 | |
| 88 | + | `requirements.txt` | line 12 | Django 2.2 | High | CVE-2023-456 | |
| 89 | + | `src/utils.ts` | line 80 | Hardcoded token | Low | — | |
| 90 | + |
| 91 | + ## Fix Suggestions |
| 92 | + 1. Remove AWS keys from code; use environment variables and a secrets vault. |
| 93 | + 2. Rotate JWT secret and move to env vars. |
| 94 | + 3. Upgrade `lodash` to ≥ 4.17.21. |
| 95 | + 4. Update Django to ≥ 3.2. |
| 96 | + 5. Replace hardcoded tokens with secure storage. |
| 97 | + ``` |
| 98 | +2. **LLM integration** |
| 99 | + - [x] Send JSON findings + skeleton to GPT‑4o-mini |
| 100 | + - [x] Parse human‑readable summary & per‑issue suggestions |
| 101 | + - [x] Merge into final MD |
| 102 | + |
| 103 | +### Phase 5: CLI UX & Packaging |
| 104 | +1. **Terminal polish** |
| 105 | + - [ ] Colorize severities (e.g., red for High) |
| 106 | + - [ ] Add progress spinner during scans |
| 107 | +2. **Flags & outputs** |
| 108 | + - [ ] `--output <file.md|.json>` |
| 109 | + - [ ] `--high-only` filter |
| 110 | +3. **Distribution** |
| 111 | + - [ ] Set up npm `bin` or Python `entry_point` |
| 112 | + - [ ] Test on macOS, Win, Linux |
| 113 | + |
| 114 | +## 6. Timeline & Ownership |
| 115 | + |
| 116 | +| Week | Focus | Owner | |
| 117 | +| ------ | ------------------------------ | ------------ | |
| 118 | +| Week 1 | Phase 1 scaffold + CI | @you | |
| 119 | +| Week 2 | Phase 2 secrets scanner | @security | |
| 120 | +| Week 3 | Phase 3 dep & CVE scanner | @sec‑lead | |
| 121 | +| Week 4 | Phase 4 AI report & polish | @AI‑engineer | |
| 122 | +| Week 5 | Phase 5 packaging & QA | @release | |
| 123 | + |
| 124 | +## 7. Risks & Mitigations |
| 125 | + |
| 126 | +- **API rate limits (OSV/NVD):** cache results locally; implement exponential back‑off |
| 127 | +- **False positives (secrets):** tune regex & entropy thresholds; allow exclusions |
| 128 | +- **LLM costs:** only call on `--report` mode; support a dry‑run without AI |
| 129 | + |
| 130 | +## 8. In Cursor |
| 131 | + |
| 132 | +- **Check progress:** |
| 133 | + > “What is the current status of Phase 2: Secrets Scanner?” |
| 134 | +- **Mark tasks done:** |
| 135 | + > “Mark Phase 3.3 (CVE lookup) as complete.” |
| 136 | + |
| 137 | +--- |
| 138 | + |
| 139 | +**Next Steps:** |
| 140 | +1. Review personas & success metrics. |
| 141 | +2. Assign owners & adjust timeline as needed. |
| 142 | +3. Kick off Week 1! |
0 commit comments