ship-safe 3.1.0 → 4.0.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.
Files changed (38) hide show
  1. package/README.md +200 -307
  2. package/cli/agents/api-fuzzer.js +224 -0
  3. package/cli/agents/auth-bypass-agent.js +326 -0
  4. package/cli/agents/base-agent.js +240 -0
  5. package/cli/agents/cicd-scanner.js +200 -0
  6. package/cli/agents/config-auditor.js +413 -0
  7. package/cli/agents/git-history-scanner.js +167 -0
  8. package/cli/agents/html-reporter.js +363 -0
  9. package/cli/agents/index.js +56 -0
  10. package/cli/agents/injection-tester.js +401 -0
  11. package/cli/agents/llm-redteam.js +251 -0
  12. package/cli/agents/mobile-scanner.js +225 -0
  13. package/cli/agents/orchestrator.js +152 -0
  14. package/cli/agents/policy-engine.js +149 -0
  15. package/cli/agents/recon-agent.js +196 -0
  16. package/cli/agents/sbom-generator.js +176 -0
  17. package/cli/agents/scoring-engine.js +207 -0
  18. package/cli/agents/ssrf-prober.js +130 -0
  19. package/cli/agents/supply-chain-agent.js +274 -0
  20. package/cli/bin/ship-safe.js +119 -2
  21. package/cli/commands/agent.js +606 -0
  22. package/cli/commands/audit.js +565 -0
  23. package/cli/commands/deps.js +447 -0
  24. package/cli/commands/fix.js +3 -3
  25. package/cli/commands/init.js +86 -3
  26. package/cli/commands/mcp.js +2 -2
  27. package/cli/commands/red-team.js +315 -0
  28. package/cli/commands/remediate.js +4 -4
  29. package/cli/commands/rotate.js +6 -6
  30. package/cli/commands/scan.js +64 -23
  31. package/cli/commands/score.js +446 -0
  32. package/cli/commands/watch.js +160 -0
  33. package/cli/index.js +40 -2
  34. package/cli/providers/llm-provider.js +288 -0
  35. package/cli/utils/entropy.js +6 -0
  36. package/cli/utils/output.js +42 -2
  37. package/cli/utils/patterns.js +393 -1
  38. package/package.json +19 -15
