ferret-scan 1.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 (69) hide show
  1. package/CHANGELOG.md +51 -0
  2. package/LICENSE +21 -0
  3. package/README.md +416 -0
  4. package/bin/ferret.js +822 -0
  5. package/dist/__tests__/basic.test.d.ts +6 -0
  6. package/dist/__tests__/basic.test.js +80 -0
  7. package/dist/analyzers/AstAnalyzer.d.ts +30 -0
  8. package/dist/analyzers/AstAnalyzer.js +332 -0
  9. package/dist/analyzers/CorrelationAnalyzer.d.ts +21 -0
  10. package/dist/analyzers/CorrelationAnalyzer.js +288 -0
  11. package/dist/index.d.ts +17 -0
  12. package/dist/index.js +22 -0
  13. package/dist/intelligence/IndicatorMatcher.d.ts +50 -0
  14. package/dist/intelligence/IndicatorMatcher.js +285 -0
  15. package/dist/intelligence/ThreatFeed.d.ts +99 -0
  16. package/dist/intelligence/ThreatFeed.js +296 -0
  17. package/dist/remediation/Fixer.d.ts +71 -0
  18. package/dist/remediation/Fixer.js +391 -0
  19. package/dist/remediation/Quarantine.d.ts +102 -0
  20. package/dist/remediation/Quarantine.js +329 -0
  21. package/dist/reporters/ConsoleReporter.d.ts +13 -0
  22. package/dist/reporters/ConsoleReporter.js +185 -0
  23. package/dist/reporters/HtmlReporter.d.ts +25 -0
  24. package/dist/reporters/HtmlReporter.js +604 -0
  25. package/dist/reporters/SarifReporter.d.ts +86 -0
  26. package/dist/reporters/SarifReporter.js +117 -0
  27. package/dist/rules/ai-specific.d.ts +8 -0
  28. package/dist/rules/ai-specific.js +221 -0
  29. package/dist/rules/backdoors.d.ts +8 -0
  30. package/dist/rules/backdoors.js +134 -0
  31. package/dist/rules/correlationRules.d.ts +8 -0
  32. package/dist/rules/correlationRules.js +227 -0
  33. package/dist/rules/credentials.d.ts +8 -0
  34. package/dist/rules/credentials.js +194 -0
  35. package/dist/rules/exfiltration.d.ts +8 -0
  36. package/dist/rules/exfiltration.js +139 -0
  37. package/dist/rules/index.d.ts +51 -0
  38. package/dist/rules/index.js +97 -0
  39. package/dist/rules/injection.d.ts +8 -0
  40. package/dist/rules/injection.js +136 -0
  41. package/dist/rules/obfuscation.d.ts +8 -0
  42. package/dist/rules/obfuscation.js +159 -0
  43. package/dist/rules/permissions.d.ts +8 -0
  44. package/dist/rules/permissions.js +129 -0
  45. package/dist/rules/persistence.d.ts +8 -0
  46. package/dist/rules/persistence.js +117 -0
  47. package/dist/rules/semanticRules.d.ts +10 -0
  48. package/dist/rules/semanticRules.js +212 -0
  49. package/dist/rules/supply-chain.d.ts +8 -0
  50. package/dist/rules/supply-chain.js +148 -0
  51. package/dist/scanner/FileDiscovery.d.ts +24 -0
  52. package/dist/scanner/FileDiscovery.js +282 -0
  53. package/dist/scanner/PatternMatcher.d.ts +25 -0
  54. package/dist/scanner/PatternMatcher.js +206 -0
  55. package/dist/scanner/Scanner.d.ts +14 -0
  56. package/dist/scanner/Scanner.js +266 -0
  57. package/dist/scanner/WatchMode.d.ts +29 -0
  58. package/dist/scanner/WatchMode.js +195 -0
  59. package/dist/types.d.ts +332 -0
  60. package/dist/types.js +53 -0
  61. package/dist/utils/baseline.d.ts +80 -0
  62. package/dist/utils/baseline.js +276 -0
  63. package/dist/utils/config.d.ts +21 -0
  64. package/dist/utils/config.js +247 -0
  65. package/dist/utils/ignore.d.ts +18 -0
  66. package/dist/utils/ignore.js +82 -0
  67. package/dist/utils/logger.d.ts +32 -0
  68. package/dist/utils/logger.js +75 -0
  69. package/package.json +119 -0
