supasec 1.0.3 → 1.0.5

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 (117) hide show
  1. package/Feature-List.md +233 -0
  2. package/README.md +53 -12
  3. package/dist/cli.js +2 -0
  4. package/dist/cli.js.map +1 -1
  5. package/dist/commands/index.d.ts +1 -0
  6. package/dist/commands/index.d.ts.map +1 -1
  7. package/dist/commands/index.js +1 -0
  8. package/dist/commands/index.js.map +1 -1
  9. package/dist/commands/scan.d.ts.map +1 -1
  10. package/dist/commands/scan.js +82 -26
  11. package/dist/commands/scan.js.map +1 -1
  12. package/dist/commands/snapshot.d.ts +32 -0
  13. package/dist/commands/snapshot.d.ts.map +1 -0
  14. package/dist/commands/snapshot.js +282 -0
  15. package/dist/commands/snapshot.js.map +1 -0
  16. package/dist/reporters/html.d.ts +3 -2
  17. package/dist/reporters/html.d.ts.map +1 -1
  18. package/dist/reporters/html.js +844 -538
  19. package/dist/reporters/html.js.map +1 -1
  20. package/dist/reporters/terminal.d.ts +38 -2
  21. package/dist/reporters/terminal.d.ts.map +1 -1
  22. package/dist/reporters/terminal.js +292 -131
  23. package/dist/reporters/terminal.js.map +1 -1
  24. package/dist/scanners/auth/analyzer.d.ts +40 -0
  25. package/dist/scanners/auth/analyzer.d.ts.map +1 -0
  26. package/dist/scanners/auth/analyzer.js +673 -0
  27. package/dist/scanners/auth/analyzer.js.map +1 -0
  28. package/dist/scanners/auth/index.d.ts +6 -0
  29. package/dist/scanners/auth/index.d.ts.map +1 -0
  30. package/dist/scanners/auth/index.js +22 -0
  31. package/dist/scanners/auth/index.js.map +1 -0
  32. package/dist/scanners/edge/analyzer.d.ts +35 -0
  33. package/dist/scanners/edge/analyzer.d.ts.map +1 -0
  34. package/dist/scanners/edge/analyzer.js +614 -0
  35. package/dist/scanners/edge/analyzer.js.map +1 -0
  36. package/dist/scanners/edge/index.d.ts +6 -0
  37. package/dist/scanners/edge/index.d.ts.map +1 -0
  38. package/dist/scanners/edge/index.js +22 -0
  39. package/dist/scanners/edge/index.js.map +1 -0
  40. package/dist/scanners/functions/analyzer.d.ts +41 -0
  41. package/dist/scanners/functions/analyzer.d.ts.map +1 -0
  42. package/dist/scanners/functions/analyzer.js +378 -0
  43. package/dist/scanners/functions/analyzer.js.map +1 -0
  44. package/dist/scanners/functions/index.d.ts +6 -0
  45. package/dist/scanners/functions/index.d.ts.map +1 -0
  46. package/dist/scanners/functions/index.js +22 -0
  47. package/dist/scanners/functions/index.js.map +1 -0
  48. package/dist/scanners/git/index.d.ts +6 -0
  49. package/dist/scanners/git/index.d.ts.map +1 -0
  50. package/dist/scanners/git/index.js +22 -0
  51. package/dist/scanners/git/index.js.map +1 -0
  52. package/dist/scanners/git/scanner.d.ts +22 -0
  53. package/dist/scanners/git/scanner.d.ts.map +1 -0
  54. package/dist/scanners/git/scanner.js +531 -0
  55. package/dist/scanners/git/scanner.js.map +1 -0
  56. package/dist/scanners/https/analyzer.d.ts +42 -0
  57. package/dist/scanners/https/analyzer.d.ts.map +1 -0
  58. package/dist/scanners/https/analyzer.js +470 -0
  59. package/dist/scanners/https/analyzer.js.map +1 -0
  60. package/dist/scanners/https/index.d.ts +8 -0
  61. package/dist/scanners/https/index.d.ts.map +1 -0
  62. package/dist/scanners/https/index.js +17 -0
  63. package/dist/scanners/https/index.js.map +1 -0
  64. package/dist/scanners/index.d.ts +6 -0
  65. package/dist/scanners/index.d.ts.map +1 -1
  66. package/dist/scanners/index.js +6 -0
  67. package/dist/scanners/index.js.map +1 -1
  68. package/dist/scanners/rls/fuzzer.d.ts +40 -0
  69. package/dist/scanners/rls/fuzzer.d.ts.map +1 -0
  70. package/dist/scanners/rls/fuzzer.js +360 -0
  71. package/dist/scanners/rls/fuzzer.js.map +1 -0
  72. package/dist/scanners/rls/index.d.ts +1 -0
  73. package/dist/scanners/rls/index.d.ts.map +1 -1
  74. package/dist/scanners/rls/index.js +1 -0
  75. package/dist/scanners/rls/index.js.map +1 -1
  76. package/dist/scanners/secrets/detector.d.ts.map +1 -1
  77. package/dist/scanners/secrets/detector.js +44 -12
  78. package/dist/scanners/secrets/detector.js.map +1 -1
  79. package/dist/scanners/secrets/index.d.ts +1 -0
  80. package/dist/scanners/secrets/index.d.ts.map +1 -1
  81. package/dist/scanners/secrets/index.js +4 -0
  82. package/dist/scanners/secrets/index.js.map +1 -1
  83. package/dist/scanners/secrets/patterns.d.ts +25 -0
  84. package/dist/scanners/secrets/patterns.d.ts.map +1 -1
  85. package/dist/scanners/secrets/patterns.js +138 -27
  86. package/dist/scanners/secrets/patterns.js.map +1 -1
  87. package/dist/scanners/storage/analyzer.d.ts +49 -0
  88. package/dist/scanners/storage/analyzer.d.ts.map +1 -0
  89. package/dist/scanners/storage/analyzer.js +438 -0
  90. package/dist/scanners/storage/analyzer.js.map +1 -0
  91. package/dist/scanners/storage/index.d.ts +6 -0
  92. package/dist/scanners/storage/index.d.ts.map +1 -0
  93. package/dist/scanners/storage/index.js +22 -0
  94. package/dist/scanners/storage/index.js.map +1 -0
  95. package/package.json +1 -1
  96. package/reports/{supasec-audityour-app-2026-01-28-17-09-24.html → supasec-audityour-app-2026-01-28-19-42-22.html} +51 -16
  97. package/reports/supasec-audityour-app-2026-01-28-19-49-18.html +1122 -0
  98. package/COMPLETION_REPORT.md +0 -324
  99. package/FIXES_SUMMARY.md +0 -224
  100. package/IMPLEMENTATION_NOTES.md +0 -305
  101. package/QUICK_REFERENCE.md +0 -185
  102. package/REPORTING.md +0 -217
  103. package/STATUS.md +0 -269
  104. package/reports/supasec---------app-2026-01-28-16-58-47.html +0 -804
  105. package/reports/supasec---------app-2026-01-28-17-06-43.html +0 -722
  106. package/reports/supasec---------app-2026-01-28-17-07-23.html +0 -722
  107. package/reports/supasec---------app-2026-01-28-17-08-00.html +0 -722
  108. package/reports/supasec---------app-2026-01-28-17-08-20.html +0 -722
  109. package/reports/supasec---------app-2026-01-28-17-08-41.html +0 -722
  110. package/reports/supasec-au---your-app-2026-01-28-17-14-57.html +0 -715
  111. package/reports/supasec-au---your-app-2026-01-28-17-19-03.html +0 -715
  112. package/reports/supasec-ex-mple-com-2026-01-28-17-14-52.json +0 -229
  113. package/reports/supasec-ex-mple-com-2026-01-28-17-15-39.html +0 -715
  114. package/reports/supasec-ex-mple-com-2026-01-28-17-17-22.html +0 -715
  115. package/reports/supasec-example-com-2026-01-28-17-15-06.html +0 -715
  116. package/reports/supasec-my--------------name-com-2026-01-28-17-15-02.html +0 -715
  117. package/reports/supasec-st-ging-com-2026-01-28-17-16-17.html +0 -715
