ship-safe 6.1.0 → 6.2.0
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.
- package/README.md +735 -594
- package/cli/agents/api-fuzzer.js +345 -345
- package/cli/agents/auth-bypass-agent.js +348 -348
- package/cli/agents/base-agent.js +272 -272
- package/cli/agents/cicd-scanner.js +236 -201
- package/cli/agents/config-auditor.js +521 -521
- package/cli/agents/deep-analyzer.js +6 -2
- package/cli/agents/git-history-scanner.js +170 -170
- package/cli/agents/html-reporter.js +40 -4
- package/cli/agents/index.js +84 -84
- package/cli/agents/injection-tester.js +500 -500
- package/cli/agents/llm-redteam.js +251 -251
- package/cli/agents/mobile-scanner.js +231 -231
- package/cli/agents/orchestrator.js +322 -322
- package/cli/agents/pii-compliance-agent.js +301 -301
- package/cli/agents/scoring-engine.js +248 -248
- package/cli/agents/supabase-rls-agent.js +154 -154
- package/cli/agents/supply-chain-agent.js +650 -507
- package/cli/bin/ship-safe.js +452 -426
- package/cli/commands/agent.js +608 -608
- package/cli/commands/audit.js +986 -979
- package/cli/commands/baseline.js +193 -193
- package/cli/commands/ci.js +342 -342
- package/cli/commands/deps.js +516 -516
- package/cli/commands/doctor.js +159 -159
- package/cli/commands/fix.js +218 -218
- package/cli/commands/hooks.js +268 -0
- package/cli/commands/init.js +407 -407
- package/cli/commands/mcp.js +304 -304
- package/cli/commands/red-team.js +7 -1
- package/cli/commands/remediate.js +798 -798
- package/cli/commands/rotate.js +571 -571
- package/cli/commands/scan.js +569 -567
- package/cli/commands/score.js +449 -448
- package/cli/commands/watch.js +281 -281
- package/cli/hooks/patterns.js +313 -0
- package/cli/hooks/post-tool-use.js +140 -0
- package/cli/hooks/pre-tool-use.js +186 -0
- package/cli/index.js +73 -69
- package/cli/providers/llm-provider.js +397 -287
- package/cli/utils/autofix-rules.js +74 -74
- package/cli/utils/cache-manager.js +311 -311
- package/cli/utils/output.js +1 -0
- package/cli/utils/patterns.js +1121 -1121
- package/cli/utils/pdf-generator.js +94 -94
- package/package.json +69 -68
- package/cli/__tests__/agents.test.js +0 -1301
- package/configs/supabase/rls-templates.sql +0 -242
package/README.md
CHANGED
|
@@ -1,594 +1,735 @@
|
|
|
1
|
-
<p align="center">
|
|
2
|
-
<img src=".github/assets/logo%20ship%20safe.png" alt="Ship Safe Logo" width="180" />
|
|
3
|
-
</p>
|
|
4
|
-
<p align="center"><strong>AI-powered application security platform for developers.</strong></p>
|
|
5
|
-
<p align="center"><a href="https://shipsafecli.com">shipsafecli.com</a></p>
|
|
6
|
-
|
|
7
|
-
<p align="center">
|
|
8
|
-
<a href="https://www.npmjs.com/package/ship-safe"><img src="https://badge.fury.io/js/ship-safe.svg" alt="npm version" /></a>
|
|
9
|
-
<a href="https://www.npmjs.com/package/ship-safe"><img src="https://img.shields.io/npm/dm/ship-safe.svg" alt="npm downloads" /></a>
|
|
10
|
-
<a href="https://github.com/asamassekou10/ship-safe/actions/workflows/ci.yml"><img src="https://github.com/asamassekou10/ship-safe/actions/workflows/ci.yml/badge.svg" alt="CI" /></a>
|
|
11
|
-
<a href="https://nodejs.org"><img src="https://img.shields.io/node/v/ship-safe" alt="Node.js version" /></a>
|
|
12
|
-
<a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="License: MIT" /></a>
|
|
13
|
-
<a href="https://github.com/asamassekou10/ship-safe/stargazers"><img src="https://img.shields.io/github/stars/asamassekou10/ship-safe?style=social" alt="GitHub stars" /></a>
|
|
14
|
-
</p>
|
|
15
|
-
|
|
16
|
-
---
|
|
17
|
-
|
|
18
|
-
18 security agents. 80+ attack classes. One command.
|
|
19
|
-
|
|
20
|
-
**Ship Safe v6.
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
npx ship-safe
|
|
39
|
-
|
|
40
|
-
#
|
|
41
|
-
npx ship-safe
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
npx ship-safe
|
|
55
|
-
|
|
56
|
-
#
|
|
57
|
-
npx ship-safe
|
|
58
|
-
npx ship-safe
|
|
59
|
-
|
|
60
|
-
#
|
|
61
|
-
npx ship-safe
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
**
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
- `--
|
|
133
|
-
- `--
|
|
134
|
-
- `--
|
|
135
|
-
- `--
|
|
136
|
-
- `--
|
|
137
|
-
- `--
|
|
138
|
-
- `--
|
|
139
|
-
- `--
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
|
157
|
-
|
|
158
|
-
| **
|
|
159
|
-
| **
|
|
160
|
-
| **
|
|
161
|
-
| **
|
|
162
|
-
| **
|
|
163
|
-
| **
|
|
164
|
-
| **
|
|
165
|
-
| **
|
|
166
|
-
|
|
167
|
-
**
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
npx ship-safe
|
|
189
|
-
|
|
190
|
-
#
|
|
191
|
-
npx ship-safe
|
|
192
|
-
|
|
193
|
-
#
|
|
194
|
-
npx ship-safe
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
#
|
|
202
|
-
npx ship-safe
|
|
203
|
-
|
|
204
|
-
#
|
|
205
|
-
npx ship-safe
|
|
206
|
-
npx ship-safe
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
#
|
|
216
|
-
npx ship-safe
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
npx ship-safe
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
npx ship-safe
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
npx ship-safe
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
npx ship-safe
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
npx ship-safe
|
|
258
|
-
npx ship-safe
|
|
259
|
-
```
|
|
260
|
-
|
|
261
|
-
###
|
|
262
|
-
|
|
263
|
-
```bash
|
|
264
|
-
#
|
|
265
|
-
npx ship-safe
|
|
266
|
-
npx ship-safe
|
|
267
|
-
npx ship-safe
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
npx ship-safe
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
npx ship-safe
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
npx ship-safe
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
npx ship-safe
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
#
|
|
311
|
-
npx ship-safe
|
|
312
|
-
|
|
313
|
-
#
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
```
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
|
364
|
-
|
|
365
|
-
|
|
|
366
|
-
|
|
|
367
|
-
|
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
**
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
[
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src=".github/assets/logo%20ship%20safe.png" alt="Ship Safe Logo" width="180" />
|
|
3
|
+
</p>
|
|
4
|
+
<p align="center"><strong>AI-powered application security platform for developers.</strong></p>
|
|
5
|
+
<p align="center"><a href="https://shipsafecli.com">shipsafecli.com</a></p>
|
|
6
|
+
|
|
7
|
+
<p align="center">
|
|
8
|
+
<a href="https://www.npmjs.com/package/ship-safe"><img src="https://badge.fury.io/js/ship-safe.svg" alt="npm version" /></a>
|
|
9
|
+
<a href="https://www.npmjs.com/package/ship-safe"><img src="https://img.shields.io/npm/dm/ship-safe.svg" alt="npm downloads" /></a>
|
|
10
|
+
<a href="https://github.com/asamassekou10/ship-safe/actions/workflows/ci.yml"><img src="https://github.com/asamassekou10/ship-safe/actions/workflows/ci.yml/badge.svg" alt="CI" /></a>
|
|
11
|
+
<a href="https://nodejs.org"><img src="https://img.shields.io/node/v/ship-safe" alt="Node.js version" /></a>
|
|
12
|
+
<a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="License: MIT" /></a>
|
|
13
|
+
<a href="https://github.com/asamassekou10/ship-safe/stargazers"><img src="https://img.shields.io/github/stars/asamassekou10/ship-safe?style=social" alt="GitHub stars" /></a>
|
|
14
|
+
</p>
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
18 security agents. 80+ attack classes. One command.
|
|
19
|
+
|
|
20
|
+
**Ship Safe v6.2.0** is an AI-powered security platform that runs 18 specialized agents in parallel against your codebase, scanning for secrets, injection vulnerabilities, auth bypass, SSRF, supply chain attacks, Supabase RLS misconfigs, Docker/Terraform/Kubernetes misconfigs, CI/CD pipeline poisoning, LLM/agentic AI security, MCP server misuse, RAG poisoning, PII compliance, vibe coding patterns, exception handling, AI agent config security, and more. OWASP 2025 scoring with EPSS exploit probability. LLM-powered deep analysis verifies exploitability of critical findings. Secrets verification probes provider APIs to check if leaked keys are still active. Compliance mapping to SOC 2, ISO 27001, and NIST AI RMF. Built-in threat intelligence feed with offline-first IOC matching. CI integration with GitHub PR comments, threshold gating, and SARIF output.
|
|
21
|
+
|
|
22
|
+
**v6.2.0 highlights:** Real-time Claude Code hooks (`npx ship-safe hooks install`) block secrets before they land on disk. Universal LLM support — use Groq, Together AI, Mistral, DeepSeek, xAI, Perplexity, LM Studio, or any OpenAI-compatible endpoint for deep analysis. Supply chain IOC matching for known-compromised packages and CanisterWorm-style ICP blockchain C2 indicators.
|
|
23
|
+
|
|
24
|
+
[Documentation](https://shipsafecli.com/docs) | [Blog](https://shipsafecli.com/blog) | [Pricing](https://shipsafecli.com/pricing)
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## Quick Start
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
# Full security audit — secrets + 18 agents + deps + remediation plan
|
|
32
|
+
npx ship-safe audit .
|
|
33
|
+
|
|
34
|
+
# LLM-powered deep analysis (Anthropic, OpenAI, Google, Ollama)
|
|
35
|
+
npx ship-safe audit . --deep
|
|
36
|
+
|
|
37
|
+
# Red team scan only (18 agents, 80+ attack classes)
|
|
38
|
+
npx ship-safe red-team .
|
|
39
|
+
|
|
40
|
+
# Scan only changed files (fast pre-commit & PR scanning)
|
|
41
|
+
npx ship-safe diff
|
|
42
|
+
npx ship-safe diff --staged
|
|
43
|
+
|
|
44
|
+
# Fun emoji security grade with shareable badge
|
|
45
|
+
npx ship-safe vibe-check .
|
|
46
|
+
|
|
47
|
+
# Compare your score against industry averages
|
|
48
|
+
npx ship-safe benchmark .
|
|
49
|
+
|
|
50
|
+
# Quick secret scan
|
|
51
|
+
npx ship-safe scan .
|
|
52
|
+
|
|
53
|
+
# Security health score (0-100)
|
|
54
|
+
npx ship-safe score .
|
|
55
|
+
|
|
56
|
+
# CI/CD pipeline mode — compact output, exit codes, PR comments
|
|
57
|
+
npx ship-safe ci .
|
|
58
|
+
npx ship-safe ci . --github-pr
|
|
59
|
+
|
|
60
|
+
# Accept current findings, only report regressions
|
|
61
|
+
npx ship-safe baseline .
|
|
62
|
+
npx ship-safe audit . --baseline
|
|
63
|
+
|
|
64
|
+
# Check if leaked secrets are still active
|
|
65
|
+
npx ship-safe audit . --verify
|
|
66
|
+
|
|
67
|
+
# Environment diagnostics
|
|
68
|
+
npx ship-safe doctor
|
|
69
|
+
|
|
70
|
+
# Install Claude Code hooks — real-time secret blocking + advisory scan
|
|
71
|
+
npx ship-safe hooks install
|
|
72
|
+
npx ship-safe hooks status
|
|
73
|
+
npx ship-safe hooks remove
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+

|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## The `audit` Command
|
|
81
|
+
|
|
82
|
+
One command that runs everything and generates a full report:
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
npx ship-safe audit .
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
```
|
|
89
|
+
════════════════════════════════════════════════════════════
|
|
90
|
+
Ship Safe v6.0 — Full Security Audit
|
|
91
|
+
════════════════════════════════════════════════════════════
|
|
92
|
+
|
|
93
|
+
[Phase 1/4] Scanning for secrets... ✔ 49 found
|
|
94
|
+
[Phase 2/4] Running 18 security agents... ✔ 103 findings
|
|
95
|
+
[Phase 3/4] Auditing dependencies... ✔ 44 CVEs
|
|
96
|
+
[Phase 4/4] Computing security score... ✔ 25/100 F
|
|
97
|
+
|
|
98
|
+
Remediation Plan
|
|
99
|
+
════════════════════════════════════════════════════════
|
|
100
|
+
|
|
101
|
+
🔴 CRITICAL — fix immediately
|
|
102
|
+
────────────────────────────────────────────────────────
|
|
103
|
+
1. [SECRETS] Rotate Stripe Live Secret Key
|
|
104
|
+
.env:67 → Move to environment variable or secrets manager
|
|
105
|
+
|
|
106
|
+
2. [INJECTION] Unsafe pickle.loads()
|
|
107
|
+
backend/ai_processor.py:64 → Use JSON for untrusted data
|
|
108
|
+
|
|
109
|
+
🟠 HIGH — fix before deploy
|
|
110
|
+
────────────────────────────────────────────────────────
|
|
111
|
+
3. [XSS] dangerouslySetInnerHTML without sanitization
|
|
112
|
+
frontend/src/utils/blogContentRenderer.jsx:50 → Add DOMPurify
|
|
113
|
+
|
|
114
|
+
... 149 more items in the full report
|
|
115
|
+
|
|
116
|
+
📊 Full report: ship-safe-report.html
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
**What it runs:**
|
|
120
|
+
1. **Secret scan** — 50+ patterns with entropy scoring (API keys, passwords, tokens)
|
|
121
|
+
2. **18 security agents** — run in parallel with per-agent timeouts and framework-aware filtering (injection, auth, SSRF, supply chain, config, Supabase RLS, LLM, MCP, agentic AI, RAG, PII, vibe coding, exception handling, agent config, mobile, git history, CI/CD, API)
|
|
122
|
+
3. **Dependency audit** — npm/pip/bundler CVE scanning with EPSS exploit probability scores
|
|
123
|
+
4. **Secrets verification** — probes provider APIs (GitHub, Stripe, OpenAI, etc.) to check if leaked keys are still active
|
|
124
|
+
5. **Deep analysis** — LLM-powered taint analysis verifies exploitability of critical/high findings (optional)
|
|
125
|
+
6. **Score computation** — OWASP 2025 weighted scoring across 8 categories (0-100, A-F)
|
|
126
|
+
7. **Context-aware confidence tuning** — downgrades findings in test files, docs, and comments
|
|
127
|
+
8. **Compliance mapping** — maps findings to SOC 2 Type II, ISO 27001:2022, and NIST AI Risk Management Framework controls
|
|
128
|
+
9. **Remediation plan** — prioritized fix list grouped by severity
|
|
129
|
+
10. **Interactive HTML report** — standalone dark-themed report with severity filtering, search, collapsible findings, compliance summary, and click-to-copy ignore annotations
|
|
130
|
+
|
|
131
|
+
**Flags:**
|
|
132
|
+
- `--json` — structured JSON output (clean for piping)
|
|
133
|
+
- `--sarif` — SARIF format for GitHub Code Scanning
|
|
134
|
+
- `--csv` — CSV export for spreadsheets
|
|
135
|
+
- `--md` — Markdown report
|
|
136
|
+
- `--html [file]` — custom HTML report path (default: `ship-safe-report.html`)
|
|
137
|
+
- `--compare` — show per-category score delta vs. last scan
|
|
138
|
+
- `--timeout <ms>` — per-agent timeout (default: 30s)
|
|
139
|
+
- `--no-deps` — skip dependency audit
|
|
140
|
+
- `--no-ai` — skip AI classification
|
|
141
|
+
- `--no-cache` — force full rescan (ignore cached results)
|
|
142
|
+
- `--baseline` — only show findings not in the baseline
|
|
143
|
+
- `--pdf [file]` — generate PDF report (requires Chrome/Chromium)
|
|
144
|
+
- `--deep` — LLM-powered taint analysis for critical/high findings
|
|
145
|
+
- `--local` — use local Ollama model for deep analysis
|
|
146
|
+
- `--model <model>` — LLM model to use for deep/AI analysis
|
|
147
|
+
- `--provider <name>` — LLM provider: groq, together, mistral, deepseek, xai, perplexity, lmstudio
|
|
148
|
+
- `--base-url <url>` — custom OpenAI-compatible base URL (e.g. LM Studio, vLLM)
|
|
149
|
+
- `--budget <cents>` — max spend in cents for deep analysis (default: 50)
|
|
150
|
+
- `--verify` — check if leaked secrets are still active (probes provider APIs)
|
|
151
|
+
|
|
152
|
+
---
|
|
153
|
+
|
|
154
|
+
## 18 Security Agents
|
|
155
|
+
|
|
156
|
+
| Agent | Category | What It Detects |
|
|
157
|
+
|-------|----------|-----------------|
|
|
158
|
+
| **InjectionTester** | Code Vulns | SQL/NoSQL injection, command injection, code injection (eval), XSS, path traversal, XXE, ReDoS, prototype pollution, Python f-string SQL injection, Python subprocess shell injection |
|
|
159
|
+
| **AuthBypassAgent** | Auth | JWT vulnerabilities (alg:none, weak secrets), cookie security, CSRF, OAuth misconfig, BOLA/IDOR, weak crypto, timing attacks, TLS bypass, Django `DEBUG = True`, Flask hardcoded secret keys |
|
|
160
|
+
| **SSRFProber** | SSRF | User input in fetch/axios, cloud metadata endpoints, internal IPs, redirect following |
|
|
161
|
+
| **SupplyChainAudit** | Supply Chain | Typosquatting (Levenshtein distance), git/URL dependencies, wildcard versions, suspicious install scripts, dependency confusion, lockfile integrity |
|
|
162
|
+
| **ConfigAuditor** | Config | Dockerfile (running as root, :latest tags), Terraform (public S3/RDS, open SG, CloudFront HTTP, Lambda admin, S3 no versioning), Kubernetes (privileged containers, `:latest` tags, missing NetworkPolicy), CORS, CSP, Firebase, Nginx |
|
|
163
|
+
| **SupabaseRLSAgent** | Auth | Supabase Row Level Security — `service_role` key in client code, `CREATE TABLE` without RLS, anon key inserts, unprotected storage operations |
|
|
164
|
+
| **LLMRedTeam** | AI/LLM | OWASP LLM Top 10 — prompt injection, excessive agency, system prompt leakage, unbounded consumption, RAG poisoning |
|
|
165
|
+
| **MCPSecurityAgent** | AI/LLM | MCP server security — unvalidated tool inputs, missing auth, excessive permissions, tool poisoning, typosquatting detection, over-permissioned tools, shadow config discovery |
|
|
166
|
+
| **AgenticSecurityAgent** | AI/LLM | OWASP Agentic AI Top 10 — agent hijacking, privilege escalation, unsafe code execution, memory poisoning |
|
|
167
|
+
| **RAGSecurityAgent** | AI/LLM | RAG pipeline security — unvalidated embeddings, context injection, document poisoning, vector DB access control |
|
|
168
|
+
| **PIIComplianceAgent** | Compliance | PII detection — SSNs, credit cards, emails, phone numbers in source code, logs, and configs |
|
|
169
|
+
| **VibeCodingAgent** | Code Vulns | AI-generated code patterns — no input validation, empty catch blocks, hardcoded secrets, disabled security features, TODO-auth patterns |
|
|
170
|
+
| **ExceptionHandlerAgent** | Code Vulns | OWASP A10:2025 — empty catch blocks, unhandled promise rejections, missing React error boundaries, leaked stack traces, generic catch-all without rethrow |
|
|
171
|
+
| **AgentConfigScanner** | AI/LLM | AI agent config security — prompt injection in .cursorrules/CLAUDE.md/AGENTS.md/.windsurfrules, malicious Claude Code hooks (CVE-2026), OpenClaw public binding & malicious skills, encoded/obfuscated payloads, data exfiltration instructions, agent memory poisoning |
|
|
172
|
+
| **MobileScanner** | Mobile | OWASP Mobile Top 10 2024 — insecure storage, WebView JS injection, HTTP endpoints, excessive permissions, debug mode |
|
|
173
|
+
| **GitHistoryScanner** | Secrets | Leaked secrets in git commit history (checks if still active in working tree) |
|
|
174
|
+
| **CICDScanner** | CI/CD | OWASP CI/CD Top 10 — pipeline poisoning, unpinned actions, secret logging, self-hosted runners, script injection |
|
|
175
|
+
| **APIFuzzer** | API | Routes without auth, missing input validation, mass assignment, unrestricted file upload, GraphQL introspection, debug endpoints, missing rate limiting, OpenAPI spec security issues |
|
|
176
|
+
| **ReconAgent** | Recon | Attack surface discovery — frameworks, languages, auth patterns, databases, cloud providers, IaC, CI/CD pipelines |
|
|
177
|
+
|
|
178
|
+
**Post-processors:** ScoringEngine (8-category weighted scoring), VerifierAgent (secrets liveness verification), DeepAnalyzer (LLM-powered taint analysis)
|
|
179
|
+
|
|
180
|
+
---
|
|
181
|
+
|
|
182
|
+
## All Commands
|
|
183
|
+
|
|
184
|
+
### Core Audit Commands
|
|
185
|
+
|
|
186
|
+
```bash
|
|
187
|
+
# Full audit with remediation plan + HTML report
|
|
188
|
+
npx ship-safe audit .
|
|
189
|
+
|
|
190
|
+
# Red team: 18 agents, 80+ attack classes
|
|
191
|
+
npx ship-safe red-team .
|
|
192
|
+
npx ship-safe red-team . --agents injection,auth # Run specific agents
|
|
193
|
+
npx ship-safe red-team . --html report.html # HTML report
|
|
194
|
+
npx ship-safe red-team . --json # JSON output
|
|
195
|
+
|
|
196
|
+
# Secret scanner (pattern matching + entropy)
|
|
197
|
+
npx ship-safe scan .
|
|
198
|
+
npx ship-safe scan . --json # JSON for CI
|
|
199
|
+
npx ship-safe scan . --sarif # SARIF for GitHub
|
|
200
|
+
|
|
201
|
+
# Security health score (0-100, A-F)
|
|
202
|
+
npx ship-safe score .
|
|
203
|
+
|
|
204
|
+
# Dependency CVE audit
|
|
205
|
+
npx ship-safe deps .
|
|
206
|
+
npx ship-safe deps . --fix # Auto-fix vulnerabilities
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
### AI-Powered Commands
|
|
210
|
+
|
|
211
|
+
```bash
|
|
212
|
+
# AI audit: scan + classify with Claude + auto-fix secrets
|
|
213
|
+
npx ship-safe agent .
|
|
214
|
+
|
|
215
|
+
# Auto-fix hardcoded secrets: rewrite code + write .env
|
|
216
|
+
npx ship-safe remediate .
|
|
217
|
+
npx ship-safe remediate . --all # Also fix agent findings (TLS, debug, XSS, etc.)
|
|
218
|
+
|
|
219
|
+
# Revoke exposed keys — opens provider dashboards
|
|
220
|
+
npx ship-safe rotate .
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
### Baseline Management
|
|
224
|
+
|
|
225
|
+
```bash
|
|
226
|
+
# Accept current findings as baseline
|
|
227
|
+
npx ship-safe baseline .
|
|
228
|
+
|
|
229
|
+
# Audit showing only new findings since baseline
|
|
230
|
+
npx ship-safe audit . --baseline
|
|
231
|
+
|
|
232
|
+
# Show what changed since baseline
|
|
233
|
+
npx ship-safe baseline --diff
|
|
234
|
+
|
|
235
|
+
# Remove baseline
|
|
236
|
+
npx ship-safe baseline --clear
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
### Diff Scanning
|
|
240
|
+
|
|
241
|
+
```bash
|
|
242
|
+
# Scan only changed files (fast pre-commit & PR scanning)
|
|
243
|
+
npx ship-safe diff # All uncommitted changes
|
|
244
|
+
npx ship-safe diff --staged # Only staged changes
|
|
245
|
+
npx ship-safe diff HEAD~3 # Changes in last 3 commits
|
|
246
|
+
npx ship-safe diff --json # JSON output
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
### Vibe Check & Benchmark
|
|
250
|
+
|
|
251
|
+
```bash
|
|
252
|
+
# Fun emoji security grade
|
|
253
|
+
npx ship-safe vibe-check .
|
|
254
|
+
npx ship-safe vibe-check . --badge # Generate shields.io README badge
|
|
255
|
+
|
|
256
|
+
# Compare your score against industry averages (OWASP, Synopsys, Snyk)
|
|
257
|
+
npx ship-safe benchmark .
|
|
258
|
+
npx ship-safe benchmark . --json # JSON output
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
### CI/CD Pipeline
|
|
262
|
+
|
|
263
|
+
```bash
|
|
264
|
+
# CI mode — compact output, exit codes, threshold gating
|
|
265
|
+
npx ship-safe ci .
|
|
266
|
+
npx ship-safe ci . --threshold 80 # Custom passing score
|
|
267
|
+
npx ship-safe ci . --fail-on critical # Fail on severity
|
|
268
|
+
npx ship-safe ci . --sarif out.sarif # SARIF for GitHub
|
|
269
|
+
npx ship-safe ci . --github-pr # Post results as PR comment
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
### Deep Analysis & Verification
|
|
273
|
+
|
|
274
|
+
```bash
|
|
275
|
+
# LLM-powered deep analysis (Anthropic/OpenAI/Google/Ollama)
|
|
276
|
+
npx ship-safe audit . --deep
|
|
277
|
+
npx ship-safe audit . --deep --local # Use local Ollama
|
|
278
|
+
npx ship-safe audit . --deep --budget 50 # Cap spend at 50 cents
|
|
279
|
+
|
|
280
|
+
# Use any OpenAI-compatible provider for deep analysis
|
|
281
|
+
npx ship-safe audit . --deep --provider groq
|
|
282
|
+
npx ship-safe audit . --deep --provider together
|
|
283
|
+
npx ship-safe audit . --deep --provider mistral
|
|
284
|
+
npx ship-safe audit . --deep --provider deepseek
|
|
285
|
+
npx ship-safe audit . --deep --provider lmstudio # Local LM Studio
|
|
286
|
+
npx ship-safe audit . --deep --provider xai
|
|
287
|
+
npx ship-safe audit . --deep --provider perplexity
|
|
288
|
+
npx ship-safe audit . --deep --base-url http://localhost:1234/v1 --model my-model # Custom
|
|
289
|
+
|
|
290
|
+
# Check if leaked secrets are still active
|
|
291
|
+
npx ship-safe audit . --verify
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
### Diagnostics
|
|
295
|
+
|
|
296
|
+
```bash
|
|
297
|
+
# Environment check — Node.js, git, npm, API keys, cache, version
|
|
298
|
+
npx ship-safe doctor
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
### OpenClaw Security
|
|
302
|
+
|
|
303
|
+
```bash
|
|
304
|
+
# Focused OpenClaw security scan
|
|
305
|
+
npx ship-safe openclaw .
|
|
306
|
+
|
|
307
|
+
# Auto-harden OpenClaw configs (0.0.0.0→127.0.0.1, add auth, ws→wss)
|
|
308
|
+
npx ship-safe openclaw . --fix
|
|
309
|
+
|
|
310
|
+
# Red team: simulate ClawJacked, prompt injection, data exfil attacks
|
|
311
|
+
npx ship-safe openclaw . --red-team
|
|
312
|
+
|
|
313
|
+
# CI preflight — exit non-zero on critical findings
|
|
314
|
+
npx ship-safe openclaw . --preflight
|
|
315
|
+
|
|
316
|
+
# Scan a skill before installing it
|
|
317
|
+
npx ship-safe scan-skill https://clawhub.io/skills/some-skill
|
|
318
|
+
npx ship-safe scan-skill ./local-skill.json
|
|
319
|
+
npx ship-safe scan-skill --all # Scan all skills from openclaw.json
|
|
320
|
+
|
|
321
|
+
# Generate hardened OpenClaw config
|
|
322
|
+
npx ship-safe init --openclaw
|
|
323
|
+
|
|
324
|
+
# Generate Agent Bill of Materials (CycloneDX 1.5)
|
|
325
|
+
npx ship-safe abom .
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
### Threat Intelligence
|
|
329
|
+
|
|
330
|
+
```bash
|
|
331
|
+
# Update threat intel feed (ClawHavoc IOCs, malicious skills, config signatures)
|
|
332
|
+
npx ship-safe update-intel
|
|
333
|
+
|
|
334
|
+
# Ships with offline-first seed data — no internet required for scanning
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
### OpenClaw GitHub Action
|
|
338
|
+
|
|
339
|
+
Drop-in CI action that blocks PRs introducing agent config vulnerabilities:
|
|
340
|
+
|
|
341
|
+
```yaml
|
|
342
|
+
# .github/workflows/openclaw-security.yml
|
|
343
|
+
name: OpenClaw Security Check
|
|
344
|
+
|
|
345
|
+
on: [pull_request]
|
|
346
|
+
|
|
347
|
+
permissions:
|
|
348
|
+
contents: read
|
|
349
|
+
|
|
350
|
+
jobs:
|
|
351
|
+
openclaw:
|
|
352
|
+
runs-on: ubuntu-latest
|
|
353
|
+
steps:
|
|
354
|
+
- uses: actions/checkout@v4
|
|
355
|
+
|
|
356
|
+
- uses: asamassekou10/ship-safe/.github/actions/openclaw-check@main
|
|
357
|
+
with:
|
|
358
|
+
fail-on-critical: 'true'
|
|
359
|
+
```
|
|
360
|
+
|
|
361
|
+
**Inputs:**
|
|
362
|
+
|
|
363
|
+
| Input | Default | Description |
|
|
364
|
+
|-------|---------|-------------|
|
|
365
|
+
| `path` | `.` | Path to scan |
|
|
366
|
+
| `fail-on-critical` | `true` | Fail the check if critical findings are found |
|
|
367
|
+
| `node-version` | `20` | Node.js version to use |
|
|
368
|
+
|
|
369
|
+
**Outputs:**
|
|
370
|
+
|
|
371
|
+
| Output | Description |
|
|
372
|
+
|--------|-------------|
|
|
373
|
+
| `findings` | Total number of findings detected |
|
|
374
|
+
| `critical` | Number of critical findings |
|
|
375
|
+
|
|
376
|
+
Scans `openclaw.json`, `.cursorrules`, `CLAUDE.md`, Claude Code hooks, and MCP configs. Checks against the bundled threat intelligence database for known ClawHavoc IOCs.
|
|
377
|
+
|
|
378
|
+
### Defensive Hooks
|
|
379
|
+
|
|
380
|
+
```bash
|
|
381
|
+
# Install Claude Code defensive hooks (blocks curl|bash, exfil domains, rm -rf /)
|
|
382
|
+
npx ship-safe guard --generate-hooks
|
|
383
|
+
|
|
384
|
+
# Watch agent config files for drift (.cursorrules, CLAUDE.md, openclaw.json)
|
|
385
|
+
npx ship-safe watch . --configs
|
|
386
|
+
```
|
|
387
|
+
|
|
388
|
+
### Infrastructure Commands
|
|
389
|
+
|
|
390
|
+
```bash
|
|
391
|
+
# Continuous monitoring (watch files for changes)
|
|
392
|
+
npx ship-safe watch .
|
|
393
|
+
|
|
394
|
+
# Generate CycloneDX SBOM
|
|
395
|
+
npx ship-safe sbom .
|
|
396
|
+
|
|
397
|
+
# Policy-as-code (enforce minimum score, fail on severity)
|
|
398
|
+
npx ship-safe policy init
|
|
399
|
+
|
|
400
|
+
# Block git push if secrets found
|
|
401
|
+
npx ship-safe guard
|
|
402
|
+
|
|
403
|
+
# Initialize security configs (.gitignore, headers)
|
|
404
|
+
npx ship-safe init
|
|
405
|
+
|
|
406
|
+
# Launch-day security checklist
|
|
407
|
+
npx ship-safe checklist
|
|
408
|
+
|
|
409
|
+
# MCP server for AI editors (Claude Desktop, Cursor, etc.)
|
|
410
|
+
npx ship-safe mcp
|
|
411
|
+
```
|
|
412
|
+
|
|
413
|
+
---
|
|
414
|
+
|
|
415
|
+
## Claude Code Hooks
|
|
416
|
+
|
|
417
|
+
Install ship-safe as real-time Claude Code hooks — secrets are blocked **before** they ever touch disk:
|
|
418
|
+
|
|
419
|
+
```bash
|
|
420
|
+
npx ship-safe hooks install
|
|
421
|
+
```
|
|
422
|
+
|
|
423
|
+
Once installed, two hooks activate automatically on every Claude Code session:
|
|
424
|
+
|
|
425
|
+
| Hook | Trigger | Behaviour |
|
|
426
|
+
|------|---------|-----------|
|
|
427
|
+
| **PreToolUse** | Write / Edit / MultiEdit / Bash | Blocks the write if critical secrets are detected; blocks dangerous Bash patterns (curl\|bash, credential exfiltration, `rm -rf /`) |
|
|
428
|
+
| **PostToolUse** | Write / Edit / MultiEdit | Scans the saved file and injects advisory findings (high-severity patterns, DB URLs with credentials) directly into Claude's context — never blocks |
|
|
429
|
+
|
|
430
|
+
Hook scripts are copied to `~/.ship-safe/hooks/` at install time — a stable, user-owned location that survives `npx` cache rotations.
|
|
431
|
+
|
|
432
|
+
```bash
|
|
433
|
+
npx ship-safe hooks status # Check installation
|
|
434
|
+
npx ship-safe hooks remove # Uninstall
|
|
435
|
+
```
|
|
436
|
+
|
|
437
|
+
---
|
|
438
|
+
|
|
439
|
+
## Claude Code Plugin
|
|
440
|
+
|
|
441
|
+
Use Ship Safe directly inside Claude Code — no CLI needed:
|
|
442
|
+
|
|
443
|
+
```bash
|
|
444
|
+
claude plugin add github:asamassekou10/ship-safe
|
|
445
|
+
```
|
|
446
|
+
|
|
447
|
+
| Command | Description |
|
|
448
|
+
|---------|-------------|
|
|
449
|
+
| `/ship-safe` | Full security audit — 18 agents, remediation plan, auto-fix |
|
|
450
|
+
| `/ship-safe-scan` | Quick scan for leaked secrets |
|
|
451
|
+
| `/ship-safe-score` | Security health score (0-100) |
|
|
452
|
+
| `/ship-safe-deep` | LLM-powered deep taint analysis |
|
|
453
|
+
| `/ship-safe-ci` | CI/CD pipeline setup guide |
|
|
454
|
+
| `/ship-safe-hooks` | Install real-time Claude Code hooks (blocks secrets on write) |
|
|
455
|
+
| `/ship-safe-baseline` | Accept current findings as baseline; report only regressions |
|
|
456
|
+
| `/ship-safe-fix` | Auto-fix secrets and common vulnerabilities |
|
|
457
|
+
| `/ship-safe-red-team` | Run full red-team audit and open HTML report |
|
|
458
|
+
|
|
459
|
+
Claude interprets the results, explains findings in plain language, and can fix issues directly in your codebase.
|
|
460
|
+
|
|
461
|
+
---
|
|
462
|
+
|
|
463
|
+
## Incremental Scanning
|
|
464
|
+
|
|
465
|
+
Ship Safe caches file hashes and findings in `.ship-safe/context.json`. On subsequent runs, only changed files are re-scanned — unchanged files reuse cached results.
|
|
466
|
+
|
|
467
|
+
```
|
|
468
|
+
✔ [Phase 1/4] Secrets: 41 found (0 changed, 313 cached)
|
|
469
|
+
```
|
|
470
|
+
|
|
471
|
+
- **~40% faster** on repeated scans
|
|
472
|
+
- **Auto-invalidation** — cache expires after 24 hours or when ship-safe updates
|
|
473
|
+
- **`--no-cache`** — force a full rescan anytime
|
|
474
|
+
|
|
475
|
+
The cache is stored in `.ship-safe/` which is automatically excluded from scans.
|
|
476
|
+
|
|
477
|
+
### LLM Response Caching
|
|
478
|
+
|
|
479
|
+
When using AI classification (`--no-ai` to disable), results are cached in `.ship-safe/llm-cache.json` with a 7-day TTL. Repeated scans reuse cached classifications — reducing API costs significantly.
|
|
480
|
+
|
|
481
|
+
---
|
|
482
|
+
|
|
483
|
+
## Smart `.gitignore` Handling
|
|
484
|
+
|
|
485
|
+
Ship Safe respects your `.gitignore` for build output, caches, and vendor directories — but **always scans security-sensitive files** even if gitignored:
|
|
486
|
+
|
|
487
|
+
| Skipped (gitignore respected) | Always scanned (gitignore overridden) |
|
|
488
|
+
|-------------------------------|---------------------------------------|
|
|
489
|
+
| `node_modules/`, `dist/`, `build/` | `.env`, `.env.local`, `.env.production` |
|
|
490
|
+
| `*.log`, `*.pkl`, vendor dirs | `*.pem`, `*.key`, `*.p12` |
|
|
491
|
+
| Cache directories, IDE files | `credentials.json`, `*.secret` |
|
|
492
|
+
|
|
493
|
+
Why? Files like `.env` are gitignored *because* they contain secrets — which is exactly what a security scanner should catch.
|
|
494
|
+
|
|
495
|
+
---
|
|
496
|
+
|
|
497
|
+
## Multi-LLM Support
|
|
498
|
+
|
|
499
|
+
Ship Safe supports any AI provider for deep analysis and classification:
|
|
500
|
+
|
|
501
|
+
| Provider | Env Variable | Flag | Default Model |
|
|
502
|
+
|----------|-------------|------|---------------|
|
|
503
|
+
| **Anthropic** | `ANTHROPIC_API_KEY` | *(auto-detected)* | claude-haiku-4-5 |
|
|
504
|
+
| **OpenAI** | `OPENAI_API_KEY` | *(auto-detected)* | gpt-4o-mini |
|
|
505
|
+
| **Google** | `GOOGLE_AI_API_KEY` | *(auto-detected)* | gemini-2.0-flash |
|
|
506
|
+
| **Ollama** | `OLLAMA_HOST` | `--local` | Local models |
|
|
507
|
+
| **Groq** | `GROQ_API_KEY` | `--provider groq` | llama-3.3-70b-versatile |
|
|
508
|
+
| **Together AI** | `TOGETHER_API_KEY` | `--provider together` | meta-llama/Llama-3-70b-chat-hf |
|
|
509
|
+
| **Mistral** | `MISTRAL_API_KEY` | `--provider mistral` | mistral-small-latest |
|
|
510
|
+
| **DeepSeek** | `DEEPSEEK_API_KEY` | `--provider deepseek` | deepseek-chat |
|
|
511
|
+
| **xAI (Grok)** | `XAI_API_KEY` | `--provider xai` | grok-beta |
|
|
512
|
+
| **Perplexity** | `PERPLEXITY_API_KEY` | `--provider perplexity` | llama-3.1-sonar-small-128k-online |
|
|
513
|
+
| **LM Studio** | *(none)* | `--provider lmstudio` | Local server |
|
|
514
|
+
| **Custom** | *(any)* | `--base-url <url> --model <model>` | Any OpenAI-compatible |
|
|
515
|
+
|
|
516
|
+
Auto-detected from environment variables. Use `--provider <name>` to override. No API key required for scanning — AI is optional.
|
|
517
|
+
|
|
518
|
+
---
|
|
519
|
+
|
|
520
|
+
## Scoring System
|
|
521
|
+
|
|
522
|
+
Starts at 100. Each finding deducts points by severity and category, weighted by confidence level (high: 100%, medium: 60%, low: 30%) to reduce noise from heuristic patterns.
|
|
523
|
+
|
|
524
|
+
**8 Categories** (with weight caps):
|
|
525
|
+
|
|
526
|
+
| Category | Weight | Critical | High | Medium | Cap |
|
|
527
|
+
|----------|--------|----------|------|--------|-----|
|
|
528
|
+
| Secrets | 15% | -25 | -15 | -5 | -15 |
|
|
529
|
+
| Code Vulnerabilities | 15% | -20 | -10 | -3 | -15 |
|
|
530
|
+
| Dependencies | 13% | -20 | -10 | -5 | -13 |
|
|
531
|
+
| Auth & Access Control | 15% | -20 | -10 | -3 | -15 |
|
|
532
|
+
| Configuration | 8% | -15 | -8 | -3 | -8 |
|
|
533
|
+
| Supply Chain | 12% | -15 | -8 | -3 | -12 |
|
|
534
|
+
| API Security | 10% | -15 | -8 | -3 | -10 |
|
|
535
|
+
| AI/LLM Security | 12% | -15 | -8 | -3 | -12 |
|
|
536
|
+
|
|
537
|
+
*Weights aligned with OWASP Top 10 2025 risk rankings.*
|
|
538
|
+
|
|
539
|
+
**Grades:** A (90-100), B (75-89), C (60-74), D (40-59), F (0-39)
|
|
540
|
+
|
|
541
|
+
**Exit codes:** `0` for A/B (>= 75), `1` for C/D/F — use in CI to fail builds.
|
|
542
|
+
|
|
543
|
+
---
|
|
544
|
+
|
|
545
|
+
## Policy-as-Code
|
|
546
|
+
|
|
547
|
+
Create `.ship-safe.policy.json` to enforce team-wide security standards:
|
|
548
|
+
|
|
549
|
+
```bash
|
|
550
|
+
npx ship-safe policy init
|
|
551
|
+
```
|
|
552
|
+
|
|
553
|
+
```json
|
|
554
|
+
{
|
|
555
|
+
"minimumScore": 70,
|
|
556
|
+
"failOn": "critical",
|
|
557
|
+
"requiredScans": ["secrets", "injection", "deps", "auth"],
|
|
558
|
+
"ignoreRules": [],
|
|
559
|
+
"customSeverityOverrides": {},
|
|
560
|
+
"maxAge": { "criticalCVE": "7d", "highCVE": "30d", "mediumCVE": "90d" }
|
|
561
|
+
}
|
|
562
|
+
```
|
|
563
|
+
|
|
564
|
+
---
|
|
565
|
+
|
|
566
|
+
## CI/CD Integration
|
|
567
|
+
|
|
568
|
+
The dedicated `ci` command is optimized for pipelines — compact output, exit codes, threshold-based gating:
|
|
569
|
+
|
|
570
|
+
```bash
|
|
571
|
+
# Basic CI — fail if score < 75
|
|
572
|
+
npx ship-safe ci .
|
|
573
|
+
|
|
574
|
+
# Strict — fail on any critical finding
|
|
575
|
+
npx ship-safe ci . --fail-on critical
|
|
576
|
+
|
|
577
|
+
# Custom threshold + SARIF for GitHub Security tab
|
|
578
|
+
npx ship-safe ci . --threshold 80 --sarif results.sarif
|
|
579
|
+
|
|
580
|
+
# Only check new findings (not in baseline)
|
|
581
|
+
npx ship-safe ci . --baseline
|
|
582
|
+
```
|
|
583
|
+
|
|
584
|
+
**GitHub Actions example:**
|
|
585
|
+
|
|
586
|
+
```yaml
|
|
587
|
+
# .github/workflows/security.yml
|
|
588
|
+
name: Security Audit
|
|
589
|
+
|
|
590
|
+
on: [push, pull_request]
|
|
591
|
+
|
|
592
|
+
jobs:
|
|
593
|
+
security:
|
|
594
|
+
runs-on: ubuntu-latest
|
|
595
|
+
steps:
|
|
596
|
+
- uses: actions/checkout@v4
|
|
597
|
+
|
|
598
|
+
- name: Security gate
|
|
599
|
+
run: npx ship-safe ci . --threshold 75 --sarif results.sarif --github-pr
|
|
600
|
+
|
|
601
|
+
- uses: github/codeql-action/upload-sarif@v3
|
|
602
|
+
if: always()
|
|
603
|
+
with:
|
|
604
|
+
sarif_file: results.sarif
|
|
605
|
+
```
|
|
606
|
+
|
|
607
|
+
**Export formats:** `--json`, `--sarif`, `--csv`, `--md`, `--html`, `--pdf`
|
|
608
|
+
|
|
609
|
+
---
|
|
610
|
+
|
|
611
|
+
## Suppress False Positives
|
|
612
|
+
|
|
613
|
+
**Inline:** Add `# ship-safe-ignore` comment on a line:
|
|
614
|
+
```python
|
|
615
|
+
password = get_password() # ship-safe-ignore
|
|
616
|
+
```
|
|
617
|
+
|
|
618
|
+
**File-level:** Create `.ship-safeignore` (gitignore syntax):
|
|
619
|
+
```gitignore
|
|
620
|
+
# Exclude test fixtures
|
|
621
|
+
tests/fixtures/
|
|
622
|
+
*.test.js
|
|
623
|
+
|
|
624
|
+
# Exclude documentation with code examples
|
|
625
|
+
docs/
|
|
626
|
+
```
|
|
627
|
+
|
|
628
|
+
---
|
|
629
|
+
|
|
630
|
+
## OWASP Coverage
|
|
631
|
+
|
|
632
|
+
| Standard | Coverage |
|
|
633
|
+
|----------|----------|
|
|
634
|
+
| **OWASP Top 10 Web 2025** | A01-A10: Broken Access Control, Cryptographic Failures, Injection, Insecure Design, Security Misconfiguration, Vulnerable Components, Auth Failures, Data Integrity, Logging Failures, SSRF |
|
|
635
|
+
| **OWASP Top 10 Mobile 2024** | M1-M10: Improper Credential Usage, Inadequate Supply Chain, Insecure Auth, Insufficient Validation, Insecure Communication, Inadequate Privacy, Binary Protections, Security Misconfiguration, Insecure Data Storage, Insufficient Cryptography |
|
|
636
|
+
| **OWASP LLM Top 10 2025** | LLM01-LLM10: Prompt Injection, Sensitive Info Disclosure, Supply Chain, Data Poisoning, Improper Output Handling, Excessive Agency, System Prompt Leakage, Vector/Embedding Weaknesses, Misinformation, Unbounded Consumption |
|
|
637
|
+
| **OWASP CI/CD Top 10** | CICD-SEC-1 to 10: Insufficient Flow Control, Identity Management, Dependency Chain Abuse, Poisoned Pipeline Execution, Insufficient PBAC, Credential Hygiene, Insecure System Config, Ungoverned Usage, Improper Artifact Integrity, Insufficient Logging |
|
|
638
|
+
| **OWASP Agentic AI Top 10** | ASI01-ASI10: Agent Hijacking, Tool Misuse, Privilege Escalation, Unsafe Code Execution, Memory Poisoning, Identity Spoofing, Excessive Autonomy, Logging Gaps, Supply Chain Attacks, Cascading Hallucination |
|
|
639
|
+
|
|
640
|
+
---
|
|
641
|
+
|
|
642
|
+
## What's Inside
|
|
643
|
+
|
|
644
|
+
### [`/configs`](./configs)
|
|
645
|
+
Drop-in security configs for Next.js, Supabase, and Firebase.
|
|
646
|
+
|
|
647
|
+
### [`/snippets`](./snippets)
|
|
648
|
+
Copy-paste security patterns: rate limiting, JWT, CORS, input validation.
|
|
649
|
+
|
|
650
|
+
### [`/ai-defense`](./ai-defense)
|
|
651
|
+
LLM security: prompt injection detection, cost protection, system prompt hardening.
|
|
652
|
+
|
|
653
|
+
### [`/checklists`](./checklists)
|
|
654
|
+
Manual security audits: launch-day checklist, framework-specific guides.
|
|
655
|
+
|
|
656
|
+
---
|
|
657
|
+
|
|
658
|
+
## Add a Security Badge to Your README
|
|
659
|
+
|
|
660
|
+
Show the world your project is secure. After running `npx ship-safe audit .` or `npx ship-safe vibe-check . --badge`, add one of these to your README:
|
|
661
|
+
|
|
662
|
+
```markdown
|
|
663
|
+
<!-- Replace GRADE and COLOR with your results -->
|
|
664
|
+
[](https://shipsafecli.com)
|
|
665
|
+
```
|
|
666
|
+
|
|
667
|
+
| Grade | Badge |
|
|
668
|
+
|-------|-------|
|
|
669
|
+
| A+ | `[](https://shipsafecli.com)` |
|
|
670
|
+
| A | `[](https://shipsafecli.com)` |
|
|
671
|
+
| B | `[](https://shipsafecli.com)` |
|
|
672
|
+
| C | `[](https://shipsafecli.com)` |
|
|
673
|
+
| D | `[](https://shipsafecli.com)` |
|
|
674
|
+
| F | `[](https://shipsafecli.com)` |
|
|
675
|
+
|
|
676
|
+
---
|
|
677
|
+
|
|
678
|
+
## Supply Chain Hardening
|
|
679
|
+
|
|
680
|
+
Ship Safe practices what it preaches. Our own supply chain is hardened against the [2026 Trivy/CanisterWorm attack chain](https://shipsafecli.com/blog/supply-chain-attacks-2026-how-we-hardened-ship-safe):
|
|
681
|
+
|
|
682
|
+
| Defense | What It Blocks |
|
|
683
|
+
|---------|---------------|
|
|
684
|
+
| All GitHub Actions pinned to full commit SHAs | Tag repointing (Trivy-style) |
|
|
685
|
+
| `permissions: contents: read` in CI | Excessive token scope |
|
|
686
|
+
| `npm ci --ignore-scripts` in all pipelines | CanisterWorm postinstall propagation |
|
|
687
|
+
| OIDC trusted publishing with provenance | Stolen npm token publishing |
|
|
688
|
+
| CODEOWNERS on `action.yml`, `.github/`, `package.json` | Unauthorized changes to critical paths |
|
|
689
|
+
| Strict `files` allowlist in package.json | Accidental inclusion of secrets/configs |
|
|
690
|
+
| Self-scanning with ship-safe in CI | Malicious code injection |
|
|
691
|
+
| 5 direct dependencies | Minimal transitive attack surface |
|
|
692
|
+
|
|
693
|
+
Verify provenance on any Ship Safe release:
|
|
694
|
+
|
|
695
|
+
```bash
|
|
696
|
+
npm audit signatures
|
|
697
|
+
```
|
|
698
|
+
|
|
699
|
+
---
|
|
700
|
+
|
|
701
|
+
## Contributing
|
|
702
|
+
|
|
703
|
+
1. Fork the repo
|
|
704
|
+
2. Add your security pattern, agent, or config
|
|
705
|
+
3. Include comments explaining *why* it matters
|
|
706
|
+
4. Open a PR
|
|
707
|
+
|
|
708
|
+
See [CONTRIBUTING.md](./CONTRIBUTING.md) for guidelines.
|
|
709
|
+
|
|
710
|
+
---
|
|
711
|
+
|
|
712
|
+
## Security Standards Reference
|
|
713
|
+
|
|
714
|
+
- [OWASP Top 10 Web 2025](https://owasp.org/Top10/)
|
|
715
|
+
- [OWASP Top 10 Mobile 2024](https://owasp.org/www-project-mobile-top-10/)
|
|
716
|
+
- [OWASP LLM Top 10 2025](https://genai.owasp.org/llm-top-10/)
|
|
717
|
+
- [OWASP API Security Top 10 2023](https://owasp.org/API-Security/)
|
|
718
|
+
- [OWASP CI/CD Top 10](https://owasp.org/www-project-top-10-ci-cd-security-risks/)
|
|
719
|
+
- [OWASP Agentic AI Top 10](https://owasp.org/www-project-agentic-ai-top-10/)
|
|
720
|
+
|
|
721
|
+
---
|
|
722
|
+
|
|
723
|
+
## License
|
|
724
|
+
|
|
725
|
+
MIT - Use it, share it, secure your stuff.
|
|
726
|
+
|
|
727
|
+
---
|
|
728
|
+
|
|
729
|
+
## Star History
|
|
730
|
+
|
|
731
|
+
[](https://star-history.com/#asamassekou10/ship-safe&Date)
|
|
732
|
+
|
|
733
|
+
---
|
|
734
|
+
|
|
735
|
+
**Ship fast. Ship safe.** — [shipsafecli.com](https://shipsafecli.com)
|