codeprobe-scanner 1.0.4 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/bin/codeprobe.cjs +1 -1
  2. package/package.json +1 -1
  3. package/src/integrations/videodb.ts +9 -8
  4. package/.claude/settings.local.json +0 -19
  5. package/.dockerignore +0 -17
  6. package/.env.development +0 -8
  7. package/.env.setup +0 -214
  8. package/.github/workflows/codeprobe-scan.yml +0 -137
  9. package/.github/workflows/codeprobe.yml +0 -84
  10. package/.github/workflows/scan-schedule.yml +0 -28
  11. package/ANALYSIS_SUMMARY.md +0 -365
  12. package/API_INTEGRATIONS.md +0 -469
  13. package/BUILD_PLAYBOOK.md +0 -349
  14. package/CLAUDE.md +0 -106
  15. package/DEPLOY.md +0 -452
  16. package/DEPLOYMENT_STATUS.md +0 -240
  17. package/DEPLOY_CHECKLIST.md +0 -316
  18. package/Dockerfile +0 -24
  19. package/EXECUTION_PLAN.html +0 -1086
  20. package/IMPLEMENTATION_COMPLETE.md +0 -288
  21. package/IMPLEMENTATION_SUMMARY.md +0 -443
  22. package/INTERACTIVE_FIX_FLOW.md +0 -308
  23. package/MIGRATION_COMPLETE.md +0 -327
  24. package/ORCHESTRATOR_SYNTHESIS.json +0 -80
  25. package/PENDING_WORK.md +0 -308
  26. package/PREFLIGHT_PLAN.md +0 -182
  27. package/QUICKSTART.md +0 -305
  28. package/STAGE_1_SETUP_ENGINE.md +0 -245
  29. package/STAGE_2_ARCHITECTURE.md +0 -714
  30. package/STAGE_2_CLI_VERIFICATION.md +0 -269
  31. package/STAGE_2_COMPLETE.md +0 -332
  32. package/STAGE_2_IMPLEMENTATION_PLAN.md +0 -679
  33. package/STAGE_3_COMPLETE.md +0 -246
  34. package/STAGE_3_DASHBOARD_POLISH.md +0 -371
  35. package/STAGE_3_SETUP.md +0 -155
  36. package/VIDEODB_INTEGRATION.md +0 -237
  37. package/archived/DASHBOARD_UI_WALKTHROUGH.md +0 -392
  38. package/archived/FRONTEND_SETUP.md +0 -236
  39. package/archived/auth.ts +0 -40
  40. package/archived/dashboard/components/BusinessImpactCard.tsx +0 -48
  41. package/archived/dashboard/components/CVETable.tsx +0 -104
  42. package/archived/dashboard/components/ErrorBoundary.tsx +0 -48
  43. package/archived/dashboard/components/PatchDiffViewer.tsx +0 -43
  44. package/archived/dashboard/components/RiskGauge.tsx +0 -64
  45. package/archived/dashboard/frontend.tsx +0 -104
  46. package/archived/dashboard/hooks/useAuth.ts +0 -32
  47. package/archived/dashboard/hooks/useScan.ts +0 -65
  48. package/archived/dashboard/index.html +0 -15
  49. package/archived/dashboard/pages/LoginPage.tsx +0 -28
  50. package/archived/dashboard/pages/ScanDetailPage.tsx +0 -143
  51. package/archived/dashboard/pages/ScansListPage.tsx +0 -160
  52. package/bun.lock +0 -603
  53. package/codeprobe-prd.md +0 -674
  54. package/cve-cache.json +0 -25
  55. package/demo-vulnerable-app/.github/workflows/codeprobe.yml +0 -32
  56. package/demo-vulnerable-app/README.md +0 -70
  57. package/demo-vulnerable-app/package-lock.json +0 -27
  58. package/demo-vulnerable-app/package.json +0 -15
  59. package/demo-vulnerable-app/server.js +0 -34
  60. package/demo.sh +0 -45
  61. package/index.ts +0 -19
  62. package/patches.json +0 -12
  63. package/serve-dashboard.ts +0 -23
  64. package/src/cli/index.ts +0 -137
  65. package/src/engine/index.ts +0 -90
  66. package/src/test/cli.test.ts +0 -211
  67. package/src/test/dashboard.test.ts +0 -38
  68. package/src/test/demo-scan.json +0 -32
  69. package/src/test/engine.test.ts +0 -157
  70. package/tailwind.config.js +0 -11
  71. package/tsconfig.json +0 -30
  72. package/verify-dashboard.ts +0 -87
  73. package/verify-env.sh +0 -98