@@ -1,305 +0,0 @@
1
- # SupaSec Implementation Notes
2
-
3
- ## Recent Fixes & Updates
4
-
5
- ### 1. Privacy Masking (Partial Masking Format)
6
- **Status:** ✅ COMPLETED
7
-
8
- Enhanced the masking system to show partial domain information:
9
-
10
- **Old Format:** `***.***. app`
11
- **New Format:** `au******.app` (first 2 chars + masked middle + last 4 chars)
12
-
13
- **Examples:**
14
- ```
15
- audityour.app → au******.app
16
- example.com → ex******.com
17
- myverylongdomainname.com → my**************name.com
18
- staging.example.org → st******.org
19
- ```
20
-
21
- **Usage:**
22
- ```bash
23
- supasec scan https://myapp.com --mask --format json
24
- # Target will appear as: my******.com
25
- ```
26
-
27
- **Implementation Files:**
28
- - `src/commands/scan.ts` - `maskUrl()` and `maskDomain()` functions
29
- - Applied to all findings, descriptions, and evidence
30
-
31
- ---
32
-
33
- ### 2. HTML Report Improvements
34
- **Status:** ✅ COMPLETED
35
-
36
- #### Removed Demo Text
37
- - Removed "Demo Security Report" banner from HTML reports
38
- - Reports now show clean, professional formatting
39
- - No "sample report" messaging
40
-
41
- #### Technical Details Display
42
- Technical details section now properly shows:
43
- - **Exposed Key (masked)** - Shows masked secret value
44
- - **Key Type** - Shows the pattern/category detected
45
- - **Location** - File path, line number, URL, or table name
46
- - **Code Snippet** - Shows the context where secret was found
47
-
48
- **Example output:**
49
- ```
50
- Exposed Key (masked): pk_live_1234****8910
51
- Key Type: Stripe API Key
52
- Location: src/config.ts:42
53
- Code Snippet: const stripeKey = 'pk_live_1234...8910';
54
- ```
55
-
56
- ---
57
-
58
- ### 3. Report Format Options
59
- **Status:** ✅ COMPLETED
60
-
61
- Three report formats now available:
62
-
63
- #### Terminal (Default)
64
- ```bash
65
- supasec scan https://myapp.com
66
- ```
67
- Generates:
68
- - Colored terminal output
69
- - JSON report → `reports/supasec-report-{scan_id}.json`
70
- - HTML report → `reports/supasec-report-{scan_id}.html`
71
-
72
- #### JSON Format
73
- ```bash
74
- supasec scan https://myapp.com --format json
75
- # or with custom path:
76
- supasec scan https://myapp.com --format json --output ./audit.json
77
- ```
78
-
79
- #### HTML Format
80
- ```bash
81
- supasec scan https://myapp.com --format html
82
- # or with custom path:
83
- supasec scan https://myapp.com --format html --output ./report.html
84
- ```
85
-
86
- **All reports auto-save to `reports/` folder**
87
-
88
- ---
89
-
90
- ## Planned Features (Not Yet Implemented)
91
-
92
- ### 1. Fix Command (`supasec fix --interactive`)
93
- **Status:** ⏳ NOT YET IMPLEMENTED
94
-
95
- Currently, this command will show an error. To implement:
96
-
97
- ```typescript
98
- // src/commands/fix.ts
99
- export function registerFixCommand(program: Command): void {
100
- program
101
- .command('fix')
102
- .description('Fix security issues interactively or automatically')
103
- .option('-i, --interactive', 'Interactive fix mode')
104
- .option('-a, --auto', 'Automatic fix mode')
105
- .option('-b, --backup', 'Create backup before fixing')
106
- .action(async (options) => {
107
- // Implementation needed
108
- });
109
- }
110
- ```
111
-
112
- **What the fix command should do:**
113
- 1. Analyze recent scan results
114
- 2. For each finding, offer fix options
115
- 3. Apply fixes (generate SQL, update config, etc.)
116
- 4. Create backups if requested
117
- 5. Verify fixes worked
118
-
119
- **Priority:** Medium - Users can still scan and view reports
120
-
121
- ---
122
-
123
- ### 2. Watch Mode (`supasec watch --interval 604800`)
124
- **Status:** ⏳ NOT YET IMPLEMENTED
125
-
126
- Periodically scan and track security changes over time.
127
-
128
- **Usage:**
129
- ```bash
130
- supasec watch --interval 604800 # 7 days in seconds
131
- supasec watch --interval 86400 # 1 day
132
- supasec watch --interval 3600 # 1 hour
133
- ```
134
-
135
- **What it should do:**
136
- 1. Run scan at specified intervals
137
- 2. Track findings over time
138
- 3. Alert on new issues
139
- 4. Generate trend reports
140
- 5. Create historical comparison
141
-
142
- ---
143
-
144
- ### 3. Database Connection Support
145
- **Status:** ⏳ NOT YET IMPLEMENTED
146
-
147
- Currently uses mock data. Should support:
148
-
149
- ```bash
150
- # Via project URL and keys
151
- supasec scan --project-url https://abc.supabase.co \
152
- --anon-key abc123... \
153
- --service-key def456...
154
-
155
- # Via local Supabase
156
- supasec scan --local
157
- ```
158
-
159
- **What to implement:**
160
- 1. Connect to Supabase via SDK
161
- 2. Fetch actual table definitions
162
- 3. Check real RLS policies
163
- 4. Scan actual database schema
164
- 5. Get real function/RPC info
165
-
166
- ---
167
-
168
- ### 4. Configuration File Support
169
- **Status:** ⏳ NOT YET IMPLEMENTED
170
-
171
- Support for `.supasecrc.json` or `supasec.config.json`:
172
-
173
- ```json
174
- {
175
- "target": "https://myapp.com",
176
- "projectUrl": "https://abc.supabase.co",
177
- "format": "html",
178
- "mask": true,
179
- "failOn": ["critical", "high"],
180
- "ignorePaths": ["node_modules", ".next"],
181
- "customRules": [
182
- {
183
- "id": "CUSTOM-001",
184
- "pattern": "SECRET_API_KEY",
185
- "severity": "CRITICAL"
186
- }
187
- ]
188
- }
189
- ```
190
-
191
- Usage:
192
- ```bash
193
- supasec scan # Uses config file if present
194
- ```
195
-
196
- ---
197
-
198
- ### 5. CI/CD Integration
199
- **Status:** ⏳ PARTIAL (GitHub Actions example provided)
200
-
201
- Templates provided in docs, but could add:
202
- - Pre-built GitHub Actions
203
- - GitLab CI templates
204
- - Jenkins pipeline examples
205
- - Azure DevOps pipelines
206
-
207
- ---
208
-
209
- ## Known Limitations
210
-
211
- ### Current (Mock) Implementation
212
- 1. **No real database connection** - Uses sample data
213
- 2. **No browser-based scanning** - Puppeteer removed for now
214
- 3. **No real API scanning** - Mock endpoints only
215
- 4. **No RLS policy validation** - Uses mock policies
216
- 5. **No fix command** - Analysis only, no remediation
217
-
218
- ### Masking Limitations
219
- - Masking is primarily for privacy when sharing reports
220
- - Does not encrypt sensitive data in storage
221
- - Should not be used as security mechanism
222
-
223
- ### Report Limitations
224
- - HTML reports are standalone files
225
- - No server-side dashboard
226
- - No report comparison/trending
227
- - No historical data retention by default
228
-
229
- ---
230
-
231
- ## Architecture Notes
232
-
233
- ### Finding Model
234
- ```typescript
235
- interface Finding {
236
- finding_id: string; // e.g., "SEC-001"
237
- severity: Severity; // CRITICAL | HIGH | MEDIUM | LOW | INFO
238
- title: string;
239
- description: string;
240
- location?: FindingLocation; // Where the issue was found
241
- evidence?: FindingEvidence; // Proof/context
242
- impact: FindingImpact; // What could go wrong
243
- remediation: FindingRemediation; // How to fix it
244
- }
245
- ```
246
-
247
- ### Masking Strategy
248
- - Applied at report generation time, not storage
249
- - Original data stored in JSON reports
250
- - User can choose --mask flag to hide sensitive info
251
- - Partial masking maintains some identifier visibility
252
-
253
- ### Report Generation Flow
254
- ```
255
- Scan → Findings Collection → Mask (if --mask) → Format → Save
256
-
257
- JSON | HTML | Terminal
258
- ```
259
-
260
- ---
261
-
262
- ## Testing Checklist
263
-
264
- - [x] Basic scan works: `npm start -- scan https://example.com`
265
- - [x] Masking works: `npm start -- scan https://audityour.app --mask`
266
- - [x] JSON format: `npm start -- scan https://example.com --format json`
267
- - [x] HTML format: `npm start -- scan https://example.com --format html`
268
- - [x] Reports save to `reports/` folder
269
- - [x] Technical details display in HTML
270
- - [x] No "Demo" text in HTML reports
271
- - [ ] Fix command (not yet implemented)
272
- - [ ] Watch mode (not yet implemented)
273
- - [ ] Real database connection (not yet implemented)
274
-
275
- ---
276
-
277
- ## Next Steps for Development
278
-
279
- ### High Priority
280
- 1. Implement `supasec fix` command with SQL generation
281
- 2. Add real Supabase database connection
282
- 3. Implement configuration file support
283
- 4. Add historical scan data/trending
284
-
285
- ### Medium Priority
286
- 1. Implement watch mode
287
- 2. Add browser-based scanning (Puppeteer)
288
- 3. Create CI/CD templates
289
- 4. Add webhook integration
290
-
291
- ### Low Priority
292
- 1. Create web dashboard
293
- 2. Add multi-project support
294
- 3. Implement team features
295
- 4. Add custom rule builder
296
-
297
- ---
298
-
299
- ## Resources
300
-
301
- - [SupaSec GitHub](https://github.com/Interpoolx/supasec)
302
- - [Supabase Documentation](https://supabase.com/docs)
303
- - [AGENTS.md](./AGENTS.md) - Development guide
304
- - [REPORTING.md](./REPORTING.md) - Report formats guide
305
- - [PUBLISHING.md](./PUBLISHING.md) - Publishing to npm
@@ -1,185 +0,0 @@
1
- # SupaSec Quick Reference
2
-
3
- ## Common Commands
4
-
5
- ### Scan Websites
6
- ```bash
7
- # Basic scan (terminal output + JSON + HTML)
8
- npm start -- scan https://myapp.com
9
-
10
- # Scan with domain masking
11
- npm start -- scan https://myapp.com --mask
12
-
13
- # Scan for sharing (masked HTML report)
14
- npm start -- scan https://myapp.com --mask --format html --output report.html
15
- ```
16
-
17
- ### Report Formats
18
- ```bash
19
- # Terminal (default)
20
- npm start -- scan https://myapp.com
21
-
22
- # JSON only
23
- npm start -- scan https://myapp.com --format json
24
-
25
- # HTML only
26
- npm start -- scan https://myapp.com --format html
27
-
28
- # Custom output paths
29
- npm start -- scan https://myapp.com --format html --output ./report.html
30
- npm start -- scan https://myapp.com --format json --output ./audit.json
31
- ```
32
-
33
- ### Privacy & Sharing
34
- ```bash
35
- # Mask domains (au******.app format)
36
- npm start -- scan https://myapp.com --mask
37
-
38
- # Generate masked report for sharing
39
- npm start -- scan https://myapp.com --mask --format html --quiet --output /tmp/report.html
40
- ```
41
-
42
- ## Masking Examples
43
-
44
- | Original | Masked |
45
- |----------|--------|
46
- | `audityour.app` | `au******.app` |
47
- | `example.com` | `ex*mple.com` |
48
- | `myverylongdomainname.com` | `my**************name.com` |
49
- | `staging.example.com` | `st*ging.com` |
50
-
51
- ## Report Locations
52
-
53
- All reports auto-save to `reports/` folder:
54
- ```
55
- reports/
56
- ├── supasec-example-com-2026-01-28-17-15-06.html
57
- ├── supasec-example-com-2026-01-28-17-15-06.json
58
- ├── supasec-au******.app-2026-01-28-17-14-57.html
59
- └── ...
60
- ```
61
-
62
- ## Development Commands
63
-
64
- ```bash
65
- # Install dependencies
66
- npm install
67
-
68
- # Build TypeScript
69
- npm run build
70
-
71
- # Build in watch mode
72
- npm run dev
73
-
74
- # Run tests
75
- npm test
76
-
77
- # Lint code
78
- npm run lint
79
-
80
- # Fix lint errors
81
- npm run lint -- --fix
82
-
83
- # Clean builds
84
- rm -r dist/
85
- npm run build
86
- ```
87
-
88
- ## Publishing
89
-
90
- ```bash
91
- # Setup token (one time)
92
- npm config set //registry.npmjs.org/:_authToken npm_YOUR_TOKEN_HERE
93
-
94
- # Publish current version
95
- node scripts/publish.js
96
-
97
- # Publish as specific version
98
- node scripts/publish.js 1.0.5
99
- ```
100
-
101
- ## Troubleshooting
102
-
103
- ### Build Fails
104
- ```bash
105
- npm install
106
- npm run build
107
- ```
108
-
109
- ### Reports Not Generating
110
- ```bash
111
- # Check reports folder exists
112
- ls reports/
113
-
114
- # Run with non-quiet mode
115
- npm start -- scan https://example.com # See progress
116
- ```
117
-
118
- ### Masking Not Applied
119
- ```bash
120
- # Make sure to use --mask flag
121
- npm start -- scan https://myapp.com --mask # ✅
122
- npm start -- scan https://myapp.com # No masking
123
- ```
124
-
125
- ## File Locations
126
-
127
- | Purpose | Location |
128
- |---------|----------|
129
- | Source Code | `src/` |
130
- | Compiled Output | `dist/` |
131
- | Reports | `reports/` |
132
- | Config | `tsconfig.json`, `.eslintrc.json` |
133
- | Dependencies | `package.json` |
134
- | Docs | `AGENTS.md`, `REPORTING.md`, `PUBLISHING.md` |
135
-
136
- ## Useful Resources
137
-
138
- - [AGENTS.md](./AGENTS.md) - Development guide
139
- - [REPORTING.md](./REPORTING.md) - Report format details
140
- - [PUBLISHING.md](./PUBLISHING.md) - How to publish to npm
141
- - [IMPLEMENTATION_NOTES.md](./IMPLEMENTATION_NOTES.md) - Technical details
142
- - [COMPLETION_REPORT.md](./COMPLETION_REPORT.md) - What was fixed
143
-
144
- ## Options Reference
145
-
146
- ```bash
147
- supasec scan <target> [options]
148
-
149
- Options:
150
- -f, --format <format> Output format: terminal|json|html (default: terminal)
151
- -o, --output <file> Output file path
152
- --mask Mask domains in reports (au******.app format)
153
- -q, --quiet Suppress console output
154
- --no-color Disable colored output
155
- -t, --timeout <seconds> Scan timeout (default: 60)
156
- --fail-on <levels> Fail on severity: critical,high,medium,low
157
- -d, --deep Deep scan (slower, more thorough)
158
- -l, --local Scan local Supabase
159
- --project-url <url> Supabase project URL
160
- --anon-key <key> Supabase anon key
161
- --service-key <key> Supabase service role key
162
- ```
163
-
164
- ## HTML Report Features
165
-
166
- ✅ Color-coded severity levels
167
- ✅ Responsive mobile-friendly design
168
- ✅ Exposed secrets (masked)
169
- ✅ Security grade (A-F)
170
- ✅ Risk scores
171
- ✅ Remediation steps
172
- ✅ Print-friendly layout
173
- ✅ Fast page load
174
-
175
- ## Next Steps
176
-
177
- 1. **Scan your app:** `npm start -- scan https://myapp.com`
178
- 2. **Review report:** Open `reports/supasec-*.html`
179
- 3. **Share report:** Use `--mask` flag for privacy
180
- 4. **Implement fixes:** Follow remediation steps
181
- 5. **Re-scan:** Verify issues are fixed
182
-
183
- ---
184
-
185
- **More Help:** Check documentation files for detailed guides.
package/REPORTING.md DELETED
@@ -1,217 +0,0 @@
1
- # SupaSec Reporting Guide
2
-
3
- ## Report Formats
4
-
5
- SupaSec supports multiple report formats for different workflows.
6
-
7
- ### Terminal Output (Default)
8
-
9
- Display results directly in the terminal with colored formatting:
10
-
11
- ```bash
12
- supasec scan https://myapp.com
13
- ```
14
-
15
- Automatically generates:
16
- - Terminal output (colored)
17
- - JSON report (saved to `reports/`)
18
- - HTML report (saved to `reports/`)
19
-
20
- ### JSON Format
21
-
22
- Machine-readable JSON reports for CI/CD integration:
23
-
24
- ```bash
25
- supasec scan https://myapp.com --format json
26
- supasec scan https://myapp.com --format json --output custom/path/report.json
27
- ```
28
-
29
- ## HTML Format
30
-
31
- Beautiful interactive HTML reports for sharing and presentations:
32
-
33
- ```bash
34
- supasec scan https://myapp.com --format html
35
- supasec scan https://myapp.com --format html --output reports/audit-report.html
36
- ```
37
-
38
- Features:
39
- - ✓ Color-coded severity levels
40
- - ✓ Responsive design (works on all devices)
41
- - ✓ Detailed vulnerability information
42
- - ✓ Passed checks summary
43
- - ✓ Print-friendly layout
44
- - ✓ Risk scoring and grading
45
-
46
- ## Report Location
47
-
48
- By default, all reports are saved to the `reports/` folder:
49
-
50
- ```
51
- reports/
52
- ├── supasec-report-scan_2026-01-28T16-21-35.json
53
- └── supasec-report-scan_2026-01-28T16-21-35.html
54
- ```
55
-
56
- ### Custom Output Path
57
-
58
- ```bash
59
- # Specify custom output file
60
- supasec scan https://myapp.com --format json --output /path/to/report.json
61
-
62
- # Terminal mode generates both formats
63
- supasec scan https://myapp.com
64
- # → reports/supasec-report-{scan_id}.json
65
- # → reports/supasec-report-{scan_id}.html
66
- ```
67
-
68
- ## Report Contents
69
-
70
- ### JSON Report
71
-
72
- Machine-readable structure:
73
-
74
- ```json
75
- {
76
- "scan_metadata": {
77
- "tool": "supasec",
78
- "version": "1.0.0",
79
- "scan_id": "scan_2026-01-28T16-21-35",
80
- "target_url": "https://myapp.com",
81
- "scan_date": "2026-01-28T16:21:35.613Z",
82
- "scan_duration_seconds": 2.5,
83
- "scanner_mode": "url"
84
- },
85
- "summary": {
86
- "total_issues": 2,
87
- "critical": 0,
88
- "high": 1,
89
- "medium": 1,
90
- "low": 0,
91
- "overall_grade": "B",
92
- "overall_score": 85
93
- },
94
- "findings": [
95
- {
96
- "finding_id": "SEC-001",
97
- "severity": "HIGH",
98
- "title": "Exposed Secret",
99
- "description": "API key found in JavaScript bundle",
100
- "location": { "url": "https://myapp.com", "line": 42 },
101
- "impact": { "description": "Unauthorized API access" },
102
- "remediation": { "summary": "Remove secrets from client code" }
103
- }
104
- ],
105
- "passed_checks": [...],
106
- "grading": {...}
107
- }
108
- ```
109
-
110
- ### HTML Report
111
-
112
- Visual format with:
113
- - Executive summary cards
114
- - Severity breakdown
115
- - Detailed findings with descriptions
116
- - Remediation guidance
117
- - Security grading (A-F)
118
- - Scan metadata
119
-
120
- ## CI/CD Integration
121
-
122
- ### GitHub Actions Example
123
-
124
- ```yaml
125
- - name: Security Audit
126
- run: |
127
- npx supasec scan ${{ secrets.STAGING_URL }} \
128
- --format json \
129
- --output audit.json \
130
- --quiet
131
-
132
- - name: Upload Report
133
- if: always()
134
- uses: actions/upload-artifact@v3
135
- with:
136
- name: security-audit
137
- path: audit.json
138
- ```
139
-
140
- ### Parse JSON in CI/CD
141
-
142
- ```bash
143
- # Count critical issues
144
- critical=$(jq '.summary.critical' audit.json)
145
-
146
- # Fail if critical issues found
147
- if [ "$critical" -gt 0 ]; then
148
- echo "❌ Critical security issues found!"
149
- exit 1
150
- fi
151
- ```
152
-
153
- ## Options
154
-
155
- | Option | Format | Default | Description |
156
- |--------|--------|---------|-------------|
157
- | `--format` | `terminal\|json\|html` | `terminal` | Output format |
158
- | `--output` | path | `reports/{scan_id}.{ext}` | Custom output file |
159
- | `--quiet` | flag | false | Suppress console output |
160
-
161
- ## Examples
162
-
163
- ```bash
164
- # Default: Terminal + JSON + HTML
165
- npm start -- scan https://example.com
166
-
167
- # JSON only
168
- npm start -- scan https://example.com --format json
169
-
170
- # HTML only
171
- npm start -- scan https://example.com --format html
172
-
173
- # Custom output paths
174
- npm start -- scan https://example.com --format json --output ./security/report.json
175
- npm start -- scan https://example.com --format html --output ./public/audit.html
176
-
177
- # Quiet mode (no console output)
178
- npm start -- scan https://example.com --quiet
179
-
180
- # Combine options
181
- npm start -- scan https://example.com --format json --output results.json --quiet
182
- ```
183
-
184
- ## Opening HTML Reports
185
-
186
- Generated HTML reports are standalone files. Open them in any browser:
187
-
188
- ```bash
189
- # Windows
190
- start reports/supasec-report-scan_2026-01-28T16-21-35.html
191
-
192
- # macOS
193
- open reports/supasec-report-scan_2026-01-28T16-21-35.html
194
-
195
- # Linux
196
- xdg-open reports/supasec-report-scan_2026-01-28T16-21-35.html
197
- ```
198
-
199
- ## Report Retention
200
-
201
- Reports are stored in the `reports/` folder and are **not** committed to git:
202
-
203
- ```
204
- # .gitignore
205
- reports/
206
- supasec-report-*.json
207
- supasec-report-*.html
208
- ```
209
-
210
- Archive old reports:
211
- ```bash
212
- # Backup reports folder
213
- tar -czf reports-backup-$(date +%Y%m%d).tar.gz reports/
214
-
215
- # Clear old reports
216
- rm reports/supasec-report-*.{json,html}
217
- ```