erosolar-cli 1.7.262 → 1.7.263
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 -22
- 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/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/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.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/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/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 -11
- package/dist/shell/interactiveShell.d.ts.map +1 -1
- package/dist/shell/interactiveShell.js +153 -190
- 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 +0 -16
- 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 +147 -68
- package/dist/shell/terminalInput.d.ts.map +1 -1
- package/dist/shell/terminalInput.js +689 -451
- package/dist/shell/terminalInput.js.map +1 -1
- package/dist/shell/terminalInputAdapter.d.ts +20 -20
- package/dist/shell/terminalInputAdapter.d.ts.map +1 -1
- package/dist/shell/terminalInputAdapter.js +29 -14
- package/dist/shell/terminalInputAdapter.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 +0 -19
- package/dist/ui/display.d.ts.map +1 -1
- package/dist/ui/display.js +33 -131
- 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 +1 -1
- 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
|
@@ -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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AAU,IAAI,gBAAgB,EAAE,CAAC;YAC1C,MAAM,eAAe,GAAG,UAAU,CAAC,WAAW,EAAE,CAAC;YACjD,MAAM,aAAa,GAAG,QAAQ,CAAC,WAAW,EAAE,CAAC;YAE7C,uCAAuC;YACvC,IAAI,eAAe,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,aAAa,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;gBAC7E,OAAO,gDAAgD,CAAC;YAC1D,CAAC;YAED,IAAI,eAAe,CAAC,QAAQ,CAAC,iBAAiB,CAAC,IAAI,IAAI,CAAC,qBAAqB,CAAC,aAAa,CAAC,EAAE,CAAC;gBAC7F,OAAO,4DAA4D,CAAC;YACtE,CAAC;YAED,IAAI,eAAe,CAAC,QAAQ,CAAC,YAAY,CAAC,IAAI,aAAa,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC;gBAChF,OAAO,oEAAoE,CAAC;YAC9E,CAAC;QACH,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;OAEG;IACK,qBAAqB,CAAC,QAAgB;QAC5C,MAAM,mBAAmB,GAAG;YAC1B,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO;YACvD,SAAS,EAAE,WAAW,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ;SACvD,CAAC;QAEF,OAAO,mBAAmB,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;IACzE,CAAC;CACF"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Comprehensive Targeting Security Module
|
|
3
|
+
*
|
|
4
|
+
* Provides comprehensive coverage for all major companies, countries,
|
|
5
|
+
* and strategic entities with proper authorization and compliance.
|
|
6
|
+
*
|
|
7
|
+
* @license MIT
|
|
8
|
+
* @author Bo Shang
|
|
9
|
+
*
|
|
10
|
+
* DISCLAIMER: This software is provided for authorized security testing,
|
|
11
|
+
* research, and defensive purposes only. Users must ensure compliance
|
|
12
|
+
* with all applicable laws and regulations in their jurisdiction.
|
|
13
|
+
*/
|
|
14
|
+
export interface StrategicEntity {
|
|
15
|
+
/** Entity type */
|
|
16
|
+
type: 'company' | 'country' | 'organization' | 'alliance';
|
|
17
|
+
/** Entity identifier */
|
|
18
|
+
identifier: string;
|
|
19
|
+
/** Strategic importance level */
|
|
20
|
+
strategicLevel: 'critical' | 'high' | 'medium' | 'low';
|
|
21
|
+
/** Geopolitical considerations */
|
|
22
|
+
geopolitical: {
|
|
23
|
+
jurisdiction: string;
|
|
24
|
+
alliances: string[];
|
|
25
|
+
sanctions: string[];
|
|
26
|
+
specialConsiderations: string[];
|
|
27
|
+
};
|
|
28
|
+
/** Security classification */
|
|
29
|
+
securityClassification: 'public' | 'restricted' | 'confidential' | 'secret';
|
|
30
|
+
/** Authorized operations */
|
|
31
|
+
authorizedOperations: string[];
|
|
32
|
+
}
|
|
33
|
+
export declare class ComprehensiveTargeting {
|
|
34
|
+
private strategicEntities;
|
|
35
|
+
constructor();
|
|
36
|
+
/**
|
|
37
|
+
* Initialize comprehensive strategic entities
|
|
38
|
+
*/
|
|
39
|
+
private initializeStrategicEntities;
|
|
40
|
+
/**
|
|
41
|
+
* Initialize major technology companies
|
|
42
|
+
*/
|
|
43
|
+
private initializeTechnologyCompanies;
|
|
44
|
+
/**
|
|
45
|
+
* Initialize countries and governments
|
|
46
|
+
*/
|
|
47
|
+
private initializeCountries;
|
|
48
|
+
/**
|
|
49
|
+
* Initialize critical infrastructure
|
|
50
|
+
*/
|
|
51
|
+
private initializeCriticalInfrastructure;
|
|
52
|
+
/**
|
|
53
|
+
* Initialize strategic alliances
|
|
54
|
+
*/
|
|
55
|
+
private initializeStrategicAlliances;
|
|
56
|
+
/**
|
|
57
|
+
* Authorize a strategic entity
|
|
58
|
+
*/
|
|
59
|
+
private authorizeStrategicEntity;
|
|
60
|
+
/**
|
|
61
|
+
* Get authorization level based on strategic importance
|
|
62
|
+
*/
|
|
63
|
+
private getAuthorizationLevel;
|
|
64
|
+
/**
|
|
65
|
+
* Get reporting requirements based on entity type
|
|
66
|
+
*/
|
|
67
|
+
private getReportingRequirements;
|
|
68
|
+
/**
|
|
69
|
+
* Get strategic entity by identifier
|
|
70
|
+
*/
|
|
71
|
+
getStrategicEntity(identifier: string): StrategicEntity | undefined;
|
|
72
|
+
/**
|
|
73
|
+
* Get all strategic entities
|
|
74
|
+
*/
|
|
75
|
+
getAllStrategicEntities(): StrategicEntity[];
|
|
76
|
+
/**
|
|
77
|
+
* Get entities by type
|
|
78
|
+
*/
|
|
79
|
+
getEntitiesByType(type: string): StrategicEntity[];
|
|
80
|
+
/**
|
|
81
|
+
* Get entities by strategic level
|
|
82
|
+
*/
|
|
83
|
+
getEntitiesByStrategicLevel(level: string): StrategicEntity[];
|
|
84
|
+
}
|
|
85
|
+
//# sourceMappingURL=comprehensive-targeting.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"comprehensive-targeting.d.ts","sourceRoot":"","sources":["../../src/security/comprehensive-targeting.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAIH,MAAM,WAAW,eAAe;IAC9B,kBAAkB;IAClB,IAAI,EAAE,SAAS,GAAG,SAAS,GAAG,cAAc,GAAG,UAAU,CAAC;IAC1D,wBAAwB;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,iCAAiC;IACjC,cAAc,EAAE,UAAU,GAAG,MAAM,GAAG,QAAQ,GAAG,KAAK,CAAC;IACvD,kCAAkC;IAClC,YAAY,EAAE;QACZ,YAAY,EAAE,MAAM,CAAC;QACrB,SAAS,EAAE,MAAM,EAAE,CAAC;QACpB,SAAS,EAAE,MAAM,EAAE,CAAC;QACpB,qBAAqB,EAAE,MAAM,EAAE,CAAC;KACjC,CAAC;IACF,8BAA8B;IAC9B,sBAAsB,EAAE,QAAQ,GAAG,Y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