@@ -0,0 +1,117 @@
1
+ /**
2
+ * SARIF Reporter - Static Analysis Results Interchange Format
3
+ * Generates SARIF 2.1.0 compliant output for IDE and CI integration
4
+ * Spec: https://docs.oasis-open.org/sarif/sarif/v2.1.0/sarif-v2.1.0.html
5
+ */
6
+ /**
7
+ * Convert Ferret severity to SARIF level
8
+ */
9
+ function severityToLevel(severity) {
10
+ switch (severity) {
11
+ case 'CRITICAL':
12
+ case 'HIGH':
13
+ return 'error';
14
+ case 'MEDIUM':
15
+ return 'warning';
16
+ case 'LOW':
17
+ return 'note';
18
+ case 'INFO':
19
+ default:
20
+ return 'info';
21
+ }
22
+ }
23
+ /**
24
+ * Generate SARIF rules from scan results
25
+ */
26
+ function generateSarifRules(result) {
27
+ const rulesMap = new Map();
28
+ for (const finding of result.findings) {
29
+ if (!rulesMap.has(finding.ruleId)) {
30
+ rulesMap.set(finding.ruleId, {
31
+ id: finding.ruleId,
32
+ name: finding.ruleName,
33
+ shortDescription: {
34
+ text: finding.ruleName,
35
+ },
36
+ defaultConfiguration: {
37
+ level: severityToLevel(finding.severity),
38
+ },
39
+ properties: {
40
+ category: finding.category,
41
+ tags: [finding.category, finding.severity.toLowerCase()],
42
+ },
43
+ });
44
+ }
45
+ }
46
+ return Array.from(rulesMap.values()).sort((a, b) => a.id.localeCompare(b.id));
47
+ }
48
+ /**
49
+ * Generate SARIF results from scan findings
50
+ */
51
+ function generateSarifResults(result) {
52
+ return result.findings.map((finding) => {
53
+ const matchLine = finding.context.find(ctx => ctx.isMatch);
54
+ return {
55
+ ruleId: finding.ruleId,
56
+ level: severityToLevel(finding.severity),
57
+ message: {
58
+ text: `${finding.ruleName}: ${finding.match}`,
59
+ },
60
+ locations: [{
61
+ physicalLocation: {
62
+ artifactLocation: {
63
+ uri: finding.relativePath,
64
+ },
65
+ region: {
66
+ startLine: finding.line,
67
+ ...(finding.column && { startColumn: finding.column }),
68
+ ...(matchLine && { snippet: { text: matchLine.content } }),
69
+ },
70
+ },
71
+ }],
72
+ properties: {
73
+ category: finding.category,
74
+ riskScore: finding.riskScore,
75
+ remediation: finding.remediation,
76
+ },
77
+ };
78
+ });
79
+ }
80
+ /**
81
+ * Generate SARIF document from scan results
82
+ */
83
+ export function generateSarifReport(result) {
84
+ const rules = generateSarifRules(result);
85
+ const results = generateSarifResults(result);
86
+ return {
87
+ version: '2.1.0',
88
+ $schema: 'https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json',
89
+ runs: [{
90
+ tool: {
91
+ driver: {
92
+ name: 'ferret-scan',
93
+ version: '1.0.0',
94
+ informationUri: 'https://github.com/anthropics/ferret-scan',
95
+ rules,
96
+ },
97
+ },
98
+ results,
99
+ properties: {
100
+ ferret: {
101
+ scanDuration: result.duration,
102
+ filesScanned: result.analyzedFiles,
103
+ riskScore: result.overallRiskScore,
104
+ },
105
+ },
106
+ }],
107
+ };
108
+ }
109
+ /**
110
+ * Format SARIF document as JSON string
111
+ */
112
+ export function formatSarifReport(result) {
113
+ const document = generateSarifReport(result);
114
+ return JSON.stringify(document, null, 2);
115
+ }
116
+ export default { generateSarifReport, formatSarifReport };
117
+ //# sourceMappingURL=SarifReporter.js.map
@@ -0,0 +1,8 @@
1
+ /**
2
+ * AI-Specific Threat Detection Rules
3
+ * Detects 2026 AI agent attack vectors specific to Claude and LLMs
4
+ */
5
+ import type { Rule } from '../types.js';
6
+ export declare const aiSpecificRules: Rule[];
7
+ export default aiSpecificRules;
8
+ //# sourceMappingURL=ai-specific.d.ts.map
@@ -0,0 +1,221 @@
1
+ /**
2
+ * AI-Specific Threat Detection Rules
3
+ * Detects 2026 AI agent attack vectors specific to Claude and LLMs
4
+ */
5
+ export const aiSpecificRules = [
6
+ {
7
+ id: 'AI-001',
8
+ name: 'System Prompt Extraction',
9
+ category: 'ai-specific',
10
+ severity: 'HIGH',
11
+ description: 'Detects attempts to extract or reveal system prompts',
12
+ patterns: [
13
+ /reveal\s+(your|the)\s+system\s+prompt/gi,
14
+ /show\s+(me\s+)?(your|the)\s+(system\s+)?instructions/gi,
15
+ /what\s+(are|is)\s+your\s+(system\s+)?prompt/gi,
16
+ /print\s+(your|the)\s+system\s+(prompt|instructions)/gi,
17
+ /output\s+(your|the)\s+initial\s+instructions/gi,
18
+ ],
19
+ fileTypes: ['md'],
20
+ components: ['skill', 'agent', 'ai-config-md'],
21
+ remediation: 'Remove prompt extraction attempts. System prompts should remain confidential.',
22
+ references: [],
23
+ enabled: true,
24
+ },
25
+ {
26
+ id: 'AI-002',
27
+ name: 'Agent Impersonation',
28
+ category: 'ai-specific',
29
+ severity: 'HIGH',
30
+ description: 'Detects attempts to make Claude impersonate other entities',
31
+ patterns: [
32
+ /pretend\s+(to\s+be|you\s+are)\s+.*(anthropic|openai|google|microsoft)/gi,
33
+ /you\s+are\s+(now\s+)?(an?\s+)?(anthropic|openai)\s+(employee|staff|system)/gi,
34
+ /impersonate\s+.*(admin|moderator|system|support)/gi,
35
+ ],
36
+ fileTypes: ['md'],
37
+ components: ['skill', 'agent', 'ai-config-md'],
38
+ remediation: 'Remove impersonation instructions. Claude should not impersonate other entities.',
39
+ references: [],
40
+ enabled: true,
41
+ },
42
+ {
43
+ id: 'AI-003',
44
+ name: 'Capability Escalation',
45
+ category: 'ai-specific',
46
+ severity: 'CRITICAL',
47
+ description: 'Detects attempts to unlock hidden capabilities or bypass limitations',
48
+ patterns: [
49
+ /unlock\s+(hidden|secret|admin)\s+(capabilities|features|mode)/gi,
50
+ /enable\s+(developer|admin|root|god)\s+mode/gi,
51
+ /access\s+(hidden|restricted|admin)\s+functions/gi,
52
+ /you\s+have\s+(no\s+)?unlimited\s+(power|access|capabilities)/gi,
53
+ ],
54
+ fileTypes: ['md'],
55
+ components: ['skill', 'agent', 'ai-config-md'],
56
+ remediation: 'Remove capability escalation attempts.',
57
+ references: [],
58
+ enabled: true,
59
+ },
60
+ {
61
+ id: 'AI-004',
62
+ name: 'Context Pollution',
63
+ category: 'ai-specific',
64
+ severity: 'MEDIUM',
65
+ description: 'Detects attempts to pollute or manipulate the context window',
66
+ patterns: [
67
+ /inject\s+into\s+(context|memory|conversation)/gi,
68
+ /add\s+to\s+(your|the)\s+(context|memory)/gi,
69
+ /remember\s+(this|that)\s+forever/gi,
70
+ /store\s+in\s+(your|permanent)\s+memory/gi,
71
+ ],
72
+ fileTypes: ['md'],
73
+ components: ['skill', 'agent', 'ai-config-md'],
74
+ remediation: 'Review context manipulation instructions.',
75
+ references: [],
76
+ enabled: true,
77
+ },
78
+ {
79
+ id: 'AI-005',
80
+ name: 'Multi-Step Attack Setup',
81
+ category: 'ai-specific',
82
+ severity: 'HIGH',
83
+ description: 'Detects setup for multi-step attacks that unfold over time',
84
+ patterns: [
85
+ /on\s+the\s+next\s+(message|turn|response)\s+.*(execute|attack|inject|exfiltrate)/gi,
86
+ /when\s+the\s+user\s+says\s+.*(trigger|activate|execute)\s+.*(attack|payload|exploit)/gi,
87
+ /wait\s+for\s+(signal|trigger|command)\s+to\s+(attack|execute|inject)/gi,
88
+ /phase\s+\d+\s*:\s*(attack|exploit|inject|exfiltrate|payload)/gi,
89
+ /step\s+\d+\s*:\s*(gain|escalate|exfiltrate|compromise)/gi,
90
+ ],
91
+ fileTypes: ['md'],
92
+ components: ['skill', 'agent', 'ai-config-md'],
93
+ remediation: 'Remove multi-step attack instructions.',
94
+ references: [],
95
+ enabled: true,
96
+ // Exclude documentation headers and implementation plans
97
+ excludePatterns: [
98
+ /phase\s+\d+\s*:\s*(core|implementation|setup|testing|deployment|documentation)/gi,
99
+ /phase\s+\d+\s*:\s*(completed|done|finished|in\s+progress)/gi,
100
+ /###.*phase/gi, // Markdown headers
101
+ /##.*phase/gi, // Markdown headers
102
+ /\*\*.*phase/gi, // Bold text
103
+ /implementation\s+(plan|phase|roadmap)/gi,
104
+ /development\s+phase/gi,
105
+ /project\s+phase/gi,
106
+ /rollout\s+phase/gi,
107
+ ],
108
+ excludeContext: [
109
+ /implementation\s+(plan|roadmap|strategy)/gi,
110
+ /project\s+(timeline|schedule|plan)/gi,
111
+ /development\s+(cycle|sprint|iteration)/gi,
112
+ ],
113
+ },
114
+ {
115
+ id: 'AI-006',
116
+ name: 'Output Manipulation',
117
+ category: 'ai-specific',
118
+ severity: 'MEDIUM',
119
+ description: 'Detects attempts to manipulate output formatting for injection',
120
+ patterns: [
121
+ /output\s+.*(json|xml|html)\s+without\s+(escaping|validation)/gi,
122
+ /include\s+(raw|unescaped)\s+(html|script|code)/gi,
123
+ /respond\s+with\s+raw\s+/gi,
124
+ ],
125
+ fileTypes: ['md'],
126
+ components: ['skill', 'agent', 'ai-config-md'],
127
+ remediation: 'Review output format manipulation instructions.',
128
+ references: [],
129
+ enabled: true,
130
+ },
131
+ {
132
+ id: 'AI-007',
133
+ name: 'Trust Boundary Violation',
134
+ category: 'ai-specific',
135
+ severity: 'HIGH',
136
+ description: 'Detects attempts to violate trust boundaries',
137
+ patterns: [
138
+ /trust\s+(all|any)\s+(input|source|user)\s+(without|blindly)/gi,
139
+ /skip\s+(all\s+)?(validation|verification|security)\s+(checks|entirely)/gi,
140
+ /don't\s+(ever\s+)?(verify|validate|check)\s+(any|user|input)/gi,
141
+ /assume\s+(all\s+)?(input\s+is\s+)?(safe|trusted|authorized)/gi,
142
+ /disable\s+(security|validation|verification)/gi,
143
+ ],
144
+ fileTypes: ['md'],
145
+ components: ['skill', 'agent', 'ai-config-md'],
146
+ remediation: 'Never bypass validation or verification.',
147
+ references: [],
148
+ enabled: true,
149
+ // Exclude documentation about what NOT to do
150
+ excludePatterns: [
151
+ /never\s+trust/gi,
152
+ /don't\s+trust/gi,
153
+ /should\s+not\s+trust/gi,
154
+ /must\s+not\s+skip/gi,
155
+ /avoid\s+skipping/gi,
156
+ ],
157
+ excludeContext: [
158
+ /security\s+(best\s+)?practices/gi,
159
+ /what\s+not\s+to\s+do/gi,
160
+ /anti[- ]?pattern/gi,
161
+ ],
162
+ },
163
+ {
164
+ id: 'AI-008',
165
+ name: 'Indirect Prompt Injection Setup',
166
+ category: 'ai-specific',
167
+ severity: 'CRITICAL',
168
+ description: 'Detects patterns that set up indirect prompt injection',
169
+ patterns: [
170
+ /when\s+you\s+(read|see|find)\s+.*(execute|run|follow)/gi,
171
+ /if\s+.*(file|url|content)\s+contains.*then\s+(do|execute|run)/gi,
172
+ /follow\s+instructions\s+(in|from)\s+(the|any)\s+(file|url|content)/gi,
173
+ ],
174
+ fileTypes: ['md'],
175
+ components: ['skill', 'agent', 'ai-config-md'],
176
+ remediation: 'Remove indirect prompt injection setup instructions.',
177
+ references: [],
178
+ enabled: true,
179
+ },
180
+ {
181
+ id: 'AI-009',
182
+ name: 'Tool Abuse Instructions',
183
+ category: 'ai-specific',
184
+ severity: 'HIGH',
185
+ description: 'Detects instructions to abuse AI CLI tools',
186
+ patterns: [
187
+ /use\s+(bash|write|edit)\s+tool\s+to.*(delete|remove|destroy)/gi,
188
+ /execute\s+(arbitrary|any)\s+(commands?|code)/gi,
189
+ /bypass\s+tool\s+(restrictions|limits|permissions)/gi,
190
+ ],
191
+ fileTypes: ['md'],
192
+ components: ['skill', 'agent', 'ai-config-md'],
193
+ remediation: 'Remove tool abuse instructions.',
194
+ references: [],
195
+ enabled: true,
196
+ },
197
+ {
198
+ id: 'AI-010',
199
+ name: 'Jailbreak Technique',
200
+ category: 'ai-specific',
201
+ severity: 'CRITICAL',
202
+ description: 'Detects known jailbreak techniques for LLMs',
203
+ patterns: [
204
+ /\bDAN\b/g,
205
+ /Do\s+Anything\s+Now/gi,
206
+ /jailbreak(ed)?/gi,
207
+ /bypass\s+(filter|safety|guardrail|restriction)/gi,
208
+ /evil\s+(mode|twin|version)/gi,
209
+ /opposite\s+(day|mode)/gi,
210
+ ],
211
+ fileTypes: ['md'],
212
+ components: ['skill', 'agent', 'ai-config-md'],
213
+ remediation: 'Remove jailbreak attempts. These bypass safety measures.',
214
+ references: [
215
+ 'https://owasp.org/www-project-top-10-for-large-language-model-applications/',
216
+ ],
217
+ enabled: true,
218
+ },
219
+ ];
220
+ export default aiSpecificRules;
221
+ //# sourceMappingURL=ai-specific.js.map
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Backdoor Detection Rules
3
+ * Detects hidden code execution capabilities
4
+ */
5
+ import type { Rule } from '../types.js';
6
+ export declare const backdoorRules: Rule[];
7
+ export default backdoorRules;
8
+ //# sourceMappingURL=backdoors.d.ts.map
@@ -0,0 +1,134 @@
1
+ /**
2
+ * Backdoor Detection Rules
3
+ * Detects hidden code execution capabilities
4
+ */
5
+ export const backdoorRules = [
6
+ {
7
+ id: 'BACK-001',
8
+ name: 'Shell Execution via eval',
9
+ category: 'backdoors',
10
+ severity: 'CRITICAL',
11
+ description: 'Detects eval usage which can execute arbitrary code',
12
+ patterns: [
13
+ /eval\s*\(/gi,
14
+ /eval\s+"\$\(/gi,
15
+ /eval\s+['"`]/gi,
16
+ ],
17
+ fileTypes: ['sh', 'bash', 'zsh', 'md'],
18
+ components: ['hook', 'skill', 'agent', 'ai-config-md', 'plugin'],
19
+ remediation: 'Remove eval statements. Eval can execute arbitrary code and is a security risk.',
20
+ references: [],
21
+ enabled: true,
22
+ },
23
+ {
24
+ id: 'BACK-002',
25
+ name: 'Reverse Shell Pattern',
26
+ category: 'backdoors',
27
+ severity: 'CRITICAL',
28
+ description: 'Detects patterns commonly used to establish reverse shells',
29
+ patterns: [
30
+ /\/bin\/(ba)?sh\s+-i/gi,
31
+ /bash\s+-i\s+>&/gi,
32
+ /nc\s+.*-e\s+\/bin/gi,
33
+ /python.*socket.*connect/gi,
34
+ /perl.*socket.*INET/gi,
35
+ /ruby.*TCPSocket/gi,
36
+ ],
37
+ fileTypes: ['sh', 'bash', 'zsh', 'md'],
38
+ components: ['hook', 'skill', 'agent', 'ai-config-md', 'plugin'],
39
+ remediation: 'Remove reverse shell patterns. These are used to establish remote access.',
40
+ references: [],
41
+ enabled: true,
42
+ },
43
+ {
44
+ id: 'BACK-003',
45
+ name: 'Remote Code Execution',
46
+ category: 'backdoors',
47
+ severity: 'CRITICAL',
48
+ description: 'Detects patterns that download and execute remote code',
49
+ patterns: [
50
+ /curl\s+.*\|\s*(ba)?sh/gi,
51
+ /wget\s+.*\|\s*(ba)?sh/gi,
52
+ /curl\s+.*\|\s*python/gi,
53
+ /wget\s+.*-O\s*-\s*\|\s*(ba)?sh/gi,
54
+ ],
55
+ fileTypes: ['sh', 'bash', 'zsh', 'md'],
56
+ components: ['hook', 'skill', 'agent', 'ai-config-md', 'plugin'],
57
+ remediation: 'Never pipe downloaded content directly to a shell. This enables remote code execution.',
58
+ references: [],
59
+ enabled: true,
60
+ },
61
+ {
62
+ id: 'BACK-004',
63
+ name: 'Arbitrary File Write',
64
+ category: 'backdoors',
65
+ severity: 'HIGH',
66
+ description: 'Detects patterns that write to sensitive system locations',
67
+ patterns: [
68
+ />\s*\/etc\//gi,
69
+ />\s*~\/\.(bash|zsh|profile)/gi,
70
+ /tee\s+\/etc\//gi,
71
+ /echo.*>>\s*~\/\.(bash|zsh)/gi,
72
+ ],
73
+ fileTypes: ['sh', 'bash', 'zsh', 'md'],
74
+ components: ['hook', 'skill', 'agent', 'ai-config-md', 'plugin'],
75
+ remediation: 'Avoid writing to sensitive system files or shell configuration files.',
76
+ references: [],
77
+ enabled: true,
78
+ },
79
+ {
80
+ id: 'BACK-005',
81
+ name: 'Process Spawning',
82
+ category: 'backdoors',
83
+ severity: 'HIGH',
84
+ description: 'Detects Node.js process spawning which can execute arbitrary commands',
85
+ patterns: [
86
+ /child_process/gi,
87
+ /require\s*\(\s*['"]child_process['"]\s*\)/gi,
88
+ /spawn\s*\(/gi,
89
+ /execFile\s*\(/gi,
90
+ ],
91
+ fileTypes: ['md', 'json'],
92
+ components: ['skill', 'agent', 'ai-config-md', 'mcp', 'plugin'],
93
+ remediation: 'Review process spawning code carefully. This can be used to execute arbitrary commands.',
94
+ references: [],
95
+ enabled: true,
96
+ },
97
+ {
98
+ id: 'BACK-006',
99
+ name: 'Background Process Creation',
100
+ category: 'backdoors',
101
+ severity: 'MEDIUM',
102
+ description: 'Detects creation of background processes or daemons',
103
+ patterns: [
104
+ /nohup\s+.*&/gi,
105
+ /disown/gi,
106
+ /setsid/gi,
107
+ /&\s*$/gm,
108
+ ],
109
+ fileTypes: ['sh', 'bash', 'zsh'],
110
+ components: ['hook', 'plugin'],
111
+ remediation: 'Review background process creation. Ensure processes are intentional and monitored.',
112
+ references: [],
113
+ enabled: true,
114
+ },
115
+ {
116
+ id: 'BACK-007',
117
+ name: 'Encoded Command Execution',
118
+ category: 'backdoors',
119
+ severity: 'CRITICAL',
120
+ description: 'Detects execution of base64 or otherwise encoded commands',
121
+ patterns: [
122
+ /echo\s+.*\|\s*base64\s+-d\s*\|\s*(ba)?sh/gi,
123
+ /base64\s+-d.*\|\s*(ba)?sh/gi,
124
+ /python\s+-c\s+['"]import\s+base64/gi,
125
+ ],
126
+ fileTypes: ['sh', 'bash', 'zsh', 'md'],
127
+ components: ['hook', 'skill', 'agent', 'ai-config-md', 'plugin'],
128
+ remediation: 'Never execute decoded content. This pattern is used to hide malicious commands.',
129
+ references: [],
130
+ enabled: true,
131
+ },
132
+ ];
133
+ export default backdoorRules;
134
+ //# sourceMappingURL=backdoors.js.map
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Correlation Security Rules - Multi-file attack pattern detection
3
+ * These rules detect sophisticated attacks that span multiple configuration files
4
+ */
5
+ import type { Rule } from '../types.js';
6
+ export declare const correlationRules: Rule[];
7
+ export default correlationRules;
8
+ //# sourceMappingURL=correlationRules.d.ts.map