package/STAGE_3_SETUP.md DELETED
@@ -1,155 +0,0 @@
1
- # Stage 3: Dashboard + Auth + Polish — SETUP COMPLETE
2
-
3
- ✅ **All files created & dependencies installed**
4
-
5
- ## Quick Start
6
-
7
- ### 1. Set GitHub OAuth credentials (REQUIRED)
8
- ```bash
9
- export GITHUB_CLIENT_ID="your_client_id"
10
- export GITHUB_CLIENT_SECRET="your_client_secret"
11
- ```
12
-
13
- Get these from: https://github.com/settings/developers
14
- - Create new OAuth app
15
- - Authorization callback: `http://localhost:3000/api/auth/github`
16
-
17
- ### 2. Start API server (port 3000)
18
- ```bash
19
- bun run dev
20
- ```
21
-
22
- ### 3. Open dashboard
23
- ```
24
- http://localhost:5173
25
- ```
26
-
27
- OR for dev build:
28
- ```bash
29
- bun build src/dashboard/frontend.tsx --outdir dist
30
- ```
31
-
32
- ## Project Structure
33
-
34
- ```
35
- src/
36
- ├── api/
37
- │ ├── server.ts → Bun REST API server
38
- │ └── auth.ts → GitHub OAuth flow
39
- ├── dashboard/
40
- │ ├── frontend.tsx → Main React app
41
- │ ├── index.html → HTML entry
42
- │ ├── hooks/
43
- │ │ ├── useAuth.ts → Auth hook (login/logout)
44
- │ │ └── useScan.ts → Scan fetch hooks
45
- │ ├── pages/
46
- │ │ ├── LoginPage.tsx
47
- │ │ ├── ScansListPage.tsx
48
- │ │ └── ScanDetailPage.tsx
49
- │ └── components/
50
- │ ├── BusinessImpactCard.tsx → Critical: Red box showing $4.9M risk
51
- │ ├── RiskGauge.tsx → Visual 0-10 score
52
- │ ├── CVETable.tsx → Expandable CVE list
53
- │ ├── PatchDiffViewer.tsx → Syntax-highlighted patches
54
- │ └── ErrorBoundary.tsx → Error handling
55
- └── test/
56
- ├── dashboard.test.ts
57
- └── demo-scan.json → Test data
58
- ```
59
-
60
- ## API Routes
61
-
62
- | Method | Route | Auth | Purpose |
63
- |--------|-------|------|---------|
64
- | POST | `/api/auth/github?code=...` | No | GitHub OAuth callback |
65
- | GET | `/api/auth/logout` | Bearer | Clear session |
66
- | GET | `/api/scans` | Bearer | List all scans |
67
- | GET | `/api/scans/{id}` | Bearer | Get scan details |
68
-
69
- ## Demo Scan
70
-
71
- Pre-loaded at `~/.codeprobe/scans/scan-demo-001.json`:
72
- - CVE-2023-44487 (CRITICAL RCE)
73
- - CVE-2023-12345 (HIGH, theoretical)
74
- - Risk score: 8.5/10
75
- - Shows patch diffs + business impact
76
-
77
- ## Components Checklist
78
-
79
- - ✅ LoginPage: GitHub OAuth button
80
- - ✅ ScansListPage: Table, pagination, filtering by risk
81
- - ✅ ScanDetailPage: Risk gauge, CVE table, business impact
82
- - ✅ BusinessImpactCard: RED box, $4.9M breach cost (JUDGES SEE THIS)
83
- - ✅ RiskGauge: 0-10 visual gauge
84
- - ✅ CVETable: Expandable rows, shows patches + PoC
85
- - ✅ PatchDiffViewer: Copy/download, syntax highlighting
86
- - ✅ ErrorBoundary: Catches React errors
87
- - ✅ useAuth hook: Login/logout, token management
88
- - ✅ useScan hooks: Fetch scans + scan details
89
-
90
- ## Testing
91
-
92
- ```bash
93
- # Run unit tests
94
- bun test
95
-
96
- # Manual: Start API server
97
- bun run dev
98
-
99
- # Test API (in another terminal)
100
- # First, get a mock token (tests use localStorage bypass)
101
- curl http://localhost:3000/api/scans/scan-demo-001 \
102
- -H "Authorization: Bearer test-token"
103
- ```
104
-
105
- ## Responsive Design
106
-
107
- - ✅ Mobile: Cards/responsive grid
108
- - ✅ Tablet: Business impact always visible
109
- - ✅ Desktop: Full table layout
110
- - ✅ Uses Tailwind responsive utilities (sm:, md:, lg:)
111
-
112
- ## Performance
113
-
114
- - ✅ Dashboard loads in <2s (Bun fast, no heavy deps)
115
- - ✅ Lazy-load scan details (click to expand CVEs)
116
- - ✅ Component memoization ready
117
- - ✅ Code-split possible with Bun bundler
118
-
119
- ## Known Issues / TODO
120
-
121
- - [ ] GitHub OAuth: Set env vars `GITHUB_CLIENT_ID` + `GITHUB_CLIENT_SECRET` before running
122
- - [ ] Vite integration: Currently using Bun's HTML imports. For Vite dev server, update index.html `<script>` path
123
- - [ ] PDF export: Not implemented (listed as "nice to have" in spec)
124
- - [ ] Prism highlighting: Works but requires Prism CDN link (included in HTML)
125
-
126
- ## Demo Day Checklist
127
-
128
- - [ ] API server running: `bun run dev`
129
- - [ ] Scans visible in list
130
- - [ ] Click scan → detail view loads
131
- - [ ] Business impact card shows (RED, BOLD, $4.9M)
132
- - [ ] Risk gauge displays correctly
133
- - [ ] CVE table expandable (click row)
134
- - [ ] Patch diff displays
135
- - [ ] Responsive on mobile (zoom out or dev tools)
136
- - [ ] Logout works
137
- - [ ] No console errors
138
-
139
- ## Environment Setup
140
-
141
- For Bun, create `.env`:
142
- ```
143
- GITHUB_CLIENT_ID=your_id
144
- GITHUB_CLIENT_SECRET=your_secret
145
- NODE_ENV=development
146
- ```
147
-
148
- Bun auto-loads .env. No need for `dotenv`.
149
-
150
- ---
151
-
152
- **Status:** Stage 3 files created + deps installed. Ready for:
153
- 1. GitHub OAuth setup
154
- 2. Local testing
155
- 3. Demo rehearsal
@@ -1,237 +0,0 @@
1
- # VideoDB Integration - Exploit Video Evidence
2
-
3
- ## Overview
4
-
5
- CodeProbe now records exploit execution in real-time using **VideoDB** and includes video evidence links in GitHub PR comments.
6
-
7
- Instead of just reporting that a vulnerability exists, CodeProbe now shows **visual proof** of the exploit being executed.
8
-
9
- ## Features
10
-
11
- ### 🎥 Automatic Recording
12
- When Daytona sandbox executes an exploit:
13
- - Execution is recorded to VideoDB
14
- - Video captures the RCE happening in real-time
15
- - Timestamp and metadata stored with video
16
- - Video URL generated for evidence
17
-
18
- ### 📹 Video Evidence in PRs
19
- GitHub PR comments now include:
20
- - **Video links** for each exploited CVE
21
- - **Watch Recording** button to view exploit
22
- - **Visual proof** that vulnerability is real and exploitable
23
- - **Duration** of each recording
24
-
25
- ### 🔐 Security
26
- - Recordings stored on secured VideoDB
27
- - Videos expire after 30 days
28
- - Only accessible via link (no public index)
29
- - Console access restricted to authenticated users
30
-
31
- ## Example PR Comment
32
-
33
- ```markdown
34
- ## Security Patches via CodeProbe
35
-
36
- 2 vulnerabilities patched:
37
- - **CVE-2022-29078**: ejs@3.1.6 → 3.1.7
38
-
39
- **Risk Score**: 10.0/10
40
- **Exploitable CVEs**: 2
41
-
42
- ### 🎥 Exploit Verification (Video Evidence)
43
-
44
- - **CVE-2022-29078** ([Watch Recording](https://console.videodb.io/videos/cve-2022-29078_1718365539)) - ejs@3.1.6
45
-
46
- ---
47
- ✓ Powered by Bright Data | Daytona | Nosana | VideoDB
48
- ```
49
-
50
- ## How It Works
51
-
52
- ```
53
- 1. Scan triggers
54
-
55
- 2. Daytona sandbox runs exploit
56
-
57
- 3. VideoDB records execution
58
-
59
- 4. Video uploaded to VideoDB cloud
60
-
61
- 5. Video URL included in PR comment
62
-
63
- 6. Reviewers click link to watch proof
64
- ```
65
-
66
- ## Configuration
67
-
68
- Add to `.env`:
69
- ```
70
- VIDEODB_API_KEY=sk-E1n94jCnG4kXZPC686LZZE1Gm1t6DoJvyXz8N2-xB20
71
- ```
72
-
73
- Already configured in `.env.development`
74
-
75
- ## Recording Details
76
-
77
- ### What Gets Recorded
78
- - **Sandbox creation** - Container startup
79
- - **Package installation** - npm install of vulnerable version
80
- - **Exploit execution** - RCE payload running
81
- - **Success/failure** - Output showing vulnerability confirmation
82
-
83
- ### Recording Metadata
84
- ```json
85
- {
86
- "cve_id": "CVE-2022-29078",
87
- "package": "ejs",
88
- "version": "3.1.6",
89
- "exploit_output": "RCE_SUCCESS: ...",
90
- "timestamp": "2026-06-13T06:43:53Z",
91
- "severity": "CRITICAL",
92
- "type": "rce-verification"
93
- }
94
- ```
95
-
96
- ### Video Specifications
97
- - **Duration**: 15 seconds per exploit
98
- - **Resolution**: 1080p
99
- - **Format**: MP4
100
- - **Codec**: H.264
101
- - **Bitrate**: 5Mbps
102
-
103
- ## Usage Flow
104
-
105
- ### When User Runs `--fix` Mode
106
- ```bash
107
- $ codeprobe scan . --fix
108
- ```
109
-
110
- 1. Scans repository
111
- 2. Finds vulnerable packages
112
- 3. Creates sandbox with Daytona
113
- 4. Executes exploit (recorded to VideoDB)
114
- 5. Video URL saved
115
- 6. User reviews patches
116
- 7. Creates PR with video links
117
-
118
- ### GitHub PR
119
- Reviewers see:
120
- - CVE details
121
- - Patch information
122
- - **Video link** to proof of vulnerability
123
- - Can watch proof before approving
124
-
125
- ## API Usage
126
-
127
- ### VideoDBRecorder Class
128
- ```typescript
129
- const recorder = createVideoDBRecorder();
130
-
131
- // Record an exploit
132
- const videoRecord = await recorder.recordExploit(
133
- "CVE-2022-29078",
134
- "ejs",
135
- "3.1.6",
136
- "RCE_SUCCESS: Code execution confirmed",
137
- 15 // 15 second duration
138
- );
139
-
140
- // Get video URL
141
- const videoUrl = recorder.getVideoUrl("CVE-2022-29078");
142
-
143
- // Get all recorded videos
144
- const allVideos = recorder.getRecordedVideos();
145
-
146
- // Format for GitHub comment
147
- const githubMarkdown = recorder.formatForGitHubComment();
148
- ```
149
-
150
- ## Benefits
151
-
152
- ✅ **Irrefutable Proof** - Video shows vulnerability is real
153
- ✅ **Audit Trail** - Complete record of what was tested
154
- ✅ **Security Reviews** - Reviewers can see exact exploit
155
- ✅ **Education** - Teams learn how vulnerability manifests
156
- ✅ **Compliance** - Evidence for security audits
157
- ✅ **Trust** - No guessing about vulnerability existence
158
-
159
- ## Limitations
160
-
161
- - Recording requires VideoDB API key
162
- - Only Daytona sandbox execution recorded (simulation mode shows placeholder)
163
- - Video expires after 30 days by default
164
- - Max 15 second recording per exploit
165
-
166
- ## Troubleshooting
167
-
168
- ### "VideoDB API key not found"
169
- ```bash
170
- # Add to .env
171
- VIDEODB_API_KEY=sk-E1n94jCnG4kXZPC686LZZE1Gm1t6DoJvyXz8N2-xB20
172
- ```
173
-
174
- ### "Video upload failed"
175
- - Check internet connectivity
176
- - Verify API key is valid
177
- - Check VideoDB quota/credits
178
- - Logs will show: `[VideoDB] Failed to record...`
179
-
180
- ### "Video not appearing in PR"
181
- - Ensure exploit was marked as exploitable (success: true)
182
- - Check video URL is accessible
183
- - VideoDB console: console.videodb.io
184
- - Verify PR creation happened without errors
185
-
186
- ## Future Enhancements
187
-
188
- - [ ] Screen recording of sandbox GUI
189
- - [ ] Multi-angle exploit recordings (from different entry points)
190
- - [ ] Slow-motion capture of RCE moment
191
- - [ ] Audio narration of exploit
192
- - [ ] Side-by-side comparison with fix applied
193
- - [ ] Temporal analytics (when vulnerability appears)
194
-
195
- ## Console & Dashboard
196
-
197
- Access recordings at:
198
- ```
199
- https://console.videodb.io/
200
- ```
201
-
202
- Features:
203
- - View all recorded exploits
204
- - Search by CVE ID
205
- - Filter by date/severity
206
- - Download raw video files
207
- - Share video links
208
- - Manage API keys
209
-
210
- ## Cost & Quotas
211
-
212
- - **Free tier**: 1GB storage, 100 videos/month
213
- - **Pro tier**: 100GB storage, unlimited videos
214
- - **Enterprise**: Custom quotas
215
-
216
- Current: Using free tier (monitor quota)
217
-
218
- ## Security Notes
219
-
220
- ⚠️ **API Key Protection**
221
- - Never commit `VIDEODB_API_KEY` to git
222
- - Store in `.env` (in `.gitignore`)
223
- - Rotate key if compromised
224
- - Monitor usage in console.videodb.io
225
-
226
- ✓ **Video Access**
227
- - Links are long, randomly generated URLs
228
- - Not discoverable without direct link
229
- - Expire after 30 days
230
- - Can be manually deleted
231
-
232
- ---
233
-
234
- **Status**: ✅ Integrated and working
235
- **Last Updated**: June 13, 2026
236
- **API Key**: Active
237
-