@@ -0,0 +1,225 @@
1
+ /**
2
+ * MobileScanner Agent
3
+ * ====================
4
+ *
5
+ * Security scanning for React Native, Expo, Flutter,
6
+ * and native mobile codebases.
7
+ * Based on OWASP Mobile Top 10 2024.
8
+ */
9
+
10
+ import fs from 'fs';
11
+ import path from 'path';
12
+ import { BaseAgent, createFinding } from './base-agent.js';
13
+
14
+ const PATTERNS = [
15
+ // ── M1: Improper Credential Usage ──────────────────────────────────────────
16
+ {
17
+ rule: 'MOBILE_HARDCODED_KEY',
18
+ title: 'Mobile: Hardcoded API Key in Bundle',
19
+ regex: /(?:apiKey|api_key|API_KEY|secret|SECRET)\s*[:=]\s*["'][a-zA-Z0-9_\-]{20,}["']/g,
20
+ severity: 'critical',
21
+ cwe: 'CWE-798',
22
+ owasp: 'M1',
23
+ description: 'Hardcoded API key in mobile code. Mobile bundles are easily decompiled.',
24
+ fix: 'Store secrets server-side. Use expo-secure-store or EncryptedSharedPreferences.',
25
+ },
26
+ {
27
+ rule: 'MOBILE_KEY_IN_CONFIG',
28
+ title: 'Mobile: Secret in app.json/app.config.js',
29
+ regex: /(?:apiKey|apiSecret|secret|token|password|private_key)\s*["']?\s*[:=]\s*["'][^"']{8,}["']/gi,
30
+ severity: 'high',
31
+ cwe: 'CWE-798',
32
+ owasp: 'M1',
33
+ description: 'Secret in app config file. This gets bundled into the app binary.',
34
+ fix: 'Move to environment variables or server-side configuration',
35
+ },
36
+
37
+ // ── M3: Insecure Authentication/Authorization ──────────────────────────────
38
+ {
39
+ rule: 'MOBILE_LOCAL_AUTH_ONLY',
40
+ title: 'Mobile: Client-Only Authentication',
41
+ regex: /(?:isAuthenticated|isLoggedIn|isAdmin)\s*[:=]\s*(?:AsyncStorage|localStorage|SecureStore)/g,
42
+ severity: 'high',
43
+ cwe: 'CWE-603',
44
+ owasp: 'M3',
45
+ description: 'Authentication state stored only on client. Attacker can bypass by modifying storage.',
46
+ fix: 'Verify authentication server-side on every API request',
47
+ },
48
+
49
+ // ── M4: Insufficient Input/Output Validation ──────────────────────────────
50
+ {
51
+ rule: 'MOBILE_WEBVIEW_JS',
52
+ title: 'Mobile: WebView JavaScript Enabled',
53
+ regex: /(?:javaScriptEnabled|javascriptEnabled)\s*[:=]\s*(?:\{?\s*true|True)/g,
54
+ severity: 'medium',
55
+ cwe: 'CWE-79',
56
+ owasp: 'M4',
57
+ description: 'WebView with JavaScript enabled can be exploited via injected content.',
58
+ fix: 'Disable JavaScript in WebViews loading untrusted content, or sanitize loaded HTML',
59
+ },
60
+ {
61
+ rule: 'MOBILE_DEEPLINK_INJECTION',
62
+ title: 'Mobile: Deep Link Parameter Injection',
63
+ regex: /(?:Linking\.getInitialURL|useURL|addEventListener.*url).*(?!validate|sanitize|verify)/g,
64
+ severity: 'high',
65
+ cwe: 'CWE-20',
66
+ owasp: 'M4',
67
+ confidence: 'low',
68
+ description: 'Deep link URL parameters used without validation. Attacker can craft malicious links.',
69
+ fix: 'Validate and sanitize all parameters from deep links before use',
70
+ },
71
+
72
+ // ── M5: Insecure Communication ─────────────────────────────────────────────
73
+ {
74
+ rule: 'MOBILE_HTTP_ENDPOINT',
75
+ title: 'Mobile: HTTP (Non-HTTPS) Endpoint',
76
+ regex: /(?:baseURL|apiUrl|endpoint|url|API_URL)\s*[:=]\s*["']http:\/\//gi,
77
+ severity: 'high',
78
+ cwe: 'CWE-319',
79
+ owasp: 'M5',
80
+ description: 'HTTP endpoint in mobile app. All traffic is unencrypted and interceptable.',
81
+ fix: 'Use HTTPS for all endpoints. Configure ATS (iOS) and cleartextTraffic (Android).',
82
+ },
83
+ {
84
+ rule: 'MOBILE_NO_CERT_PINNING',
85
+ title: 'Mobile: Missing Certificate Pinning',
86
+ regex: /(?:fetch|axios|http)\s*\(\s*(?!.*pin|certificate)/g,
87
+ severity: 'medium',
88
+ cwe: 'CWE-295',
89
+ owasp: 'M5',
90
+ confidence: 'low',
91
+ description: 'No certificate pinning detected. MITM attacks possible on compromised networks.',
92
+ fix: 'Implement cert pinning with react-native-ssl-pinning or TrustKit',
93
+ },
94
+
95
+ // ── M6: Inadequate Privacy Controls ────────────────────────────────────────
96
+ {
97
+ rule: 'MOBILE_EXCESSIVE_PERMISSIONS',
98
+ title: 'Mobile: Excessive Permissions',
99
+ regex: /(?:CAMERA|CONTACTS|LOCATION|MICROPHONE|CALENDAR|READ_SMS|CALL_LOG|READ_PHONE_STATE)\s*(?:[,\]])/g,
100
+ severity: 'medium',
101
+ cwe: 'CWE-250',
102
+ owasp: 'M6',
103
+ confidence: 'low',
104
+ description: 'Multiple sensitive permissions requested. Only request what is needed.',
105
+ fix: 'Remove unnecessary permissions. Request at runtime with clear justification.',
106
+ },
107
+
108
+ // ── M8: Security Misconfiguration ──────────────────────────────────────────
109
+ {
110
+ rule: 'MOBILE_DEBUG_BUILD',
111
+ title: 'Mobile: Debug Mode in Release',
112
+ regex: /(?:__DEV__|debuggable\s*[:=]\s*true|android:debuggable="true"|DEBUG_MODE\s*[:=]\s*true)/g,
113
+ severity: 'high',
114
+ cwe: 'CWE-215',
115
+ owasp: 'M8',
116
+ description: 'Debug mode enabled. Exposes debugging interfaces and detailed error messages.',
117
+ fix: 'Ensure __DEV__ checks are used correctly. Set debuggable=false in release builds.',
118
+ },
119
+ {
120
+ rule: 'MOBILE_BACKUP_ENABLED',
121
+ title: 'Mobile: App Backup Enabled',
122
+ regex: /(?:android:allowBackup="true"|allowsBackup\s*[:=]\s*true)/g,
123
+ severity: 'medium',
124
+ cwe: 'CWE-312',
125
+ owasp: 'M8',
126
+ description: 'App backup enabled. Sensitive data can be extracted from backups.',
127
+ fix: 'Set android:allowBackup="false" and exclude sensitive files from backup',
128
+ },
129
+
130
+ // ── M9: Insecure Data Storage ──────────────────────────────────────────────
131
+ {
132
+ rule: 'MOBILE_ASYNCSTORAGE_SECRET',
133
+ title: 'Mobile: Secret in AsyncStorage',
134
+ regex: /AsyncStorage\.setItem\s*\(\s*["'](?:.*(?:token|key|secret|password|credential|session))/gi,
135
+ severity: 'high',
136
+ cwe: 'CWE-312',
137
+ owasp: 'M9',
138
+ description: 'Storing secrets in AsyncStorage (unencrypted). Use expo-secure-store or Keychain.',
139
+ fix: 'Use expo-secure-store (Expo) or react-native-keychain for sensitive data',
140
+ },
141
+ {
142
+ rule: 'MOBILE_LOCALSTORAGE_SECRET',
143
+ title: 'Mobile: Secret in localStorage',
144
+ regex: /localStorage\.setItem\s*\(\s*["'](?:.*(?:token|key|secret|password|credential|session))/gi,
145
+ severity: 'high',
146
+ cwe: 'CWE-312',
147
+ owasp: 'M9',
148
+ description: 'Storing secrets in localStorage (unencrypted). Use secure storage APIs.',
149
+ fix: 'Use platform-specific secure storage: Keychain (iOS), EncryptedSharedPreferences (Android)',
150
+ },
151
+ {
152
+ rule: 'MOBILE_LOG_SENSITIVE',
153
+ title: 'Mobile: Sensitive Data in Logs',
154
+ regex: /console\.(?:log|info|warn|debug)\s*\(\s*.*(?:token|password|secret|key|credential|session|auth)/gi,
155
+ severity: 'medium',
156
+ cwe: 'CWE-532',
157
+ owasp: 'M9',
158
+ confidence: 'medium',
159
+ description: 'Sensitive data logged to console. Logs are accessible on rooted/jailbroken devices.',
160
+ fix: 'Remove sensitive data from console.log. Use __DEV__ check for debug logging.',
161
+ },
162
+
163
+ // ── M10: Insufficient Cryptography ─────────────────────────────────────────
164
+ {
165
+ rule: 'MOBILE_HARDCODED_CRYPTO_KEY',
166
+ title: 'Mobile: Hardcoded Encryption Key',
167
+ regex: /(?:encrypt|cipher|aes|crypto).*(?:key|iv|salt)\s*[:=]\s*["'][a-zA-Z0-9+/=]{8,}["']/gi,
168
+ severity: 'critical',
169
+ cwe: 'CWE-321',
170
+ owasp: 'M10',
171
+ description: 'Hardcoded encryption key in mobile code. Easily extracted from decompiled binary.',
172
+ fix: 'Derive keys from user credentials or fetch from server at runtime',
173
+ },
174
+
175
+ // ── Flutter-specific ───────────────────────────────────────────────────────
176
+ {
177
+ rule: 'FLUTTER_SHARED_PREFS_SECRET',
178
+ title: 'Flutter: Secret in SharedPreferences',
179
+ regex: /SharedPreferences.*(?:setString|setInt)\s*\(\s*["'](?:.*(?:token|key|secret|password|api))/gi,
180
+ severity: 'high',
181
+ cwe: 'CWE-312',
182
+ owasp: 'M9',
183
+ description: 'Storing secrets in SharedPreferences (unencrypted). Use flutter_secure_storage.',
184
+ fix: 'Use flutter_secure_storage package for sensitive data',
185
+ },
186
+ ];
187
+
188
+ export class MobileScanner extends BaseAgent {
189
+ constructor() {
190
+ super('MobileScanner', 'Mobile security scanning (OWASP Mobile Top 10)', 'mobile');
191
+ }
192
+
193
+ async analyze(context) {
194
+ const { rootPath, files, recon } = context;
195
+
196
+ // Only run if mobile framework detected
197
+ const isMobile = recon?.frameworks?.some(f =>
198
+ ['react-native', 'flutter', 'expo'].includes(f)
199
+ );
200
+
201
+ // Also check for mobile-specific files
202
+ const hasMobileFiles = files.some(f => {
203
+ const basename = path.basename(f);
204
+ return ['app.json', 'app.config.js', 'app.config.ts',
205
+ 'pubspec.yaml', 'AndroidManifest.xml', 'Info.plist',
206
+ 'expo-env.d.ts'].includes(basename);
207
+ });
208
+
209
+ if (!isMobile && !hasMobileFiles) return [];
210
+
211
+ const codeFiles = files.filter(f => {
212
+ const ext = path.extname(f).toLowerCase();
213
+ return ['.js', '.jsx', '.ts', '.tsx', '.dart', '.swift', '.kt',
214
+ '.java', '.xml', '.plist', '.json'].includes(ext);
215
+ });
216
+
217
+ let findings = [];
218
+ for (const file of codeFiles) {
219
+ findings = findings.concat(this.scanFileWithPatterns(file, PATTERNS));
220
+ }
221
+ return findings;
222
+ }
223
+ }
224
+
225
+ export default MobileScanner;
@@ -0,0 +1,152 @@
1
+ /**
2
+ * Agent Orchestrator
3
+ * ==================
4
+ *
5
+ * Coordinates all security agents, deduplicates findings,
6
+ * and produces a unified report.
7
+ *
8
+ * USAGE:
9
+ * const orchestrator = new Orchestrator();
10
+ * orchestrator.register(new InjectionTester());
11
+ * const results = await orchestrator.runAll(rootPath, options);
12
+ */
13
+
14
+ import path from 'path';
15
+ import ora from 'ora';
16
+ import chalk from 'chalk';
17
+ import { ReconAgent } from './recon-agent.js';
18
+
19
+ // =============================================================================
20
+ // ORCHESTRATOR
21
+ // =============================================================================
22
+
23
+ export class Orchestrator {
24
+ constructor() {
25
+ /** @type {import('./base-agent.js').BaseAgent[]} */
26
+ this.agents = [];
27
+ this.reconAgent = new ReconAgent();
28
+ }
29
+
30
+ /**
31
+ * Register an agent for execution.
32
+ */
33
+ register(agent) {
34
+ this.agents.push(agent);
35
+ return this;
36
+ }
37
+
38
+ /**
39
+ * Register multiple agents at once.
40
+ */
41
+ registerAll(agents) {
42
+ for (const agent of agents) {
43
+ this.register(agent);
44
+ }
45
+ return this;
46
+ }
47
+
48
+ /**
49
+ * Run all registered agents against the codebase.
50
+ *
51
+ * @param {string} rootPath — Absolute path to the project root
52
+ * @param {object} options — { verbose, agents[], categories[] }
53
+ * @returns {Promise<object>} — { recon, findings[], agentResults[] }
54
+ */
55
+ async runAll(rootPath, options = {}) {
56
+ const absolutePath = path.resolve(rootPath);
57
+
58
+ // ── 1. Recon — map the attack surface ─────────────────────────────────────
59
+ const quiet = options.quiet || false;
60
+ const reconSpinner = quiet ? null : ora({ text: 'Mapping attack surface...', color: 'cyan' }).start();
61
+ const recon = await this.reconAgent.analyze({ rootPath: absolutePath, options });
62
+ if (reconSpinner) reconSpinner.succeed(chalk.green('Attack surface mapped'));
63
+
64
+ // ── 2. Discover files once (shared across agents) ─────────────────────────
65
+ const files = await this.reconAgent.discoverFiles(absolutePath);
66
+
67
+ // ── 3. Filter agents if specific ones requested ───────────────────────────
68
+ let agentsToRun = this.agents;
69
+ if (options.agents && options.agents.length > 0) {
70
+ const requested = options.agents.map(a => a.toLowerCase());
71
+ agentsToRun = this.agents.filter(a => {
72
+ const name = a.name.toLowerCase();
73
+ const cat = a.category.toLowerCase();
74
+ return requested.some(r => name === r || name.includes(r) || cat === r);
75
+ });
76
+ }
77
+ if (options.categories && options.categories.length > 0) {
78
+ const requested = new Set(options.categories.map(c => c.toLowerCase()));
79
+ agentsToRun = agentsToRun.filter(a => requested.has(a.category.toLowerCase()));
80
+ }
81
+
82
+ // ── 4. Run each agent ─────────────────────────────────────────────────────
83
+ const context = { rootPath: absolutePath, files, recon, options };
84
+ const agentResults = [];
85
+ let allFindings = [];
86
+
87
+ for (const agent of agentsToRun) {
88
+ const spinner = quiet ? null : ora({
89
+ text: `Running ${agent.name}...`,
90
+ color: 'cyan'
91
+ }).start();
92
+
93
+ try {
94
+ const findings = await agent.analyze(context);
95
+ agentResults.push({
96
+ agent: agent.name,
97
+ category: agent.category,
98
+ findingCount: findings.length,
99
+ success: true,
100
+ });
101
+ allFindings = allFindings.concat(findings);
102
+ if (spinner) spinner.succeed(
103
+ findings.length === 0
104
+ ? chalk.green(`${agent.name}: clean`)
105
+ : chalk.yellow(`${agent.name}: ${findings.length} finding(s)`)
106
+ );
107
+ } catch (err) {
108
+ agentResults.push({
109
+ agent: agent.name,
110
+ category: agent.category,
111
+ findingCount: 0,
112
+ success: false,
113
+ error: err.message,
114
+ });
115
+ if (spinner) spinner.fail(chalk.red(`${agent.name}: error — ${err.message}`));
116
+ }
117
+ }
118
+
119
+ // ── 5. Deduplicate ────────────────────────────────────────────────────────
120
+ allFindings = this.deduplicate(allFindings);
121
+
122
+ // ── 6. Sort by severity ───────────────────────────────────────────────────
123
+ const sevOrder = { critical: 0, high: 1, medium: 2, low: 3 };
124
+ allFindings.sort((a, b) =>
125
+ (sevOrder[a.severity] ?? 4) - (sevOrder[b.severity] ?? 4)
126
+ );
127
+
128
+ return { recon, findings: allFindings, agentResults };
129
+ }
130
+
131
+ /**
132
+ * Run only agents matching a specific category.
133
+ */
134
+ async runCategory(category, rootPath, options = {}) {
135
+ return this.runAll(rootPath, { ...options, categories: [category] });
136
+ }
137
+
138
+ /**
139
+ * Remove duplicate findings (same file + line + rule).
140
+ */
141
+ deduplicate(findings) {
142
+ const seen = new Set();
143
+ return findings.filter(f => {
144
+ const key = `${f.file}:${f.line}:${f.rule}`;
145
+ if (seen.has(key)) return false;
146
+ seen.add(key);
147
+ return true;
148
+ });
149
+ }
150
+ }
151
+
152
+ export default Orchestrator;
@@ -0,0 +1,149 @@
1
+ /**
2
+ * Policy-as-Code Engine
3
+ * ======================
4
+ *
5
+ * Enforces security policies defined in .ship-safe.policy.json.
6
+ * Teams can define minimum scores, required scans, severity thresholds,
7
+ * and custom rule overrides.
8
+ *
9
+ * USAGE:
10
+ * const policy = PolicyEngine.load(rootPath);
11
+ * const violations = policy.evaluate(scoreResult, findings);
12
+ */
13
+
14
+ import fs from 'fs';
15
+ import path from 'path';
16
+
17
+ const DEFAULT_POLICY = {
18
+ minimumScore: 0,
19
+ failOn: null, // 'critical' | 'high' | 'medium' — fail if any finding at this level
20
+ requiredScans: [], // ['secrets', 'deps', 'injection', 'auth']
21
+ ignoreRules: [], // ['GENERIC_API_KEY', 'API_NO_VALIDATION']
22
+ customSeverityOverrides: {}, // { 'CORS_WILDCARD': 'critical' }
23
+ maxAge: {
24
+ criticalCVE: null, // '7d' — max time before critical CVEs must be fixed
25
+ highCVE: null,
26
+ mediumCVE: null,
27
+ },
28
+ };
29
+
30
+ export class PolicyEngine {
31
+ constructor(policy = {}) {
32
+ this.policy = { ...DEFAULT_POLICY, ...policy };
33
+ }
34
+
35
+ /**
36
+ * Load policy from .ship-safe.policy.json in the project root.
37
+ */
38
+ static load(rootPath) {
39
+ const policyPath = path.join(rootPath, '.ship-safe.policy.json');
40
+
41
+ if (!fs.existsSync(policyPath)) {
42
+ return new PolicyEngine();
43
+ }
44
+
45
+ try {
46
+ const content = JSON.parse(fs.readFileSync(policyPath, 'utf-8'));
47
+ return new PolicyEngine(content);
48
+ } catch (err) {
49
+ console.warn(`Warning: Could not parse .ship-safe.policy.json: ${err.message}`);
50
+ return new PolicyEngine();
51
+ }
52
+ }
53
+
54
+ /**
55
+ * Evaluate findings against the policy.
56
+ * Returns array of violations (empty = pass).
57
+ */
58
+ evaluate(scoreResult, findings = []) {
59
+ const violations = [];
60
+
61
+ // ── Minimum score check ───────────────────────────────────────────────────
62
+ if (this.policy.minimumScore > 0 && scoreResult.score < this.policy.minimumScore) {
63
+ violations.push({
64
+ type: 'minimum_score',
65
+ message: `Score ${scoreResult.score} is below minimum ${this.policy.minimumScore}`,
66
+ severity: 'critical',
67
+ });
68
+ }
69
+
70
+ // ── Fail-on severity check ────────────────────────────────────────────────
71
+ if (this.policy.failOn) {
72
+ const sevOrder = ['critical', 'high', 'medium', 'low'];
73
+ const threshold = sevOrder.indexOf(this.policy.failOn);
74
+
75
+ for (const finding of findings) {
76
+ const findingSev = sevOrder.indexOf(finding.severity);
77
+ if (findingSev >= 0 && findingSev <= threshold) {
78
+ violations.push({
79
+ type: 'severity_threshold',
80
+ message: `${finding.severity} finding: ${finding.title} in ${finding.file}:${finding.line}`,
81
+ severity: finding.severity,
82
+ finding,
83
+ });
84
+ }
85
+ }
86
+ }
87
+
88
+ return violations;
89
+ }
90
+
91
+ /**
92
+ * Check if a finding's rule should be ignored by policy.
93
+ */
94
+ isIgnored(finding) {
95
+ return this.policy.ignoreRules.includes(finding.rule);
96
+ }
97
+
98
+ /**
99
+ * Apply severity overrides from policy.
100
+ */
101
+ applySeverityOverrides(findings) {
102
+ return findings.map(f => {
103
+ if (this.policy.customSeverityOverrides[f.rule]) {
104
+ return { ...f, severity: this.policy.customSeverityOverrides[f.rule] };
105
+ }
106
+ return f;
107
+ });
108
+ }
109
+
110
+ /**
111
+ * Filter findings by policy ignores and apply overrides.
112
+ */
113
+ applyPolicy(findings) {
114
+ let filtered = findings.filter(f => !this.isIgnored(f));
115
+ filtered = this.applySeverityOverrides(filtered);
116
+ return filtered;
117
+ }
118
+
119
+ /**
120
+ * Check if policy passes (no violations).
121
+ */
122
+ passes(scoreResult, findings) {
123
+ return this.evaluate(scoreResult, findings).length === 0;
124
+ }
125
+
126
+ /**
127
+ * Generate a default policy template.
128
+ */
129
+ static generateTemplate(rootPath) {
130
+ const template = {
131
+ minimumScore: 70,
132
+ failOn: 'critical',
133
+ requiredScans: ['secrets', 'injection', 'deps', 'auth'],
134
+ ignoreRules: [],
135
+ customSeverityOverrides: {},
136
+ maxAge: {
137
+ criticalCVE: '7d',
138
+ highCVE: '30d',
139
+ mediumCVE: '90d',
140
+ },
141
+ };
142
+
143
+ const policyPath = path.join(rootPath, '.ship-safe.policy.json');
144
+ fs.writeFileSync(policyPath, JSON.stringify(template, null, 2));
145
+ return policyPath;
146
+ }
147
+ }
148
+
149
+ export default PolicyEngine;