ship-safe 4.1.0 → 4.3.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 +65 -16
- package/cli/__tests__/agents.test.js +722 -0
- package/cli/agents/api-fuzzer.js +345 -224
- package/cli/agents/auth-bypass-agent.js +348 -326
- package/cli/agents/base-agent.js +262 -253
- package/cli/agents/cicd-scanner.js +201 -200
- package/cli/agents/config-auditor.js +529 -413
- package/cli/agents/git-history-scanner.js +170 -167
- package/cli/agents/html-reporter.js +370 -363
- package/cli/agents/index.js +59 -56
- package/cli/agents/injection-tester.js +455 -401
- package/cli/agents/llm-redteam.js +251 -251
- package/cli/agents/mobile-scanner.js +225 -225
- package/cli/agents/orchestrator.js +263 -157
- package/cli/agents/scoring-engine.js +225 -207
- package/cli/agents/supabase-rls-agent.js +148 -0
- package/cli/agents/supply-chain-agent.js +356 -274
- package/cli/bin/ship-safe.js +29 -1
- package/cli/commands/audit.js +875 -620
- package/cli/commands/baseline.js +192 -0
- package/cli/commands/doctor.js +149 -0
- package/cli/commands/remediate.js +7 -3
- package/cli/index.js +60 -53
- package/cli/providers/llm-provider.js +287 -288
- package/cli/utils/autofix-rules.js +74 -0
- package/cli/utils/cache-manager.js +311 -258
- package/cli/utils/pdf-generator.js +94 -0
- package/package.json +2 -2
package/cli/bin/ship-safe.js
CHANGED
|
@@ -34,6 +34,8 @@ import { scoreCommand } from '../commands/score.js';
|
|
|
34
34
|
import { redTeamCommand } from '../commands/red-team.js';
|
|
35
35
|
import { watchCommand } from '../commands/watch.js';
|
|
36
36
|
import { auditCommand } from '../commands/audit.js';
|
|
37
|
+
import { doctorCommand } from '../commands/doctor.js';
|
|
38
|
+
import { baselineCommand } from '../commands/baseline.js';
|
|
37
39
|
import { PolicyEngine } from '../agents/policy-engine.js';
|
|
38
40
|
import { SBOMGenerator } from '../agents/sbom-generator.js';
|
|
39
41
|
|
|
@@ -141,6 +143,7 @@ program
|
|
|
141
143
|
.option('--dry-run', 'Preview changes without writing any files')
|
|
142
144
|
.option('--yes', 'Apply all fixes without prompting (for CI)')
|
|
143
145
|
.option('--stage', 'Also run git add on modified files after fixing')
|
|
146
|
+
.option('--all', 'Also fix common agent findings (debug mode, TLS bypass, shell injection)')
|
|
144
147
|
.action(remediateCommand);
|
|
145
148
|
|
|
146
149
|
// -----------------------------------------------------------------------------
|
|
@@ -188,10 +191,16 @@ program
|
|
|
188
191
|
.description('Full security audit: secrets + 12 agents + deps + score + remediation plan')
|
|
189
192
|
.option('--json', 'Output results as JSON')
|
|
190
193
|
.option('--sarif', 'Output results in SARIF format')
|
|
194
|
+
.option('--csv', 'Output results as CSV')
|
|
195
|
+
.option('--md', 'Output results as Markdown')
|
|
191
196
|
.option('--html [file]', 'HTML report path (default: ship-safe-report.html)')
|
|
197
|
+
.option('--compare', 'Show detailed comparison with last scan')
|
|
198
|
+
.option('--timeout <ms>', 'Per-agent timeout in milliseconds (default: 30000)', parseInt)
|
|
192
199
|
.option('--no-deps', 'Skip dependency audit')
|
|
193
200
|
.option('--no-ai', 'Skip AI classification')
|
|
194
201
|
.option('--no-cache', 'Force full rescan (ignore cached results)')
|
|
202
|
+
.option('--baseline', 'Only show findings not in the baseline')
|
|
203
|
+
.option('--pdf [file]', 'Generate PDF report (requires Chrome/Chromium)')
|
|
195
204
|
.option('-v, --verbose', 'Verbose output')
|
|
196
205
|
.action(auditCommand);
|
|
197
206
|
|
|
@@ -250,6 +259,24 @@ program
|
|
|
250
259
|
}
|
|
251
260
|
});
|
|
252
261
|
|
|
262
|
+
// -----------------------------------------------------------------------------
|
|
263
|
+
// BASELINE COMMAND (v4.3)
|
|
264
|
+
// -----------------------------------------------------------------------------
|
|
265
|
+
program
|
|
266
|
+
.command('baseline [path]')
|
|
267
|
+
.description('Create/manage a findings baseline — only report new findings on subsequent scans')
|
|
268
|
+
.option('--diff', 'Show what changed since baseline')
|
|
269
|
+
.option('--clear', 'Remove the baseline')
|
|
270
|
+
.action(baselineCommand);
|
|
271
|
+
|
|
272
|
+
// -----------------------------------------------------------------------------
|
|
273
|
+
// DOCTOR COMMAND
|
|
274
|
+
// -----------------------------------------------------------------------------
|
|
275
|
+
program
|
|
276
|
+
.command('doctor')
|
|
277
|
+
.description('Diagnose environment: check Node.js, git, API keys, cache, and dependencies')
|
|
278
|
+
.action(doctorCommand);
|
|
279
|
+
|
|
253
280
|
// -----------------------------------------------------------------------------
|
|
254
281
|
// PARSE AND RUN
|
|
255
282
|
// -----------------------------------------------------------------------------
|
|
@@ -258,12 +285,13 @@ program
|
|
|
258
285
|
if (process.argv.length === 2) {
|
|
259
286
|
console.log(banner);
|
|
260
287
|
console.log(chalk.yellow('\nQuick start:\n'));
|
|
261
|
-
console.log(chalk.cyan.bold(' v4.
|
|
288
|
+
console.log(chalk.cyan.bold(' v4.3 — Full Security Audit'));
|
|
262
289
|
console.log(chalk.white(' npx ship-safe audit . ') + chalk.gray('# Full audit: secrets + agents + deps + remediation plan'));
|
|
263
290
|
console.log(chalk.white(' npx ship-safe red-team . ') + chalk.gray('# 12-agent red team scan (50+ attack classes)'));
|
|
264
291
|
console.log(chalk.white(' npx ship-safe watch . ') + chalk.gray('# Continuous monitoring mode'));
|
|
265
292
|
console.log(chalk.white(' npx ship-safe sbom . ') + chalk.gray('# Generate CycloneDX SBOM'));
|
|
266
293
|
console.log(chalk.white(' npx ship-safe policy init ') + chalk.gray('# Create security policy template'));
|
|
294
|
+
console.log(chalk.white(' npx ship-safe doctor ') + chalk.gray('# Check environment and configuration'));
|
|
267
295
|
console.log();
|
|
268
296
|
console.log(chalk.gray(' Core commands:'));
|
|
269
297
|
console.log(chalk.white(' npx ship-safe agent . ') + chalk.gray('# AI audit: scan + classify + auto-fix'));
|