erosolar-cli 1.7.333 → 1.7.334
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 +148 -24
- package/dist/alpha-zero/agentWrapper.d.ts +84 -0
- package/dist/alpha-zero/agentWrapper.d.ts.map +1 -0
- package/dist/alpha-zero/agentWrapper.js +171 -0
- package/dist/alpha-zero/agentWrapper.js.map +1 -0
- package/dist/alpha-zero/codeEvaluator.d.ts +25 -0
- package/dist/alpha-zero/codeEvaluator.d.ts.map +1 -0
- package/dist/alpha-zero/codeEvaluator.js +273 -0
- package/dist/alpha-zero/codeEvaluator.js.map +1 -0
- package/dist/alpha-zero/competitiveRunner.d.ts +66 -0
- package/dist/alpha-zero/competitiveRunner.d.ts.map +1 -0
- package/dist/alpha-zero/competitiveRunner.js +224 -0
- package/dist/alpha-zero/competitiveRunner.js.map +1 -0
- package/dist/alpha-zero/index.d.ts +67 -0
- package/dist/alpha-zero/index.d.ts.map +1 -0
- package/dist/alpha-zero/index.js +99 -0
- package/dist/alpha-zero/index.js.map +1 -0
- package/dist/alpha-zero/introspection.d.ts +128 -0
- package/dist/alpha-zero/introspection.d.ts.map +1 -0
- package/dist/alpha-zero/introspection.js +300 -0
- package/dist/alpha-zero/introspection.js.map +1 -0
- package/dist/alpha-zero/metricsTracker.d.ts +71 -0
- package/dist/alpha-zero/metricsTracker.d.ts.map +1 -0
- package/dist/{core → alpha-zero}/metricsTracker.js +5 -2
- package/dist/alpha-zero/metricsTracker.js.map +1 -0
- package/dist/alpha-zero/security/core.d.ts +125 -0
- package/dist/alpha-zero/security/core.d.ts.map +1 -0
- package/dist/alpha-zero/security/core.js +271 -0
- package/dist/alpha-zero/security/core.js.map +1 -0
- package/dist/alpha-zero/security/google.d.ts +125 -0
- package/dist/alpha-zero/security/google.d.ts.map +1 -0
- package/dist/alpha-zero/security/google.js +311 -0
- package/dist/alpha-zero/security/google.js.map +1 -0
- package/dist/alpha-zero/security/googleLoader.d.ts +17 -0
- package/dist/alpha-zero/security/googleLoader.d.ts.map +1 -0
- package/dist/alpha-zero/security/googleLoader.js +41 -0
- package/dist/alpha-zero/security/googleLoader.js.map +1 -0
- package/dist/alpha-zero/security/index.d.ts +29 -0
- package/dist/alpha-zero/security/index.d.ts.map +1 -0
- package/dist/alpha-zero/security/index.js +32 -0
- package/dist/alpha-zero/security/index.js.map +1 -0
- package/dist/alpha-zero/security/simulation.d.ts +124 -0
- package/dist/alpha-zero/security/simulation.d.ts.map +1 -0
- package/dist/alpha-zero/security/simulation.js +277 -0
- package/dist/alpha-zero/security/simulation.js.map +1 -0
- package/dist/alpha-zero/selfModification.d.ts +109 -0
- package/dist/alpha-zero/selfModification.d.ts.map +1 -0
- package/dist/alpha-zero/selfModification.js +233 -0
- package/dist/alpha-zero/selfModification.js.map +1 -0
- package/dist/alpha-zero/types.d.ts +170 -0
- package/dist/alpha-zero/types.d.ts.map +1 -0
- package/dist/alpha-zero/types.js +31 -0
- package/dist/alpha-zero/types.js.map +1 -0
- package/dist/bin/erosolar.js +21 -5
- package/dist/bin/erosolar.js.map +1 -1
- package/dist/capabilities/agentSpawningCapability.d.ts.map +1 -1
- package/dist/capabilities/agentSpawningCapability.js +31 -56
- package/dist/capabilities/agentSpawningCapability.js.map +1 -1
- package/dist/capabilities/securityTestingCapability.d.ts +13 -0
- package/dist/capabilities/securityTestingCapability.d.ts.map +1 -0
- package/dist/capabilities/securityTestingCapability.js +25 -0
- package/dist/capabilities/securityTestingCapability.js.map +1 -0
- package/dist/contracts/agent-schemas.json +15 -0
- package/dist/contracts/tools.schema.json +9 -0
- package/dist/core/agent.d.ts +2 -2
- package/dist/core/agent.d.ts.map +1 -1
- package/dist/core/agent.js.map +1 -1
- package/dist/core/aiFlowOptimizer.d.ts +26 -0
- package/dist/core/aiFlowOptimizer.d.ts.map +1 -0
- package/dist/core/aiFlowOptimizer.js +31 -0
- package/dist/core/aiFlowOptimizer.js.map +1 -0
- package/dist/core/aiOptimizationEngine.d.ts +158 -0
- package/dist/core/aiOptimizationEngine.d.ts.map +1 -0
- package/dist/core/aiOptimizationEngine.js +428 -0
- package/dist/core/aiOptimizationEngine.js.map +1 -0
- package/dist/core/aiOptimizationIntegration.d.ts +93 -0
- package/dist/core/aiOptimizationIntegration.d.ts.map +1 -0
- package/dist/core/aiOptimizationIntegration.js +250 -0
- package/dist/core/aiOptimizationIntegration.js.map +1 -0
- package/dist/core/customCommands.d.ts +0 -1
- package/dist/core/customCommands.d.ts.map +1 -1
- package/dist/core/customCommands.js +0 -3
- package/dist/core/customCommands.js.map +1 -1
- package/dist/core/enhancedErrorRecovery.d.ts +100 -0
- package/dist/core/enhancedErrorRecovery.d.ts.map +1 -0
- package/dist/core/enhancedErrorRecovery.js +345 -0
- package/dist/core/enhancedErrorRecovery.js.map +1 -0
- package/dist/core/hooksSystem.d.ts +65 -0
- package/dist/core/hooksSystem.d.ts.map +1 -0
- package/dist/core/hooksSystem.js +273 -0
- package/dist/core/hooksSystem.js.map +1 -0
- package/dist/core/memorySystem.d.ts +48 -0
- package/dist/core/memorySystem.d.ts.map +1 -0
- package/dist/core/memorySystem.js +271 -0
- package/dist/core/memorySystem.js.map +1 -0
- package/dist/core/toolPreconditions.d.ts.map +1 -1
- package/dist/core/toolPreconditions.js +14 -0
- package/dist/core/toolPreconditions.js.map +1 -1
- package/dist/core/toolRuntime.d.ts +1 -22
- package/dist/core/toolRuntime.d.ts.map +1 -1
- package/dist/core/toolRuntime.js +5 -0
- package/dist/core/toolRuntime.js.map +1 -1
- package/dist/core/toolValidation.d.ts.map +1 -1
- package/dist/core/toolValidation.js +3 -14
- package/dist/core/toolValidation.js.map +1 -1
- package/dist/core/unified/errors.d.ts +189 -0
- package/dist/core/unified/errors.d.ts.map +1 -0
- package/dist/core/unified/errors.js +497 -0
- package/dist/core/unified/errors.js.map +1 -0
- package/dist/core/unified/index.d.ts +19 -0
- package/dist/core/unified/index.d.ts.map +1 -0
- package/dist/core/unified/index.js +68 -0
- package/dist/core/unified/index.js.map +1 -0
- package/dist/core/unified/schema.d.ts +101 -0
- package/dist/core/unified/schema.d.ts.map +1 -0
- package/dist/core/unified/schema.js +350 -0
- package/dist/core/unified/schema.js.map +1 -0
- package/dist/core/unified/toolRuntime.d.ts +179 -0
- package/dist/core/unified/toolRuntime.d.ts.map +1 -0
- package/dist/core/unified/toolRuntime.js +517 -0
- package/dist/core/unified/toolRuntime.js.map +1 -0
- package/dist/core/unified/tools.d.ts +127 -0
- package/dist/core/unified/tools.d.ts.map +1 -0
- package/dist/core/unified/tools.js +1333 -0
- package/dist/core/unified/tools.js.map +1 -0
- package/dist/core/unified/types.d.ts +352 -0
- package/dist/core/unified/types.d.ts.map +1 -0
- package/dist/core/unified/types.js +12 -0
- package/dist/core/unified/types.js.map +1 -0
- package/dist/core/unified/version.d.ts +209 -0
- package/dist/core/unified/version.d.ts.map +1 -0
- package/dist/core/unified/version.js +454 -0
- package/dist/core/unified/version.js.map +1 -0
- package/dist/core/validationRunner.d.ts +3 -1
- package/dist/core/validationRunner.d.ts.map +1 -1
- package/dist/core/validationRunner.js.map +1 -1
- package/dist/headless/headlessApp.d.ts.map +1 -1
- package/dist/headless/headlessApp.js +0 -21
- package/dist/headless/headlessApp.js.map +1 -1
- package/dist/mcp/sseClient.d.ts.map +1 -1
- package/dist/mcp/sseClient.js +18 -9
- package/dist/mcp/sseClient.js.map +1 -1
- package/dist/plugins/tools/build/buildPlugin.d.ts +6 -0
- package/dist/plugins/tools/build/buildPlugin.d.ts.map +1 -1
- package/dist/plugins/tools/build/buildPlugin.js +10 -4
- package/dist/plugins/tools/build/buildPlugin.js.map +1 -1
- package/dist/plugins/tools/nodeDefaults.d.ts.map +1 -1
- package/dist/plugins/tools/nodeDefaults.js +2 -0
- package/dist/plugins/tools/nodeDefaults.js.map +1 -1
- package/dist/plugins/tools/security/securityPlugin.d.ts +3 -0
- package/dist/plugins/tools/security/securityPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/security/securityPlugin.js +12 -0
- package/dist/plugins/tools/security/securityPlugin.js.map +1 -0
- package/dist/runtime/agentSession.d.ts +2 -2
- package/dist/runtime/agentSession.d.ts.map +1 -1
- package/dist/runtime/agentSession.js +2 -2
- package/dist/runtime/agentSession.js.map +1 -1
- package/dist/security/active-stack-security.d.ts +112 -0
- package/dist/security/active-stack-security.d.ts.map +1 -0
- package/dist/security/active-stack-security.js +296 -0
- package/dist/security/active-stack-security.js.map +1 -0
- package/dist/security/advanced-persistence-research.d.ts +92 -0
- package/dist/security/advanced-persistence-research.d.ts.map +1 -0
- package/dist/security/advanced-persistence-research.js +195 -0
- package/dist/security/advanced-persistence-research.js.map +1 -0
- package/dist/security/advanced-targeting.d.ts +119 -0
- package/dist/security/advanced-targeting.d.ts.map +1 -0
- package/dist/security/advanced-targeting.js +233 -0
- package/dist/security/advanced-targeting.js.map +1 -0
- package/dist/security/assessment/vulnerabilityAssessment.d.ts +104 -0
- package/dist/security/assessment/vulnerabilityAssessment.d.ts.map +1 -0
- package/dist/security/assessment/vulnerabilityAssessment.js +315 -0
- package/dist/security/assessment/vulnerabilityAssessment.js.map +1 -0
- package/dist/security/authorization/securityAuthorization.d.ts +88 -0
- package/dist/security/authorization/securityAuthorization.d.ts.map +1 -0
- package/dist/security/authorization/securityAuthorization.js +172 -0
- package/dist/security/authorization/securityAuthorization.js.map +1 -0
- package/dist/security/comprehensive-targeting.d.ts +85 -0
- package/dist/security/comprehensive-targeting.d.ts.map +1 -0
- package/dist/security/comprehensive-targeting.js +438 -0
- package/dist/security/comprehensive-targeting.js.map +1 -0
- package/dist/security/global-security-integration.d.ts +91 -0
- package/dist/security/global-security-integration.d.ts.map +1 -0
- package/dist/security/global-security-integration.js +218 -0
- package/dist/security/global-security-integration.js.map +1 -0
- package/dist/security/index.d.ts +38 -0
- package/dist/security/index.d.ts.map +1 -0
- package/dist/security/index.js +47 -0
- package/dist/security/index.js.map +1 -0
- package/dist/security/persistence-analyzer.d.ts +56 -0
- package/dist/security/persistence-analyzer.d.ts.map +1 -0
- package/dist/security/persistence-analyzer.js +187 -0
- package/dist/security/persistence-analyzer.js.map +1 -0
- package/dist/security/persistence-cli.d.ts +36 -0
- package/dist/security/persistence-cli.d.ts.map +1 -0
- package/dist/security/persistence-cli.js +160 -0
- package/dist/security/persistence-cli.js.map +1 -0
- package/dist/security/persistence-research.d.ts +92 -0
- package/dist/security/persistence-research.d.ts.map +1 -0
- package/dist/security/persistence-research.js +364 -0
- package/dist/security/persistence-research.js.map +1 -0
- package/dist/security/research/persistenceResearch.d.ts +97 -0
- package/dist/security/research/persistenceResearch.d.ts.map +1 -0
- package/dist/security/research/persistenceResearch.js +282 -0
- package/dist/security/research/persistenceResearch.js.map +1 -0
- package/dist/security/security-integration.d.ts +74 -0
- package/dist/security/security-integration.d.ts.map +1 -0
- package/dist/security/security-integration.js +137 -0
- package/dist/security/security-integration.js.map +1 -0
- package/dist/security/security-testing-framework.d.ts +112 -0
- package/dist/security/security-testing-framework.d.ts.map +1 -0
- package/dist/security/security-testing-framework.js +364 -0
- package/dist/security/security-testing-framework.js.map +1 -0
- package/dist/security/simulation/attackSimulation.d.ts +93 -0
- package/dist/security/simulation/attackSimulation.d.ts.map +1 -0
- package/dist/security/simulation/attackSimulation.js +341 -0
- package/dist/security/simulation/attackSimulation.js.map +1 -0
- package/dist/security/strategic-operations.d.ts +100 -0
- package/dist/security/strategic-operations.d.ts.map +1 -0
- package/dist/security/strategic-operations.js +276 -0
- package/dist/security/strategic-operations.js.map +1 -0
- package/dist/security/tool-security-wrapper.d.ts +58 -0
- package/dist/security/tool-security-wrapper.d.ts.map +1 -0
- package/dist/security/tool-security-wrapper.js +156 -0
- package/dist/security/tool-security-wrapper.js.map +1 -0
- package/dist/shell/claudeCodeStreamHandler.d.ts +145 -0
- package/dist/shell/claudeCodeStreamHandler.d.ts.map +1 -0
- package/dist/shell/claudeCodeStreamHandler.js +322 -0
- package/dist/shell/claudeCodeStreamHandler.js.map +1 -0
- package/dist/shell/inputQueueManager.d.ts +144 -0
- package/dist/shell/inputQueueManager.d.ts.map +1 -0
- package/dist/shell/inputQueueManager.js +290 -0
- package/dist/shell/inputQueueManager.js.map +1 -0
- package/dist/shell/interactiveShell.d.ts +7 -16
- package/dist/shell/interactiveShell.d.ts.map +1 -1
- package/dist/shell/interactiveShell.js +166 -235
- package/dist/shell/interactiveShell.js.map +1 -1
- package/dist/shell/metricsTracker.d.ts +60 -0
- package/dist/shell/metricsTracker.d.ts.map +1 -0
- package/dist/shell/metricsTracker.js +119 -0
- package/dist/shell/metricsTracker.js.map +1 -0
- package/dist/shell/shellApp.d.ts +0 -2
- package/dist/shell/shellApp.d.ts.map +1 -1
- package/dist/shell/shellApp.js +9 -40
- package/dist/shell/shellApp.js.map +1 -1
- package/dist/shell/streamingOutputManager.d.ts +115 -0
- package/dist/shell/streamingOutputManager.d.ts.map +1 -0
- package/dist/shell/streamingOutputManager.js +225 -0
- package/dist/shell/streamingOutputManager.js.map +1 -0
- package/dist/shell/systemPrompt.d.ts.map +1 -1
- package/dist/shell/systemPrompt.js +4 -1
- package/dist/shell/systemPrompt.js.map +1 -1
- package/dist/shell/terminalInput.d.ts +118 -149
- package/dist/shell/terminalInput.d.ts.map +1 -1
- package/dist/shell/terminalInput.js +532 -689
- package/dist/shell/terminalInput.js.map +1 -1
- package/dist/shell/terminalInputAdapter.d.ts +21 -79
- package/dist/shell/terminalInputAdapter.d.ts.map +1 -1
- package/dist/shell/terminalInputAdapter.js +30 -99
- package/dist/shell/terminalInputAdapter.js.map +1 -1
- package/dist/subagents/taskRunner.d.ts +1 -7
- package/dist/subagents/taskRunner.d.ts.map +1 -1
- package/dist/subagents/taskRunner.js +47 -180
- package/dist/subagents/taskRunner.js.map +1 -1
- package/dist/tools/securityTools.d.ts +22 -0
- package/dist/tools/securityTools.d.ts.map +1 -0
- package/dist/tools/securityTools.js +448 -0
- package/dist/tools/securityTools.js.map +1 -0
- package/dist/ui/ShellUIAdapter.d.ts.map +1 -1
- package/dist/ui/ShellUIAdapter.js +12 -13
- package/dist/ui/ShellUIAdapter.js.map +1 -1
- package/dist/ui/display.d.ts +45 -24
- package/dist/ui/display.d.ts.map +1 -1
- package/dist/ui/display.js +259 -140
- package/dist/ui/display.js.map +1 -1
- package/dist/ui/persistentPrompt.d.ts +50 -0
- package/dist/ui/persistentPrompt.d.ts.map +1 -0
- package/dist/ui/persistentPrompt.js +92 -0
- package/dist/ui/persistentPrompt.js.map +1 -0
- package/dist/ui/terminalUISchema.d.ts +195 -0
- package/dist/ui/terminalUISchema.d.ts.map +1 -0
- package/dist/ui/terminalUISchema.js +113 -0
- package/dist/ui/terminalUISchema.js.map +1 -0
- package/dist/ui/theme.d.ts.map +1 -1
- package/dist/ui/theme.js +8 -6
- package/dist/ui/theme.js.map +1 -1
- package/dist/ui/toolDisplay.d.ts +158 -0
- package/dist/ui/toolDisplay.d.ts.map +1 -1
- package/dist/ui/toolDisplay.js +348 -0
- package/dist/ui/toolDisplay.js.map +1 -1
- package/dist/ui/unified/layout.d.ts +0 -1
- package/dist/ui/unified/layout.d.ts.map +1 -1
- package/dist/ui/unified/layout.js +25 -15
- package/dist/ui/unified/layout.js.map +1 -1
- package/package.json +4 -4
- package/scripts/deploy-security-capabilities.js +178 -0
- package/dist/core/hooks.d.ts +0 -113
- package/dist/core/hooks.d.ts.map +0 -1
- package/dist/core/hooks.js +0 -267
- package/dist/core/hooks.js.map +0 -1
- package/dist/core/metricsTracker.d.ts +0 -122
- package/dist/core/metricsTracker.d.ts.map +0 -1
- package/dist/core/metricsTracker.js.map +0 -1
- package/dist/core/securityAssessment.d.ts +0 -91
- package/dist/core/securityAssessment.d.ts.map +0 -1
- package/dist/core/securityAssessment.js +0 -580
- package/dist/core/securityAssessment.js.map +0 -1
- package/dist/core/verification.d.ts +0 -137
- package/dist/core/verification.d.ts.map +0 -1
- package/dist/core/verification.js +0 -323
- package/dist/core/verification.js.map +0 -1
- package/dist/subagents/agentConfig.d.ts +0 -27
- package/dist/subagents/agentConfig.d.ts.map +0 -1
- package/dist/subagents/agentConfig.js +0 -89
- package/dist/subagents/agentConfig.js.map +0 -1
- package/dist/subagents/agentRegistry.d.ts +0 -33
- package/dist/subagents/agentRegistry.d.ts.map +0 -1
- package/dist/subagents/agentRegistry.js +0 -162
- package/dist/subagents/agentRegistry.js.map +0 -1
- package/dist/utils/frontmatter.d.ts +0 -10
- package/dist/utils/frontmatter.d.ts.map +0 -1
- package/dist/utils/frontmatter.js +0 -78
- package/dist/utils/frontmatter.js.map +0 -1
|
@@ -0,0 +1,315 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vulnerability Assessment Engine
|
|
3
|
+
*
|
|
4
|
+
* Provides vulnerability scanning and risk assessment capabilities
|
|
5
|
+
* for authorized security research and testing.
|
|
6
|
+
*
|
|
7
|
+
* LEGAL NOTICE:
|
|
8
|
+
* For authorized security research, penetration testing, and red team exercises only.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Vulnerability Assessment Engine
|
|
12
|
+
*/
|
|
13
|
+
export class VulnerabilityAssessmentEngine {
|
|
14
|
+
vulnerabilityDatabase;
|
|
15
|
+
constructor() {
|
|
16
|
+
this.vulnerabilityDatabase = new Map();
|
|
17
|
+
this.initializeVulnerabilityDatabase();
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Scan for vulnerabilities
|
|
21
|
+
*/
|
|
22
|
+
async scanVulnerabilities(request) {
|
|
23
|
+
// In a real implementation, this would perform actual scanning
|
|
24
|
+
// For demonstration, we return simulated results
|
|
25
|
+
const vulnerabilities = this.generateSimulatedVulnerabilities(request);
|
|
26
|
+
const summary = this.calculateVulnerabilitySummary(vulnerabilities);
|
|
27
|
+
return {
|
|
28
|
+
targetType: request.targetType,
|
|
29
|
+
targetUrl: request.targetUrl,
|
|
30
|
+
scanDepth: request.scanDepth,
|
|
31
|
+
scanDate: new Date().toISOString(),
|
|
32
|
+
vulnerabilities,
|
|
33
|
+
summary
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Assess security risks
|
|
38
|
+
*/
|
|
39
|
+
async assessRisk(request) {
|
|
40
|
+
const riskScore = this.calculateRiskScore(request.findings, request.context);
|
|
41
|
+
const riskLevel = this.determineRiskLevel(riskScore);
|
|
42
|
+
const recommendations = this.generateRiskRecommendations(request.findings, riskLevel);
|
|
43
|
+
const priorityActions = this.generatePriorityActions(riskLevel);
|
|
44
|
+
return {
|
|
45
|
+
findings: request.findings,
|
|
46
|
+
context: request.context,
|
|
47
|
+
riskScore,
|
|
48
|
+
riskLevel,
|
|
49
|
+
recommendations,
|
|
50
|
+
priorityActions
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Get vulnerability by ID
|
|
55
|
+
*/
|
|
56
|
+
getVulnerability(vulnerabilityId) {
|
|
57
|
+
return this.vulnerabilityDatabase.get(vulnerabilityId);
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* List all vulnerabilities
|
|
61
|
+
*/
|
|
62
|
+
listVulnerabilities() {
|
|
63
|
+
return Array.from(this.vulnerabilityDatabase.values());
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Generate simulated vulnerabilities for demonstration
|
|
67
|
+
*/
|
|
68
|
+
generateSimulatedVulnerabilities(request) {
|
|
69
|
+
const vulnerabilities = [];
|
|
70
|
+
// Common web application vulnerabilities
|
|
71
|
+
if (request.targetType === 'web_application') {
|
|
72
|
+
vulnerabilities.push({
|
|
73
|
+
id: 'sql-injection',
|
|
74
|
+
name: 'SQL Injection',
|
|
75
|
+
severity: 'high',
|
|
76
|
+
category: 'injection',
|
|
77
|
+
description: 'Application is vulnerable to SQL injection attacks',
|
|
78
|
+
impact: 'Potential database compromise and data exfiltration',
|
|
79
|
+
remediation: 'Implement parameterized queries and input validation',
|
|
80
|
+
cvssScore: 8.5,
|
|
81
|
+
references: ['https://owasp.org/www-community/attacks/SQL_Injection']
|
|
82
|
+
}, {
|
|
83
|
+
id: 'xss',
|
|
84
|
+
name: 'Cross-Site Scripting',
|
|
85
|
+
severity: 'medium',
|
|
86
|
+
category: 'client-side',
|
|
87
|
+
description: 'Application does not properly sanitize user input',
|
|
88
|
+
impact: 'Session hijacking and client-side code execution',
|
|
89
|
+
remediation: 'Implement proper input sanitization and output encoding',
|
|
90
|
+
cvssScore: 6.1,
|
|
91
|
+
references: ['https://owasp.org/www-community/attacks/xss/']
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
// API vulnerabilities
|
|
95
|
+
if (request.targetType === 'api') {
|
|
96
|
+
vulnerabilities.push({
|
|
97
|
+
id: 'broken-auth',
|
|
98
|
+
name: 'Broken Authentication',
|
|
99
|
+
severity: 'high',
|
|
100
|
+
category: 'authentication',
|
|
101
|
+
description: 'API authentication mechanisms are weak or broken',
|
|
102
|
+
impact: 'Unauthorized access to sensitive data and functionality',
|
|
103
|
+
remediation: 'Implement strong authentication and session management',
|
|
104
|
+
cvssScore: 8.2,
|
|
105
|
+
references: ['https://owasp.org/www-project-api-security/']
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
// Infrastructure vulnerabilities
|
|
109
|
+
if (request.targetType === 'infrastructure') {
|
|
110
|
+
vulnerabilities.push({
|
|
111
|
+
id: 'weak-ssh',
|
|
112
|
+
name: 'Weak SSH Configuration',
|
|
113
|
+
severity: 'medium',
|
|
114
|
+
category: 'configuration',
|
|
115
|
+
description: 'SSH service allows weak authentication methods',
|
|
116
|
+
impact: 'Potential unauthorized system access',
|
|
117
|
+
remediation: 'Disable weak ciphers and enforce key-based authentication',
|
|
118
|
+
cvssScore: 5.9
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
// Adjust based on scan depth
|
|
122
|
+
if (request.scanDepth === 'quick') {
|
|
123
|
+
return vulnerabilities.slice(0, 2);
|
|
124
|
+
}
|
|
125
|
+
else if (request.scanDepth === 'standard') {
|
|
126
|
+
return vulnerabilities;
|
|
127
|
+
}
|
|
128
|
+
else {
|
|
129
|
+
// Deep scan - add more vulnerabilities
|
|
130
|
+
vulnerabilities.push({
|
|
131
|
+
id: 'info-leak',
|
|
132
|
+
name: 'Information Disclosure',
|
|
133
|
+
severity: 'low',
|
|
134
|
+
category: 'information',
|
|
135
|
+
description: 'Application discloses sensitive information in error messages',
|
|
136
|
+
impact: 'Information leakage that could aid attackers',
|
|
137
|
+
remediation: 'Implement proper error handling and information disclosure controls',
|
|
138
|
+
cvssScore: 3.5
|
|
139
|
+
});
|
|
140
|
+
return vulnerabilities;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Calculate vulnerability summary
|
|
145
|
+
*/
|
|
146
|
+
calculateVulnerabilitySummary(vulnerabilities) {
|
|
147
|
+
const severityWeights = {
|
|
148
|
+
critical: 10,
|
|
149
|
+
high: 7,
|
|
150
|
+
medium: 4,
|
|
151
|
+
low: 1,
|
|
152
|
+
info: 0
|
|
153
|
+
};
|
|
154
|
+
let criticalCount = 0;
|
|
155
|
+
let highCount = 0;
|
|
156
|
+
let mediumCount = 0;
|
|
157
|
+
let lowCount = 0;
|
|
158
|
+
let totalWeight = 0;
|
|
159
|
+
for (const vuln of vulnerabilities) {
|
|
160
|
+
switch (vuln.severity) {
|
|
161
|
+
case 'critical':
|
|
162
|
+
criticalCount++;
|
|
163
|
+
totalWeight += severityWeights.critical;
|
|
164
|
+
break;
|
|
165
|
+
case 'high':
|
|
166
|
+
highCount++;
|
|
167
|
+
totalWeight += severityWeights.high;
|
|
168
|
+
break;
|
|
169
|
+
case 'medium':
|
|
170
|
+
mediumCount++;
|
|
171
|
+
totalWeight += severityWeights.medium;
|
|
172
|
+
break;
|
|
173
|
+
case 'low':
|
|
174
|
+
lowCount++;
|
|
175
|
+
totalWeight += severityWeights.low;
|
|
176
|
+
break;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
const maxPossibleWeight = vulnerabilities.length * severityWeights.critical;
|
|
180
|
+
const riskScore = maxPossibleWeight > 0 ? (totalWeight / maxPossibleWeight) * 10 : 0;
|
|
181
|
+
return {
|
|
182
|
+
totalVulnerabilities: vulnerabilities.length,
|
|
183
|
+
criticalCount,
|
|
184
|
+
highCount,
|
|
185
|
+
mediumCount,
|
|
186
|
+
lowCount,
|
|
187
|
+
riskScore: Math.round(riskScore * 10) / 10
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Calculate risk score
|
|
192
|
+
*/
|
|
193
|
+
calculateRiskScore(findings, context) {
|
|
194
|
+
let baseScore = 0;
|
|
195
|
+
// Context multiplier
|
|
196
|
+
const contextMultipliers = {
|
|
197
|
+
'production': 1.5,
|
|
198
|
+
'staging': 1.0,
|
|
199
|
+
'development': 0.5,
|
|
200
|
+
'test': 0.3
|
|
201
|
+
};
|
|
202
|
+
const contextMultiplier = contextMultipliers[context] || 1.0;
|
|
203
|
+
// Analyze findings
|
|
204
|
+
for (const finding of findings) {
|
|
205
|
+
const findingLower = finding.toLowerCase();
|
|
206
|
+
if (findingLower.includes('critical') || findingLower.includes('high risk')) {
|
|
207
|
+
baseScore += 8;
|
|
208
|
+
}
|
|
209
|
+
else if (findingLower.includes('medium') || findingLower.includes('moderate')) {
|
|
210
|
+
baseScore += 5;
|
|
211
|
+
}
|
|
212
|
+
else if (findingLower.includes('low')) {
|
|
213
|
+
baseScore += 2;
|
|
214
|
+
}
|
|
215
|
+
else {
|
|
216
|
+
baseScore += 1;
|
|
217
|
+
}
|
|
218
|
+
// Additional risk factors
|
|
219
|
+
if (findingLower.includes('data') && findingLower.includes('exposure')) {
|
|
220
|
+
baseScore += 3;
|
|
221
|
+
}
|
|
222
|
+
if (findingLower.includes('authentication') && findingLower.includes('bypass')) {
|
|
223
|
+
baseScore += 4;
|
|
224
|
+
}
|
|
225
|
+
if (findingLower.includes('remote') && findingLower.includes('code')) {
|
|
226
|
+
baseScore += 6;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
return Math.min(10, (baseScore / Math.max(1, findings.length)) * contextMultiplier);
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* Determine risk level
|
|
233
|
+
*/
|
|
234
|
+
determineRiskLevel(riskScore) {
|
|
235
|
+
if (riskScore >= 8)
|
|
236
|
+
return 'critical';
|
|
237
|
+
if (riskScore >= 6)
|
|
238
|
+
return 'high';
|
|
239
|
+
if (riskScore >= 4)
|
|
240
|
+
return 'medium';
|
|
241
|
+
return 'low';
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* Generate risk recommendations
|
|
245
|
+
*/
|
|
246
|
+
generateRiskRecommendations(findings, riskLevel) {
|
|
247
|
+
const recommendations = [];
|
|
248
|
+
recommendations.push(`Address ${riskLevel} risk findings immediately`);
|
|
249
|
+
if (findings.some(f => f.toLowerCase().includes('injection'))) {
|
|
250
|
+
recommendations.push('Implement input validation and parameterized queries');
|
|
251
|
+
}
|
|
252
|
+
if (findings.some(f => f.toLowerCase().includes('authentication'))) {
|
|
253
|
+
recommendations.push('Strengthen authentication mechanisms and session management');
|
|
254
|
+
}
|
|
255
|
+
if (findings.some(f => f.toLowerCase().includes('data'))) {
|
|
256
|
+
recommendations.push('Implement data protection and encryption controls');
|
|
257
|
+
}
|
|
258
|
+
recommendations.push('Conduct regular security assessments', 'Implement security monitoring and alerting', 'Provide security awareness training');
|
|
259
|
+
return recommendations;
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* Generate priority actions
|
|
263
|
+
*/
|
|
264
|
+
generatePriorityActions(riskLevel) {
|
|
265
|
+
const actions = [];
|
|
266
|
+
switch (riskLevel) {
|
|
267
|
+
case 'critical':
|
|
268
|
+
actions.push('Immediate remediation required', 'Consider temporary service suspension', 'Engage incident response team');
|
|
269
|
+
break;
|
|
270
|
+
case 'high':
|
|
271
|
+
actions.push('Remediate within 24-48 hours', 'Implement compensating controls', 'Increase monitoring and alerting');
|
|
272
|
+
break;
|
|
273
|
+
case 'medium':
|
|
274
|
+
actions.push('Remediate within 1-2 weeks', 'Schedule security review', 'Update risk assessment');
|
|
275
|
+
break;
|
|
276
|
+
case 'low':
|
|
277
|
+
actions.push('Address in next development cycle', 'Document for future reference', 'Monitor for changes in risk level');
|
|
278
|
+
break;
|
|
279
|
+
}
|
|
280
|
+
return actions;
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* Initialize vulnerability database
|
|
284
|
+
*/
|
|
285
|
+
initializeVulnerabilityDatabase() {
|
|
286
|
+
// This would be populated with real vulnerability data
|
|
287
|
+
// For demonstration, we use a minimal set
|
|
288
|
+
const vulnerabilities = [
|
|
289
|
+
{
|
|
290
|
+
id: 'sql-injection',
|
|
291
|
+
name: 'SQL Injection',
|
|
292
|
+
severity: 'high',
|
|
293
|
+
category: 'injection',
|
|
294
|
+
description: 'Application is vulnerable to SQL injection attacks',
|
|
295
|
+
impact: 'Potential database compromise and data exfiltration',
|
|
296
|
+
remediation: 'Implement parameterized queries and input validation',
|
|
297
|
+
cvssScore: 8.5
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
id: 'xss',
|
|
301
|
+
name: 'Cross-Site Scripting',
|
|
302
|
+
severity: 'medium',
|
|
303
|
+
category: 'client-side',
|
|
304
|
+
description: 'Application does not properly sanitize user input',
|
|
305
|
+
impact: 'Session hijacking and client-side code execution',
|
|
306
|
+
remediation: 'Implement proper input sanitization and output encoding',
|
|
307
|
+
cvssScore: 6.1
|
|
308
|
+
}
|
|
309
|
+
];
|
|
310
|
+
for (const vuln of vulnerabilities) {
|
|
311
|
+
this.vulnerabilityDatabase.set(vuln.id, vuln);
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
//# sourceMappingURL=vulnerabilityAssessment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vulnerabilityAssessment.js","sourceRoot":"","sources":["../../../src/security/assessment/vulnerabilityAssessment.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAkDH;;GAEG;AACH,MA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;CACF"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Security Authorization Engine
|
|
3
|
+
*
|
|
4
|
+
* Manages authorization and scope validation for security research activities.
|
|
5
|
+
* Ensures all security testing is properly authorized and within defined scope.
|
|
6
|
+
*
|
|
7
|
+
* LEGAL NOTICE:
|
|
8
|
+
* All security research must be properly authorized and scoped.
|
|
9
|
+
* Unauthorized security testing is illegal and unethical.
|
|
10
|
+
*/
|
|
11
|
+
export interface AuthorizationRequest {
|
|
12
|
+
authorizationType: 'bug_bounty' | 'pentest' | 'red_team' | 'ctf' | 'educational';
|
|
13
|
+
targetDomain: string;
|
|
14
|
+
authorizedBy: string;
|
|
15
|
+
scopeLimitations?: string[];
|
|
16
|
+
outOfScope?: string[];
|
|
17
|
+
expirationDate?: string;
|
|
18
|
+
}
|
|
19
|
+
export interface AuthorizationRecord {
|
|
20
|
+
authorizationType: string;
|
|
21
|
+
targetDomain: string;
|
|
22
|
+
authorizedBy: string;
|
|
23
|
+
scopeLimitations: string[];
|
|
24
|
+
outOfScope: string[];
|
|
25
|
+
authorizationDate: string;
|
|
26
|
+
expirationDate?: string;
|
|
27
|
+
status: 'authorized' | 'pending' | 'revoked';
|
|
28
|
+
authorizationId: string;
|
|
29
|
+
}
|
|
30
|
+
export interface ScopeValidationRequest {
|
|
31
|
+
activity: string;
|
|
32
|
+
target: string;
|
|
33
|
+
}
|
|
34
|
+
export interface ScopeValidationResult {
|
|
35
|
+
activity: string;
|
|
36
|
+
target: string;
|
|
37
|
+
valid: boolean;
|
|
38
|
+
reason?: string;
|
|
39
|
+
scopeCheck: string;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Security Authorization Engine
|
|
43
|
+
*/
|
|
44
|
+
export declare class SecurityAuthorizationEngine {
|
|
45
|
+
private authorizations;
|
|
46
|
+
constructor();
|
|
47
|
+
/**
|
|
48
|
+
* Create security research authorization
|
|
49
|
+
*/
|
|
50
|
+
createAuthorization(request: AuthorizationRequest): Promise<AuthorizationRecord>;
|
|
51
|
+
/**
|
|
52
|
+
* Validate if an activity is within authorized scope
|
|
53
|
+
*/
|
|
54
|
+
validateScope(request: ScopeValidationRequest): Promise<ScopeValidationResult>;
|
|
55
|
+
/**
|
|
56
|
+
* Get authorization by ID
|
|
57
|
+
*/
|
|
58
|
+
getAuthorization(authorizationId: string): AuthorizationRecord | undefined;
|
|
59
|
+
/**
|
|
60
|
+
* List all authorizations
|
|
61
|
+
*/
|
|
62
|
+
listAuthorizations(): AuthorizationRecord[];
|
|
63
|
+
/**
|
|
64
|
+
* Revoke authorization
|
|
65
|
+
*/
|
|
66
|
+
revokeAuthorization(authorizationId: string): boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Generate unique authorization ID
|
|
69
|
+
*/
|
|
70
|
+
private generateAuthorizationId;
|
|
71
|
+
/**
|
|
72
|
+
* Find relevant authorization for target
|
|
73
|
+
*/
|
|
74
|
+
private findRelevantAuthorization;
|
|
75
|
+
/**
|
|
76
|
+
* Check if activity is out of scope
|
|
77
|
+
*/
|
|
78
|
+
private isActivityOutOfScope;
|
|
79
|
+
/**
|
|
80
|
+
* Check scope limitations
|
|
81
|
+
*/
|
|
82
|
+
private checkScopeLimitations;
|
|
83
|
+
/**
|
|
84
|
+
* Check if activity is potentially destructive
|
|
85
|
+
*/
|
|
86
|
+
private isDestructiveActivity;
|
|
87
|
+
}
|
|
88
|
+
//# sourceMappingURL=securityAuthorization.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"securityAuthorization.d.ts","sourceRoot":"","sources":["../../../src/security/authorization/securityAuthorization.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,MAAM,WAAW,oBAAoB;IACnC,iBAAiB,EAAE,YAAY,GAAG,SAAS,GAAG,UAAU,GAAG,KAAK,GAAG,aAAa,CAAC;IACjF,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAg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G;IACH,OAAO,CAAC,yBAAyB;IAYjC;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAO5B;;OAEG;IACH,OAAO,CAAC,qBAAqB;IAsB7B;;OAEG;IACH,OAAO,CAAC,qBAAqB;CAQ9B"}
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Security Authorization Engine
|
|
3
|
+
*
|
|
4
|
+
* Manages authorization and scope validation for security research activities.
|
|
5
|
+
* Ensures all security testing is properly authorized and within defined scope.
|
|
6
|
+
*
|
|
7
|
+
* LEGAL NOTICE:
|
|
8
|
+
* All security research must be properly authorized and scoped.
|
|
9
|
+
* Unauthorized security testing is illegal and unethical.
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Security Authorization Engine
|
|
13
|
+
*/
|
|
14
|
+
export class SecurityAuthorizationEngine {
|
|
15
|
+
authorizations;
|
|
16
|
+
constructor() {
|
|
17
|
+
this.authorizations = new Map();
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Create security research authorization
|
|
21
|
+
*/
|
|
22
|
+
async createAuthorization(request) {
|
|
23
|
+
const authorization = {
|
|
24
|
+
authorizationType: request.authorizationType,
|
|
25
|
+
targetDomain: request.targetDomain,
|
|
26
|
+
authorizedBy: request.authorizedBy,
|
|
27
|
+
scopeLimitations: request.scopeLimitations || [],
|
|
28
|
+
outOfScope: request.outOfScope || [],
|
|
29
|
+
authorizationDate: new Date().toISOString(),
|
|
30
|
+
expirationDate: request.expirationDate,
|
|
31
|
+
status: 'authorized',
|
|
32
|
+
authorizationId: this.generateAuthorizationId()
|
|
33
|
+
};
|
|
34
|
+
this.authorizations.set(authorization.authorizationId, authorization);
|
|
35
|
+
return authorization;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Validate if an activity is within authorized scope
|
|
39
|
+
*/
|
|
40
|
+
async validateScope(request) {
|
|
41
|
+
// Find relevant authorization
|
|
42
|
+
const authorization = this.findRelevantAuthorization(request.target);
|
|
43
|
+
if (!authorization) {
|
|
44
|
+
return {
|
|
45
|
+
activity: request.activity,
|
|
46
|
+
target: request.target,
|
|
47
|
+
valid: false,
|
|
48
|
+
reason: 'No authorization found for target',
|
|
49
|
+
scopeCheck: 'Manual validation required - no authorization record found'
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
// Check if authorization is still valid
|
|
53
|
+
if (authorization.expirationDate && new Date(authorization.expirationDate) < new Date()) {
|
|
54
|
+
return {
|
|
55
|
+
activity: request.activity,
|
|
56
|
+
target: request.target,
|
|
57
|
+
valid: false,
|
|
58
|
+
reason: 'Authorization has expired',
|
|
59
|
+
scopeCheck: 'Authorization expired - renew authorization before proceeding'
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
// Check if activity is explicitly out of scope
|
|
63
|
+
const isOutOfScope = this.isActivityOutOfScope(request.activity, authorization.outOfScope);
|
|
64
|
+
if (isOutOfScope) {
|
|
65
|
+
return {
|
|
66
|
+
activity: request.activity,
|
|
67
|
+
target: request.target,
|
|
68
|
+
valid: false,
|
|
69
|
+
reason: 'Activity is explicitly out of scope',
|
|
70
|
+
scopeCheck: 'Activity prohibited - explicitly listed as out of scope'
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
// Check scope limitations
|
|
74
|
+
const scopeViolation = this.checkScopeLimitations(request.activity, authorization.scopeLimitations);
|
|
75
|
+
if (scopeViolation) {
|
|
76
|
+
return {
|
|
77
|
+
activity: request.activity,
|
|
78
|
+
target: request.target,
|
|
79
|
+
valid: false,
|
|
80
|
+
reason: scopeViolation,
|
|
81
|
+
scopeCheck: 'Scope limitation violation - review authorization scope'
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
return {
|
|
85
|
+
activity: request.activity,
|
|
86
|
+
target: request.target,
|
|
87
|
+
valid: true,
|
|
88
|
+
scopeCheck: 'Activity appears to be within authorized scope - proceed with caution'
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Get authorization by ID
|
|
93
|
+
*/
|
|
94
|
+
getAuthorization(authorizationId) {
|
|
95
|
+
return this.authorizations.get(authorizationId);
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* List all authorizations
|
|
99
|
+
*/
|
|
100
|
+
listAuthorizations() {
|
|
101
|
+
return Array.from(this.authorizations.values());
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Revoke authorization
|
|
105
|
+
*/
|
|
106
|
+
revokeAuthorization(authorizationId) {
|
|
107
|
+
const authorization = this.authorizations.get(authorizationId);
|
|
108
|
+
if (authorization) {
|
|
109
|
+
authorization.status = 'revoked';
|
|
110
|
+
return true;
|
|
111
|
+
}
|
|
112
|
+
return false;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Generate unique authorization ID
|
|
116
|
+
*/
|
|
117
|
+
generateAuthorizationId() {
|
|
118
|
+
return `auth_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Find relevant authorization for target
|
|
122
|
+
*/
|
|
123
|
+
findRelevantAuthorization(target) {
|
|
124
|
+
for (const authorization of this.authorizations.values()) {
|
|
125
|
+
if (authorization.status !== 'authorized')
|
|
126
|
+
continue;
|
|
127
|
+
// Simple domain matching - in real implementation, use proper domain matching
|
|
128
|
+
if (target.includes(authorization.targetDomain) || authorization.targetDomain === '*') {
|
|
129
|
+
return authorization;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
return undefined;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Check if activity is out of scope
|
|
136
|
+
*/
|
|
137
|
+
isActivityOutOfScope(activity, outOfScope) {
|
|
138
|
+
const activityLower = activity.toLowerCase();
|
|
139
|
+
return outOfScope.some(scope => activityLower.includes(scope.toLowerCase()) || scope.toLowerCase().includes(activityLower));
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Check scope limitations
|
|
143
|
+
*/
|
|
144
|
+
checkScopeLimitations(activity, scopeLimitations) {
|
|
145
|
+
for (const limitation of scopeLimitations) {
|
|
146
|
+
const limitationLower = limitation.toLowerCase();
|
|
147
|
+
const activityLower = activity.toLowerCase();
|
|
148
|
+
// Check for common limitation patterns
|
|
149
|
+
if (limitationLower.includes('read-only') && activityLower.includes('write')) {
|
|
150
|
+
return 'Write operations prohibited in read-only scope';
|
|
151
|
+
}
|
|
152
|
+
if (limitationLower.includes('non-destructive') && this.isDestructiveActivity(activityLower)) {
|
|
153
|
+
return 'Destructive activities prohibited in non-destructive scope';
|
|
154
|
+
}
|
|
155
|
+
if (limitationLower.includes('production') && activityLower.includes('staging')) {
|
|
156
|
+
return 'Staging environment activities prohibited in production-only scope';
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
return null;
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Check if activity is potentially destructive
|
|
163
|
+
*/
|
|
164
|
+
isDestructiveActivity(activity) {
|
|
165
|
+
const destructiveKeywords = [
|
|
166
|
+
'delete', 'drop', 'remove', 'truncate', 'wipe', 'erase',
|
|
167
|
+
'destroy', 'overwrite', 'format', 'shutdown', 'reboot'
|
|
168
|
+
];
|
|
169
|
+
return destructiveKeywords.some(keyword => activity.includes(keyword));
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
//# sourceMappingURL=securityAuthorization.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"securityAuthorization.js","sourceRoot":"","sources":["../../../src/security/authorization/securityAuthorization.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAoCH;;GAEG;AACH,MAAM,OAAO,2BAA2B;IAC9B,cAAc,CAAmC;IAEzD;QACE,IAAI,CAAC,cAAc,GAAG,IAAI,GAAG,EAAE,CAAC;IAClC,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,mBAAmB,CAAC,OAA6B;QACrD,MAAM,aAAa,GAAwB;YACzC,iBAAiB,EAAE,OA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