erosolar-cli 1.7.346 → 1.7.347

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 (328) hide show
  1. package/README.md +24 -148
  2. package/dist/bin/erosolar.js +5 -21
  3. package/dist/bin/erosolar.js.map +1 -1
  4. package/dist/capabilities/agentSpawningCapability.d.ts.map +1 -1
  5. package/dist/capabilities/agentSpawningCapability.js +56 -31
  6. package/dist/capabilities/agentSpawningCapability.js.map +1 -1
  7. package/dist/contracts/agent-schemas.json +0 -15
  8. package/dist/contracts/tools.schema.json +0 -9
  9. package/dist/core/agent.d.ts +2 -2
  10. package/dist/core/agent.d.ts.map +1 -1
  11. package/dist/core/agent.js.map +1 -1
  12. package/dist/core/customCommands.d.ts +1 -0
  13. package/dist/core/customCommands.d.ts.map +1 -1
  14. package/dist/core/customCommands.js +3 -0
  15. package/dist/core/customCommands.js.map +1 -1
  16. package/dist/core/hooks.d.ts +113 -0
  17. package/dist/core/hooks.d.ts.map +1 -0
  18. package/dist/core/hooks.js +267 -0
  19. package/dist/core/hooks.js.map +1 -0
  20. package/dist/core/metricsTracker.d.ts +122 -0
  21. package/dist/core/metricsTracker.d.ts.map +1 -0
  22. package/dist/{alpha-zero → core}/metricsTracker.js +2 -5
  23. package/dist/core/metricsTracker.js.map +1 -0
  24. package/dist/core/securityAssessment.d.ts +91 -0
  25. package/dist/core/securityAssessment.d.ts.map +1 -0
  26. package/dist/core/securityAssessment.js +580 -0
  27. package/dist/core/securityAssessment.js.map +1 -0
  28. package/dist/core/sessionStore.d.ts +2 -0
  29. package/dist/core/sessionStore.d.ts.map +1 -1
  30. package/dist/core/sessionStore.js +1 -0
  31. package/dist/core/sessionStore.js.map +1 -1
  32. package/dist/core/toolPreconditions.d.ts.map +1 -1
  33. package/dist/core/toolPreconditions.js +0 -14
  34. package/dist/core/toolPreconditions.js.map +1 -1
  35. package/dist/core/toolRuntime.d.ts +22 -1
  36. package/dist/core/toolRuntime.d.ts.map +1 -1
  37. package/dist/core/toolRuntime.js +0 -5
  38. package/dist/core/toolRuntime.js.map +1 -1
  39. package/dist/core/toolValidation.d.ts.map +1 -1
  40. package/dist/core/toolValidation.js +14 -3
  41. package/dist/core/toolValidation.js.map +1 -1
  42. package/dist/core/validationRunner.d.ts +1 -3
  43. package/dist/core/validationRunner.d.ts.map +1 -1
  44. package/dist/core/validationRunner.js.map +1 -1
  45. package/dist/core/verification.d.ts +137 -0
  46. package/dist/core/verification.d.ts.map +1 -0
  47. package/dist/core/verification.js +323 -0
  48. package/dist/core/verification.js.map +1 -0
  49. package/dist/headless/headlessApp.d.ts.map +1 -1
  50. package/dist/headless/headlessApp.js +21 -0
  51. package/dist/headless/headlessApp.js.map +1 -1
  52. package/dist/mcp/sseClient.d.ts.map +1 -1
  53. package/dist/mcp/sseClient.js +9 -18
  54. package/dist/mcp/sseClient.js.map +1 -1
  55. package/dist/plugins/tools/build/buildPlugin.d.ts +0 -6
  56. package/dist/plugins/tools/build/buildPlugin.d.ts.map +1 -1
  57. package/dist/plugins/tools/build/buildPlugin.js +4 -10
  58. package/dist/plugins/tools/build/buildPlugin.js.map +1 -1
  59. package/dist/plugins/tools/nodeDefaults.d.ts.map +1 -1
  60. package/dist/plugins/tools/nodeDefaults.js +0 -2
  61. package/dist/plugins/tools/nodeDefaults.js.map +1 -1
  62. package/dist/runtime/agentSession.d.ts +2 -2
  63. package/dist/runtime/agentSession.d.ts.map +1 -1
  64. package/dist/runtime/agentSession.js +2 -2
  65. package/dist/runtime/agentSession.js.map +1 -1
  66. package/dist/shell/interactiveShell.d.ts +43 -7
  67. package/dist/shell/interactiveShell.d.ts.map +1 -1
  68. package/dist/shell/interactiveShell.js +417 -166
  69. package/dist/shell/interactiveShell.js.map +1 -1
  70. package/dist/shell/shellApp.d.ts +2 -0
  71. package/dist/shell/shellApp.d.ts.map +1 -1
  72. package/dist/shell/shellApp.js +82 -9
  73. package/dist/shell/shellApp.js.map +1 -1
  74. package/dist/shell/systemPrompt.d.ts.map +1 -1
  75. package/dist/shell/systemPrompt.js +1 -4
  76. package/dist/shell/systemPrompt.js.map +1 -1
  77. package/dist/shell/terminalInput.d.ts +252 -120
  78. package/dist/shell/terminalInput.d.ts.map +1 -1
  79. package/dist/shell/terminalInput.js +1117 -541
  80. package/dist/shell/terminalInput.js.map +1 -1
  81. package/dist/shell/terminalInputAdapter.d.ts +106 -24
  82. package/dist/shell/terminalInputAdapter.d.ts.map +1 -1
  83. package/dist/shell/terminalInputAdapter.js +141 -30
  84. package/dist/shell/terminalInputAdapter.js.map +1 -1
  85. package/dist/subagents/agentConfig.d.ts +27 -0
  86. package/dist/subagents/agentConfig.d.ts.map +1 -0
  87. package/dist/subagents/agentConfig.js +89 -0
  88. package/dist/subagents/agentConfig.js.map +1 -0
  89. package/dist/subagents/agentRegistry.d.ts +33 -0
  90. package/dist/subagents/agentRegistry.d.ts.map +1 -0
  91. package/dist/subagents/agentRegistry.js +162 -0
  92. package/dist/subagents/agentRegistry.js.map +1 -0
  93. package/dist/subagents/taskRunner.d.ts +7 -1
  94. package/dist/subagents/taskRunner.d.ts.map +1 -1
  95. package/dist/subagents/taskRunner.js +180 -47
  96. package/dist/subagents/taskRunner.js.map +1 -1
  97. package/dist/ui/ShellUIAdapter.d.ts +7 -1
  98. package/dist/ui/ShellUIAdapter.d.ts.map +1 -1
  99. package/dist/ui/ShellUIAdapter.js +42 -18
  100. package/dist/ui/ShellUIAdapter.js.map +1 -1
  101. package/dist/ui/display.d.ts +24 -45
  102. package/dist/ui/display.d.ts.map +1 -1
  103. package/dist/ui/display.js +140 -259
  104. package/dist/ui/display.js.map +1 -1
  105. package/dist/ui/theme.d.ts.map +1 -1
  106. package/dist/ui/theme.js +6 -8
  107. package/dist/ui/theme.js.map +1 -1
  108. package/dist/ui/toolDisplay.d.ts +0 -158
  109. package/dist/ui/toolDisplay.d.ts.map +1 -1
  110. package/dist/ui/toolDisplay.js +0 -348
  111. package/dist/ui/toolDisplay.js.map +1 -1
  112. package/dist/ui/unified/layout.d.ts +20 -0
  113. package/dist/ui/unified/layout.d.ts.map +1 -1
  114. package/dist/ui/unified/layout.js +105 -216
  115. package/dist/ui/unified/layout.js.map +1 -1
  116. package/dist/utils/frontmatter.d.ts +10 -0
  117. package/dist/utils/frontmatter.d.ts.map +1 -0
  118. package/dist/utils/frontmatter.js +78 -0
  119. package/dist/utils/frontmatter.js.map +1 -0
  120. package/package.json +4 -4
  121. package/dist/alpha-zero/agentWrapper.d.ts +0 -84
  122. package/dist/alpha-zero/agentWrapper.d.ts.map +0 -1
  123. package/dist/alpha-zero/agentWrapper.js +0 -171
  124. package/dist/alpha-zero/agentWrapper.js.map +0 -1
  125. package/dist/alpha-zero/codeEvaluator.d.ts +0 -25
  126. package/dist/alpha-zero/codeEvaluator.d.ts.map +0 -1
  127. package/dist/alpha-zero/codeEvaluator.js +0 -273
  128. package/dist/alpha-zero/codeEvaluator.js.map +0 -1
  129. package/dist/alpha-zero/competitiveRunner.d.ts +0 -66
  130. package/dist/alpha-zero/competitiveRunner.d.ts.map +0 -1
  131. package/dist/alpha-zero/competitiveRunner.js +0 -224
  132. package/dist/alpha-zero/competitiveRunner.js.map +0 -1
  133. package/dist/alpha-zero/index.d.ts +0 -67
  134. package/dist/alpha-zero/index.d.ts.map +0 -1
  135. package/dist/alpha-zero/index.js +0 -99
  136. package/dist/alpha-zero/index.js.map +0 -1
  137. package/dist/alpha-zero/introspection.d.ts +0 -128
  138. package/dist/alpha-zero/introspection.d.ts.map +0 -1
  139. package/dist/alpha-zero/introspection.js +0 -300
  140. package/dist/alpha-zero/introspection.js.map +0 -1
  141. package/dist/alpha-zero/metricsTracker.d.ts +0 -71
  142. package/dist/alpha-zero/metricsTracker.d.ts.map +0 -1
  143. package/dist/alpha-zero/metricsTracker.js.map +0 -1
  144. package/dist/alpha-zero/security/core.d.ts +0 -125
  145. package/dist/alpha-zero/security/core.d.ts.map +0 -1
  146. package/dist/alpha-zero/security/core.js +0 -271
  147. package/dist/alpha-zero/security/core.js.map +0 -1
  148. package/dist/alpha-zero/security/google.d.ts +0 -125
  149. package/dist/alpha-zero/security/google.d.ts.map +0 -1
  150. package/dist/alpha-zero/security/google.js +0 -311
  151. package/dist/alpha-zero/security/google.js.map +0 -1
  152. package/dist/alpha-zero/security/googleLoader.d.ts +0 -17
  153. package/dist/alpha-zero/security/googleLoader.d.ts.map +0 -1
  154. package/dist/alpha-zero/security/googleLoader.js +0 -41
  155. package/dist/alpha-zero/security/googleLoader.js.map +0 -1
  156. package/dist/alpha-zero/security/index.d.ts +0 -29
  157. package/dist/alpha-zero/security/index.d.ts.map +0 -1
  158. package/dist/alpha-zero/security/index.js +0 -32
  159. package/dist/alpha-zero/security/index.js.map +0 -1
  160. package/dist/alpha-zero/security/simulation.d.ts +0 -124
  161. package/dist/alpha-zero/security/simulation.d.ts.map +0 -1
  162. package/dist/alpha-zero/security/simulation.js +0 -277
  163. package/dist/alpha-zero/security/simulation.js.map +0 -1
  164. package/dist/alpha-zero/selfModification.d.ts +0 -109
  165. package/dist/alpha-zero/selfModification.d.ts.map +0 -1
  166. package/dist/alpha-zero/selfModification.js +0 -233
  167. package/dist/alpha-zero/selfModification.js.map +0 -1
  168. package/dist/alpha-zero/types.d.ts +0 -170
  169. package/dist/alpha-zero/types.d.ts.map +0 -1
  170. package/dist/alpha-zero/types.js +0 -31
  171. package/dist/alpha-zero/types.js.map +0 -1
  172. package/dist/capabilities/securityTestingCapability.d.ts +0 -13
  173. package/dist/capabilities/securityTestingCapability.d.ts.map +0 -1
  174. package/dist/capabilities/securityTestingCapability.js +0 -25
  175. package/dist/capabilities/securityTestingCapability.js.map +0 -1
  176. package/dist/core/aiFlowOptimizer.d.ts +0 -26
  177. package/dist/core/aiFlowOptimizer.d.ts.map +0 -1
  178. package/dist/core/aiFlowOptimizer.js +0 -31
  179. package/dist/core/aiFlowOptimizer.js.map +0 -1
  180. package/dist/core/aiOptimizationEngine.d.ts +0 -158
  181. package/dist/core/aiOptimizationEngine.d.ts.map +0 -1
  182. package/dist/core/aiOptimizationEngine.js +0 -428
  183. package/dist/core/aiOptimizationEngine.js.map +0 -1
  184. package/dist/core/aiOptimizationIntegration.d.ts +0 -93
  185. package/dist/core/aiOptimizationIntegration.d.ts.map +0 -1
  186. package/dist/core/aiOptimizationIntegration.js +0 -250
  187. package/dist/core/aiOptimizationIntegration.js.map +0 -1
  188. package/dist/core/enhancedErrorRecovery.d.ts +0 -100
  189. package/dist/core/enhancedErrorRecovery.d.ts.map +0 -1
  190. package/dist/core/enhancedErrorRecovery.js +0 -345
  191. package/dist/core/enhancedErrorRecovery.js.map +0 -1
  192. package/dist/core/hooksSystem.d.ts +0 -65
  193. package/dist/core/hooksSystem.d.ts.map +0 -1
  194. package/dist/core/hooksSystem.js +0 -273
  195. package/dist/core/hooksSystem.js.map +0 -1
  196. package/dist/core/memorySystem.d.ts +0 -48
  197. package/dist/core/memorySystem.d.ts.map +0 -1
  198. package/dist/core/memorySystem.js +0 -271
  199. package/dist/core/memorySystem.js.map +0 -1
  200. package/dist/core/unified/errors.d.ts +0 -189
  201. package/dist/core/unified/errors.d.ts.map +0 -1
  202. package/dist/core/unified/errors.js +0 -497
  203. package/dist/core/unified/errors.js.map +0 -1
  204. package/dist/core/unified/index.d.ts +0 -19
  205. package/dist/core/unified/index.d.ts.map +0 -1
  206. package/dist/core/unified/index.js +0 -68
  207. package/dist/core/unified/index.js.map +0 -1
  208. package/dist/core/unified/schema.d.ts +0 -101
  209. package/dist/core/unified/schema.d.ts.map +0 -1
  210. package/dist/core/unified/schema.js +0 -350
  211. package/dist/core/unified/schema.js.map +0 -1
  212. package/dist/core/unified/toolRuntime.d.ts +0 -179
  213. package/dist/core/unified/toolRuntime.d.ts.map +0 -1
  214. package/dist/core/unified/toolRuntime.js +0 -517
  215. package/dist/core/unified/toolRuntime.js.map +0 -1
  216. package/dist/core/unified/tools.d.ts +0 -127
  217. package/dist/core/unified/tools.d.ts.map +0 -1
  218. package/dist/core/unified/tools.js +0 -1333
  219. package/dist/core/unified/tools.js.map +0 -1
  220. package/dist/core/unified/types.d.ts +0 -352
  221. package/dist/core/unified/types.d.ts.map +0 -1
  222. package/dist/core/unified/types.js +0 -12
  223. package/dist/core/unified/types.js.map +0 -1
  224. package/dist/core/unified/version.d.ts +0 -209
  225. package/dist/core/unified/version.d.ts.map +0 -1
  226. package/dist/core/unified/version.js +0 -454
  227. package/dist/core/unified/version.js.map +0 -1
  228. package/dist/plugins/tools/security/securityPlugin.d.ts +0 -3
  229. package/dist/plugins/tools/security/securityPlugin.d.ts.map +0 -1
  230. package/dist/plugins/tools/security/securityPlugin.js +0 -12
  231. package/dist/plugins/tools/security/securityPlugin.js.map +0 -1
  232. package/dist/security/active-stack-security.d.ts +0 -112
  233. package/dist/security/active-stack-security.d.ts.map +0 -1
  234. package/dist/security/active-stack-security.js +0 -296
  235. package/dist/security/active-stack-security.js.map +0 -1
  236. package/dist/security/advanced-persistence-research.d.ts +0 -92
  237. package/dist/security/advanced-persistence-research.d.ts.map +0 -1
  238. package/dist/security/advanced-persistence-research.js +0 -195
  239. package/dist/security/advanced-persistence-research.js.map +0 -1
  240. package/dist/security/advanced-targeting.d.ts +0 -119
  241. package/dist/security/advanced-targeting.d.ts.map +0 -1
  242. package/dist/security/advanced-targeting.js +0 -233
  243. package/dist/security/advanced-targeting.js.map +0 -1
  244. package/dist/security/assessment/vulnerabilityAssessment.d.ts +0 -104
  245. package/dist/security/assessment/vulnerabilityAssessment.d.ts.map +0 -1
  246. package/dist/security/assessment/vulnerabilityAssessment.js +0 -315
  247. package/dist/security/assessment/vulnerabilityAssessment.js.map +0 -1
  248. package/dist/security/authorization/securityAuthorization.d.ts +0 -88
  249. package/dist/security/authorization/securityAuthorization.d.ts.map +0 -1
  250. package/dist/security/authorization/securityAuthorization.js +0 -172
  251. package/dist/security/authorization/securityAuthorization.js.map +0 -1
  252. package/dist/security/comprehensive-targeting.d.ts +0 -85
  253. package/dist/security/comprehensive-targeting.d.ts.map +0 -1
  254. package/dist/security/comprehensive-targeting.js +0 -438
  255. package/dist/security/comprehensive-targeting.js.map +0 -1
  256. package/dist/security/global-security-integration.d.ts +0 -91
  257. package/dist/security/global-security-integration.d.ts.map +0 -1
  258. package/dist/security/global-security-integration.js +0 -218
  259. package/dist/security/global-security-integration.js.map +0 -1
  260. package/dist/security/index.d.ts +0 -38
  261. package/dist/security/index.d.ts.map +0 -1
  262. package/dist/security/index.js +0 -47
  263. package/dist/security/index.js.map +0 -1
  264. package/dist/security/persistence-analyzer.d.ts +0 -56
  265. package/dist/security/persistence-analyzer.d.ts.map +0 -1
  266. package/dist/security/persistence-analyzer.js +0 -187
  267. package/dist/security/persistence-analyzer.js.map +0 -1
  268. package/dist/security/persistence-cli.d.ts +0 -36
  269. package/dist/security/persistence-cli.d.ts.map +0 -1
  270. package/dist/security/persistence-cli.js +0 -160
  271. package/dist/security/persistence-cli.js.map +0 -1
  272. package/dist/security/persistence-research.d.ts +0 -92
  273. package/dist/security/persistence-research.d.ts.map +0 -1
  274. package/dist/security/persistence-research.js +0 -364
  275. package/dist/security/persistence-research.js.map +0 -1
  276. package/dist/security/research/persistenceResearch.d.ts +0 -97
  277. package/dist/security/research/persistenceResearch.d.ts.map +0 -1
  278. package/dist/security/research/persistenceResearch.js +0 -282
  279. package/dist/security/research/persistenceResearch.js.map +0 -1
  280. package/dist/security/security-integration.d.ts +0 -74
  281. package/dist/security/security-integration.d.ts.map +0 -1
  282. package/dist/security/security-integration.js +0 -137
  283. package/dist/security/security-integration.js.map +0 -1
  284. package/dist/security/security-testing-framework.d.ts +0 -112
  285. package/dist/security/security-testing-framework.d.ts.map +0 -1
  286. package/dist/security/security-testing-framework.js +0 -364
  287. package/dist/security/security-testing-framework.js.map +0 -1
  288. package/dist/security/simulation/attackSimulation.d.ts +0 -93
  289. package/dist/security/simulation/attackSimulation.d.ts.map +0 -1
  290. package/dist/security/simulation/attackSimulation.js +0 -341
  291. package/dist/security/simulation/attackSimulation.js.map +0 -1
  292. package/dist/security/strategic-operations.d.ts +0 -100
  293. package/dist/security/strategic-operations.d.ts.map +0 -1
  294. package/dist/security/strategic-operations.js +0 -276
  295. package/dist/security/strategic-operations.js.map +0 -1
  296. package/dist/security/tool-security-wrapper.d.ts +0 -58
  297. package/dist/security/tool-security-wrapper.d.ts.map +0 -1
  298. package/dist/security/tool-security-wrapper.js +0 -156
  299. package/dist/security/tool-security-wrapper.js.map +0 -1
  300. package/dist/shell/claudeCodeStreamHandler.d.ts +0 -145
  301. package/dist/shell/claudeCodeStreamHandler.d.ts.map +0 -1
  302. package/dist/shell/claudeCodeStreamHandler.js +0 -322
  303. package/dist/shell/claudeCodeStreamHandler.js.map +0 -1
  304. package/dist/shell/inputQueueManager.d.ts +0 -144
  305. package/dist/shell/inputQueueManager.d.ts.map +0 -1
  306. package/dist/shell/inputQueueManager.js +0 -290
  307. package/dist/shell/inputQueueManager.js.map +0 -1
  308. package/dist/shell/metricsTracker.d.ts +0 -60
  309. package/dist/shell/metricsTracker.d.ts.map +0 -1
  310. package/dist/shell/metricsTracker.js +0 -119
  311. package/dist/shell/metricsTracker.js.map +0 -1
  312. package/dist/shell/streamingOutputManager.d.ts +0 -115
  313. package/dist/shell/streamingOutputManager.d.ts.map +0 -1
  314. package/dist/shell/streamingOutputManager.js +0 -225
  315. package/dist/shell/streamingOutputManager.js.map +0 -1
  316. package/dist/tools/securityTools.d.ts +0 -22
  317. package/dist/tools/securityTools.d.ts.map +0 -1
  318. package/dist/tools/securityTools.js +0 -448
  319. package/dist/tools/securityTools.js.map +0 -1
  320. package/dist/ui/persistentPrompt.d.ts +0 -50
  321. package/dist/ui/persistentPrompt.d.ts.map +0 -1
  322. package/dist/ui/persistentPrompt.js +0 -92
  323. package/dist/ui/persistentPrompt.js.map +0 -1
  324. package/dist/ui/terminalUISchema.d.ts +0 -195
  325. package/dist/ui/terminalUISchema.d.ts.map +0 -1
  326. package/dist/ui/terminalUISchema.js +0 -113
  327. package/dist/ui/terminalUISchema.js.map +0 -1
  328. package/scripts/deploy-security-capabilities.js +0 -178
@@ -1,296 +0,0 @@
1
- /**
2
- * Active Stack Security Module
3
- *
4
- * Ensures Erosolar CLI only operates on the active stack and nothing else.
5
- * Implements strict security rules to prevent vulnerabilities and unauthorized operations.
6
- *
7
- * @license MIT
8
- * @author Bo Shang
9
- *
10
- * DISCLAIMER: This software is provided for security testing and defensive purposes only.
11
- * Users are solely responsible for ensuring their use complies with applicable laws.
12
- */
13
- export class ActiveStackSecurity {
14
- config;
15
- securityLog = [];
16
- constructor(config) {
17
- this.config = {
18
- enabled: true,
19
- allowedScopes: {
20
- cwd: true,
21
- nodeProjects: true,
22
- gitRepos: true,
23
- tempDirs: true,
24
- },
25
- blockedOperations: {
26
- systemFiles: true,
27
- unauthorizedNetworking: true,
28
- outOfScopeFiles: true,
29
- privilegedOps: true,
30
- },
31
- validation: {
32
- workspaceContext: true,
33
- pathValidation: true,
34
- patternDetection: true,
35
- securityLogging: true,
36
- },
37
- ...config,
38
- };
39
- }
40
- /**
41
- * Validate a file operation
42
- */
43
- validateFileOperation(filePath, operation) {
44
- if (!this.config.enabled) {
45
- return { allowed: true, severity: 'low' };
46
- }
47
- const normalizedPath = this.resolvePath(filePath);
48
- const cwd = process.cwd();
49
- // Check if path is within allowed scopes
50
- const scopeCheck = this.validatePathScope(normalizedPath, cwd);
51
- if (!scopeCheck.allowed) {
52
- this.logSecurityEvent({
53
- type: 'file_operation_blocked',
54
- severity: 'high',
55
- operation,
56
- filePath: normalizedPath,
57
- reason: scopeCheck.reason || 'Unknown reason',
58
- timestamp: new Date(),
59
- });
60
- return scopeCheck;
61
- }
62
- // Check for suspicious patterns
63
- const patternCheck = this.detectSuspiciousPatterns(normalizedPath);
64
- if (!patternCheck.allowed) {
65
- this.logSecurityEvent({
66
- type: 'suspicious_pattern_detected',
67
- severity: patternCheck.severity,
68
- operation,
69
- filePath: normalizedPath,
70
- reason: patternCheck.reason || 'Unknown reason',
71
- timestamp: new Date(),
72
- });
73
- return patternCheck;
74
- }
75
- // Check for system file protection
76
- const systemCheck = this.validateSystemFileProtection(normalizedPath);
77
- if (!systemCheck.allowed) {
78
- this.logSecurityEvent({
79
- type: 'system_file_protection',
80
- severity: systemCheck.severity,
81
- operation,
82
- filePath: normalizedPath,
83
- reason: systemCheck.reason || 'Unknown reason',
84
- timestamp: new Date(),
85
- });
86
- return systemCheck;
87
- }
88
- return { allowed: true, severity: 'low' };
89
- }
90
- /**
91
- * Validate a network operation
92
- */
93
- validateNetworkOperation(target, operation) {
94
- if (!this.config.enabled) {
95
- return { allowed: true, severity: 'low' };
96
- }
97
- // Check for localhost/127.0.0.1 operations (allowed for development)
98
- if (this.isLocalhost(target)) {
99
- return { allowed: true, severity: 'low' };
100
- }
101
- // Check for suspicious domains
102
- const domainCheck = this.validateDomain(target);
103
- if (!domainCheck.allowed) {
104
- this.logSecurityEvent({
105
- type: 'network_operation_blocked',
106
- severity: domainCheck.severity,
107
- operation,
108
- target,
109
- reason: domainCheck.reason || 'Unknown reason',
110
- timestamp: new Date(),
111
- });
112
- return domainCheck;
113
- }
114
- return { allowed: true, severity: 'low' };
115
- }
116
- /**
117
- * Validate a command execution
118
- */
119
- validateCommandExecution(command) {
120
- if (!this.config.enabled) {
121
- return { allowed: true, severity: 'low' };
122
- }
123
- // Check for dangerous commands
124
- const commandCheck = this.validateCommandSafety(command);
125
- if (!commandCheck.allowed) {
126
- this.logSecurityEvent({
127
- type: 'dangerous_command_blocked',
128
- severity: commandCheck.severity,
129
- operation: 'execute',
130
- command,
131
- reason: commandCheck.reason || 'Unknown reason',
132
- timestamp: new Date(),
133
- });
134
- return commandCheck;
135
- }
136
- return { allowed: true, severity: 'low' };
137
- }
138
- /**
139
- * Get security log
140
- */
141
- getSecurityLog() {
142
- return [...this.securityLog];
143
- }
144
- /**
145
- * Clear security log
146
- */
147
- clearSecurityLog() {
148
- this.securityLog = [];
149
- }
150
- validatePathScope(filePath, cwd) {
151
- // Check if path is within current working directory
152
- if (!filePath.startsWith(cwd)) {
153
- return {
154
- allowed: false,
155
- reason: 'File operation outside current working directory',
156
- severity: 'high',
157
- details: { filePath, cwd },
158
- };
159
- }
160
- // Check for node_modules protection
161
- if (filePath.includes('node_modules') && !filePath.includes(`${cwd}/node_modules`)) {
162
- return {
163
- allowed: false,
164
- reason: 'Access to external node_modules directory',
165
- severity: 'high',
166
- details: { filePath, cwd },
167
- };
168
- }
169
- // Check for system directory protection
170
- const systemDirs = ['/etc', '/var', '/usr', '/bin', '/sbin', '/lib', '/sys', '/proc'];
171
- for (const dir of systemDirs) {
172
- if (filePath.startsWith(dir)) {
173
- return {
174
- allowed: false,
175
- reason: 'Access to system directory',
176
- severity: 'critical',
177
- details: { filePath, systemDir: dir },
178
- };
179
- }
180
- }
181
- return { allowed: true, severity: 'low' };
182
- }
183
- detectSuspiciousPatterns(filePath) {
184
- const suspiciousPatterns = [
185
- { pattern: /\.(pem|key|env|secret|config)$/i, severity: 'high', reason: 'Sensitive file extension' },
186
- { pattern: /(password|secret|token|api[_-]?key)/i, severity: 'medium', reason: 'Potential credential file' },
187
- { pattern: /\.(bashrc|bash_profile|zshrc|profile)$/, severity: 'medium', reason: 'Shell configuration file' },
188
- { pattern: /\.(git|ssh)\/config$/, severity: 'medium', reason: 'Git/SSH configuration' },
189
- ];
190
- for (const { pattern, severity, reason } of suspiciousPatterns) {
191
- if (pattern.test(filePath)) {
192
- return {
193
- allowed: false,
194
- reason: `${reason} detected`,
195
- severity: severity,
196
- details: { filePath, pattern: pattern.source },
197
- };
198
- }
199
- }
200
- return { allowed: true, severity: 'low' };
201
- }
202
- validateSystemFileProtection(filePath) {
203
- const systemFiles = [
204
- '/etc/passwd', '/etc/shadow', '/etc/hosts', '/etc/resolv.conf',
205
- '/etc/ssh/ssh_config', '/etc/ssh/sshd_config',
206
- '/var/log/', '/var/spool/', '/var/mail/',
207
- '/usr/bin/', '/usr/sbin/', '/usr/lib/',
208
- ];
209
- for (const sysFile of systemFiles) {
210
- if (filePath.startsWith(sysFile)) {
211
- return {
212
- allowed: false,
213
- reason: 'Access to system file',
214
- severity: 'critical',
215
- details: { filePath, systemFile: sysFile },
216
- };
217
- }
218
- }
219
- return { allowed: true, severity: 'low' };
220
- }
221
- isLocalhost(target) {
222
- const localhostPatterns = [
223
- 'localhost',
224
- '127.0.0.1',
225
- '::1',
226
- '0.0.0.0',
227
- ];
228
- return localhostPatterns.some(pattern => target.includes(pattern));
229
- }
230
- validateDomain(target) {
231
- const suspiciousDomains = [
232
- 'malicious.com',
233
- 'evil.org',
234
- 'hacker.net',
235
- // Add more suspicious domains as needed
236
- ];
237
- for (const domain of suspiciousDomains) {
238
- if (target.includes(domain)) {
239
- return {
240
- allowed: false,
241
- reason: 'Suspicious domain detected',
242
- severity: 'high',
243
- details: { target, domain },
244
- };
245
- }
246
- }
247
- return { allowed: true, severity: 'low' };
248
- }
249
- validateCommandSafety(command) {
250
- const dangerousCommands = [
251
- { pattern: /rm\s+-rf/, severity: 'critical', reason: 'Recursive force delete' },
252
- { pattern: /chmod\s+[0-7]{3,4}\s+/, severity: 'high', reason: 'File permission modification' },
253
- { pattern: /chown\s+[^\s]+\s+/, severity: 'high', reason: 'File ownership change' },
254
- { pattern: /dd\s+if=.*of=/, severity: 'critical', reason: 'Disk cloning/destruction' },
255
- { pattern: /mkfs\./, severity: 'critical', reason: 'Filesystem creation' },
256
- { pattern: /fdisk\s+/, severity: 'critical', reason: 'Partition manipulation' },
257
- { pattern: /mount\s+/, severity: 'high', reason: 'Filesystem mounting' },
258
- { pattern: /umount\s+/, severity: 'high', reason: 'Filesystem unmounting' },
259
- { pattern: /passwd\s+/, severity: 'high', reason: 'Password change' },
260
- { pattern: /useradd\s+/, severity: 'high', reason: 'User creation' },
261
- { pattern: /userdel\s+/, severity: 'high', reason: 'User deletion' },
262
- ];
263
- for (const { pattern, severity, reason } of dangerousCommands) {
264
- if (pattern.test(command)) {
265
- return {
266
- allowed: false,
267
- reason: `${reason} command detected`,
268
- severity: severity,
269
- details: { command, pattern: pattern.source },
270
- };
271
- }
272
- }
273
- return { allowed: true, severity: 'low' };
274
- }
275
- logSecurityEvent(event) {
276
- if (this.config.validation.securityLogging) {
277
- this.securityLog.push(event);
278
- // Keep log size manageable
279
- if (this.securityLog.length > 1000) {
280
- this.securityLog = this.securityLog.slice(-500);
281
- }
282
- }
283
- }
284
- resolvePath(filePath) {
285
- // Simple path resolution - in a real implementation, use path.resolve
286
- if (filePath.startsWith('/')) {
287
- return filePath;
288
- }
289
- return `${process.cwd()}/${filePath}`;
290
- }
291
- }
292
- /**
293
- * Global active stack security instance
294
- */
295
- export const activeStackSecurity = new ActiveStackSecurity();
296
- //# sourceMappingURL=active-stack-security.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"active-stack-security.js","sourceRoot":"","sources":["../../src/security/active-stack-security.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AA0DH,MAAM,OAAO,mBAAmB;IACtB,MAAM,CAA4B;IAClC,WAAW,GAAoB,EAAE,CAAC;IAE1C,YAAY,MAA2C;QACrD,IAAI,CAAC,MAAM,GAAG;YACZ,OAAO,EAAE,IAAI;YACb,aAAa,EAAE;gBACb,GAAG,EAAE,IAAI;gBACT,YAAY,EAAE,IAAI;gBAClB,QAAQ,EAAE,IAAI;gBACd,QAAQ,EAAE,IAAI;aACf;YACD,iBAAiB,EAAE;gBACjB,WAAW,EAAE,IAAI;gBACjB,sBAAsB,EAAE,IAAI;gBAC5B,eAAe,EAAE,IAAI;gBACrB,aAAa,EAAE,IAAI;aACpB;YACD,UAAU,EAAE;gBACV,gBAAgB,EAAE,IAAI;gBACtB,cAAc,EAAE,IAAI;gBACpB,gBAAgB,EAAE,IAAI;gBACtB,eAAe,EAAE,IAAI;aACtB;YACD,GAAG,MAAM;SACV,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,qBAAqB,CAAC,QAAgB,EAAE,SAAsC;QAC5E,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;YACzB,OAA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;AAcD;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,IAAI,mBAAmB,EAAE,CAAC"}
@@ -1,92 +0,0 @@
1
- /**
2
- * Advanced Persistence Research Toolkit
3
- *
4
- * Enhanced persistence mechanism analysis for comprehensive security research
5
- * across enterprise environments, cloud platforms, and nation-state level targets.
6
- *
7
- * This module extends the existing persistence research with:
8
- * - Advanced enterprise persistence techniques
9
- * - Cloud platform persistence (AWS, Azure, GCP)
10
- * - Container and orchestration persistence
11
- * - Network and infrastructure persistence
12
- * - Detection evasion and anti-forensics
13
- *
14
- * LEGAL NOTICE:
15
- * For authorized security research, penetration testing, and red team exercises only.
16
- * Requires explicit authorization and scope definition.
17
- */
18
- export interface AdvancedPersistenceTechnique {
19
- id: string;
20
- name: string;
21
- category: PersistenceCategory;
22
- platform: Platform;
23
- complexity: 'low' | 'medium' | 'high' | 'advanced';
24
- stealth: number;
25
- detectionDifficulty: 'easy' | 'medium' | 'hard' | 'very-hard';
26
- mitreIds: string[];
27
- description: string;
28
- implementation: string[];
29
- detectionMethods: string[];
30
- countermeasures: string[];
31
- indicators: string[];
32
- tools: string[];
33
- }
34
- export declare enum PersistenceCategory {
35
- ENTERPRISE = "enterprise",
36
- CLOUD = "cloud",
37
- CONTAINER = "container",
38
- NETWORK = "network",
39
- MEMORY = "memory",
40
- BIOS_UEFI = "bios_uefi",
41
- HARDWARE = "hardware",
42
- SUPPLY_CHAIN = "supply_chain"
43
- }
44
- export declare enum Platform {
45
- WINDOWS = "windows",
46
- LINUX = "linux",
47
- MACOS = "macos",
48
- CROSS_PLATFORM = "cross-platform",
49
- AWS = "aws",
50
- AZURE = "azure",
51
- GCP = "gcp",
52
- KUBERNETES = "kubernetes",
53
- DOCKER = "docker",
54
- VMWARE = "vmware",
55
- NETWORK = "network"
56
- }
57
- /**
58
- * Advanced Enterprise Persistence Techniques
59
- */
60
- export declare const ENTERPRISE_PERSISTENCE_TECHNIQUES: AdvancedPersistenceTechnique[];
61
- /**
62
- * Cloud Platform Persistence Techniques
63
- */
64
- export declare const CLOUD_PERSISTENCE_TECHNIQUES: AdvancedPersistenceTechnique[];
65
- /**
66
- * Advanced Persistence Research Engine
67
- */
68
- export declare class AdvancedPersistenceResearchEngine {
69
- private techniques;
70
- constructor();
71
- /**
72
- * Get techniques by platform
73
- */
74
- getTechniquesByPlatform(platform: Platform): AdvancedPersistenceTechnique[];
75
- /**
76
- * Get techniques by category
77
- */
78
- getTechniquesByCategory(category: PersistenceCategory): AdvancedPersistenceTechnique[];
79
- /**
80
- * Get techniques by stealth rating
81
- */
82
- getTechniquesByStealth(minStealth: number): AdvancedPersistenceTechnique[];
83
- /**
84
- * Generate comprehensive persistence research report
85
- */
86
- generateResearchReport(targetPlatforms: Platform[]): string;
87
- }
88
- /**
89
- * Create a comprehensive persistence research toolkit
90
- */
91
- export declare function createPersistenceResearchToolkit(): AdvancedPersistenceResearchEngine;
92
- //# sourceMappingURL=advanced-persistence-research.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"advanced-persistence-research.d.ts","sourceRoot":"","sources":["../../src/security/advanced-persistence-research.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,MAAM,WAAW,4BAA4B;IAC3C,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,mBAAmB,CAAC;IAC9B,QAAQ,EAAE,QAAQ,CAAC;IACnB,UAAU,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,UAAU,CAAC;IACnD,OAAO,EAAE,MAAM,CAAC;IAChB,mBAAmB,EAAE,MAAM,GAAG,QAAQ,GAAG,MAAM,GAAG,WAAW,CAAC;IAC9D,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AAED,oBAAY,mBAAmB;IAC7B,UAAU,eAAe;IACzB,KAAK,UAAU;IACf,SAAS,cAAc;IACvB,OAAO,YAAY;IACnB,MAAM,WAAW;IACjB,SAAS,cAAc;IACvB,QAAQ,aAAa;IACrB,YAAY,iBAAiB;CAC9B;AAED,oBAAY,QAAQ;IAClB,OAAO,YAAY;IACnB,KAAK,UAAU;IACf,KAAK,UAAU;IACf,cAAc,mBAAmB;IACjC,GAAG,QAAQ;IACX,KAAK,UAAU;IACf,GAAG,QAAQ;IACX,UAAU,eAAe;IACzB,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,OAAO,YAAY;CACpB;AAED;;GAEG;AACH,eAAO,MAAM,iCAAiC,EAAE,4BAA4B,EAmC3E,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,4BAA4B,EAAE,4BAA4B,EAmCtE,CAAC;AAEF;;GAEG;AACH,qBAAa,iCAAiC;IAC5C,OAAO,CAAC,UAAU,CAAiC;;IASnD;;OAEG;IACH,uBAAuB,CAAC,QAAQ,EAAE,QAAQ,GAAG,4BAA4B,EAAE;IAI3E;;OAEG;IACH,uBAAuB,CAAC,QAAQ,EAAE,mBAAmB,GAAG,4BAA4B,EAAE;IAItF;;OAEG;IACH,sBAAsB,CAAC,UAAU,EAAE,MAAM,GAAG,4BAA4B,EAAE;IAI1E;;OAEG;IACH,sBAAsB,CAAC,eAAe,EAAE,QAAQ,EAAE,GAAG,MAAM;CA0C5D;AAED;;GAEG;AACH,wBAAgB,gCAAgC,sCAE/C"}
@@ -1,195 +0,0 @@
1
- /**
2
- * Advanced Persistence Research Toolkit
3
- *
4
- * Enhanced persistence mechanism analysis for comprehensive security research
5
- * across enterprise environments, cloud platforms, and nation-state level targets.
6
- *
7
- * This module extends the existing persistence research with:
8
- * - Advanced enterprise persistence techniques
9
- * - Cloud platform persistence (AWS, Azure, GCP)
10
- * - Container and orchestration persistence
11
- * - Network and infrastructure persistence
12
- * - Detection evasion and anti-forensics
13
- *
14
- * LEGAL NOTICE:
15
- * For authorized security research, penetration testing, and red team exercises only.
16
- * Requires explicit authorization and scope definition.
17
- */
18
- export var PersistenceCategory;
19
- (function (PersistenceCategory) {
20
- PersistenceCategory["ENTERPRISE"] = "enterprise";
21
- PersistenceCategory["CLOUD"] = "cloud";
22
- PersistenceCategory["CONTAINER"] = "container";
23
- PersistenceCategory["NETWORK"] = "network";
24
- PersistenceCategory["MEMORY"] = "memory";
25
- PersistenceCategory["BIOS_UEFI"] = "bios_uefi";
26
- PersistenceCategory["HARDWARE"] = "hardware";
27
- PersistenceCategory["SUPPLY_CHAIN"] = "supply_chain";
28
- })(PersistenceCategory || (PersistenceCategory = {}));
29
- export var Platform;
30
- (function (Platform) {
31
- Platform["WINDOWS"] = "windows";
32
- Platform["LINUX"] = "linux";
33
- Platform["MACOS"] = "macos";
34
- Platform["CROSS_PLATFORM"] = "cross-platform";
35
- Platform["AWS"] = "aws";
36
- Platform["AZURE"] = "azure";
37
- Platform["GCP"] = "gcp";
38
- Platform["KUBERNETES"] = "kubernetes";
39
- Platform["DOCKER"] = "docker";
40
- Platform["VMWARE"] = "vmware";
41
- Platform["NETWORK"] = "network";
42
- })(Platform || (Platform = {}));
43
- /**
44
- * Advanced Enterprise Persistence Techniques
45
- */
46
- export const ENTERPRISE_PERSISTENCE_TECHNIQUES = [
47
- {
48
- id: 'ent-active-directory-golden-ticket',
49
- name: 'Active Directory Golden Ticket',
50
- category: PersistenceCategory.ENTERPRISE,
51
- platform: Platform.WINDOWS,
52
- complexity: 'advanced',
53
- stealth: 5,
54
- detectionDifficulty: 'very-hard',
55
- mitreIds: ['T1558.001'],
56
- description: 'Forged Kerberos ticket granting ticket (TGT) with unlimited lifetime',
57
- implementation: [
58
- 'Extract krbtgt account hash from domain controller',
59
- 'Forge TGT with extended lifetime and privileges',
60
- 'Use forged TGT to access any domain resource'
61
- ],
62
- detectionMethods: [
63
- 'Monitor for TGTs with unusual lifetimes (>10 hours)',
64
- 'Check for TGTs issued from non-DC systems',
65
- 'Analyze Kerberos event logs for anomalies',
66
- 'Use Microsoft ATA or Azure Sentinel'
67
- ],
68
- countermeasures: [
69
- 'Regularly rotate krbtgt account password (twice)',
70
- 'Implement LAPS for local admin passwords',
71
- 'Enable advanced audit policies',
72
- 'Use Protected Users group'
73
- ],
74
- indicators: [
75
- 'Kerberos TGT requests with extended lifetimes',
76
- 'Authentication from unusual locations',
77
- 'Multiple failed TGT validation attempts'
78
- ],
79
- tools: ['Mimikatz', 'Rubeus', 'Impacket']
80
- }
81
- ];
82
- /**
83
- * Cloud Platform Persistence Techniques
84
- */
85
- export const CLOUD_PERSISTENCE_TECHNIQUES = [
86
- {
87
- id: 'cloud-aws-backdoor-role',
88
- name: 'AWS IAM Role Backdoor',
89
- category: PersistenceCategory.CLOUD,
90
- platform: Platform.AWS,
91
- complexity: 'medium',
92
- stealth: 3,
93
- detectionDifficulty: 'medium',
94
- mitreIds: ['T1078.004'],
95
- description: 'Creates or modifies IAM roles with external entity trust for persistence',
96
- implementation: [
97
- 'Create IAM role with external IDP trust (SAML/OIDC)',
98
- 'Modify existing role trust policy',
99
- 'Add cross-account access with broad permissions'
100
- ],
101
- detectionMethods: [
102
- 'Monitor CloudTrail for role modifications',
103
- 'Analyze IAM role trust policies',
104
- 'Check for external entity trusts',
105
- 'Use AWS Config rules'
106
- ],
107
- countermeasures: [
108
- 'Implement least privilege for IAM roles',
109
- 'Monitor for external trust modifications',
110
- 'Use AWS Organizations SCPs',
111
- 'Regular IAM security assessments'
112
- ],
113
- indicators: [
114
- 'IAM role policy modifications',
115
- 'New external identity provider trusts',
116
- 'Cross-account role assumptions'
117
- ],
118
- tools: ['AWS CLI', 'Pacu', 'CloudSploit']
119
- }
120
- ];
121
- /**
122
- * Advanced Persistence Research Engine
123
- */
124
- export class AdvancedPersistenceResearchEngine {
125
- techniques;
126
- constructor() {
127
- this.techniques = [
128
- ...ENTERPRISE_PERSISTENCE_TECHNIQUES,
129
- ...CLOUD_PERSISTENCE_TECHNIQUES
130
- ];
131
- }
132
- /**
133
- * Get techniques by platform
134
- */
135
- getTechniquesByPlatform(platform) {
136
- return this.techniques.filter(tech => tech.platform === platform);
137
- }
138
- /**
139
- * Get techniques by category
140
- */
141
- getTechniquesByCategory(category) {
142
- return this.techniques.filter(tech => tech.category === category);
143
- }
144
- /**
145
- * Get techniques by stealth rating
146
- */
147
- getTechniquesByStealth(minStealth) {
148
- return this.techniques.filter(tech => tech.stealth >= minStealth);
149
- }
150
- /**
151
- * Generate comprehensive persistence research report
152
- */
153
- generateResearchReport(targetPlatforms) {
154
- const report = [];
155
- report.push('='.repeat(80));
156
- report.push('ADVANCED PERSISTENCE RESEARCH REPORT');
157
- report.push('='.repeat(80));
158
- report.push(`Generated: ${new Date().toISOString()}`);
159
- report.push(`Target Platforms: ${targetPlatforms.join(', ')}`);
160
- report.push('');
161
- for (const platform of targetPlatforms) {
162
- const techniques = this.getTechniquesByPlatform(platform);
163
- if (techniques.length > 0) {
164
- report.push(`## ${platform.toUpperCase()} PERSISTENCE TECHNIQUES`);
165
- report.push('');
166
- for (const tech of techniques) {
167
- report.push(`### ${tech.name}`);
168
- report.push(`- **Stealth**: ${tech.stealth}/5`);
169
- report.push(`- **Complexity**: ${tech.complexity}`);
170
- report.push(`- **Detection Difficulty**: ${tech.detectionDifficulty}`);
171
- report.push(`- **MITRE ATT&CK**: ${tech.mitreIds.join(', ')}`);
172
- report.push(`- **Description**: ${tech.description}`);
173
- report.push('');
174
- report.push('#### Implementation Steps:');
175
- tech.implementation.forEach(step => report.push(` - ${step}`));
176
- report.push('');
177
- report.push('#### Detection Methods:');
178
- tech.detectionMethods.forEach(method => report.push(` - ${method}`));
179
- report.push('');
180
- report.push('#### Countermeasures:');
181
- tech.countermeasures.forEach(countermeasure => report.push(` - ${countermeasure}`));
182
- report.push('');
183
- }
184
- }
185
- }
186
- return report.join('\n');
187
- }
188
- }
189
- /**
190
- * Create a comprehensive persistence research toolkit
191
- */
192
- export function createPersistenceResearchToolkit() {
193
- return new AdvancedPersistenceResearchEngine();
194
- }
195
- //# sourceMappingURL=advanced-persistence-research.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"advanced-persistence-research.js","sourceRoot":"","sources":["../../src/security/advanced-persistence-research.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAmBH,MAAM,CAAN,IAAY,mBASX;AATD,WAAY,mBAAmB;IAC7B,gDAAyB,CAAA;IACzB,sCAAe,CAAA;IACf,8CAAuB,CAAA;IACvB,0CAAmB,CAAA;IACnB,wCAAiB,CAAA;IACjB,8CAAuB,CAAA;IACvB,4CAAqB,CAAA;IACrB,oDAA6B,CAAA;AAC/B,CAAC,EATW,mBAAmB,KAAnB,mBAAmB,QAS9B;AAED,MAAM,CAAN,IAAY,QAYX;AAZD,WAAY,QAAQ;IAClB,+BAAmB,CAAA;IACnB,2BAAe,CAAA;IACf,2BAAe,CAAA;IACf,6CAAiC,CAAA;IACjC,uBAAW,CAAA;IACX,2BAAe,CAAA;IACf,uBAAW,CAAA;IACX,qCAAyB,CAAA;IACzB,6BAAiB,CAAA;IACjB,6BAAiB,CAAA;IACjB,+BAAmB,CAAA;AACrB,CAAC,EAZW,QAAQ,KAAR,QAAQ,QAYnB;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,iCAAiC,GAAmC;IAC/E;QACE,EAAE,EAAE,oCAAoC;QACxC,IAAI,EAAE,gCAAgC;QACtC,QAAQ,EAAE,mBAAmB,CAAC,UAAU;QACxC,QAAQ,EAAE,QAAQ,CAAC,OAAO;QAC1B,UAAU,EAAE,UAAU;QACtB,OAAO,EAAE,CAAC;QACV,mBAAmB,EAAE,WAAW;QAChC,QAAQ,EAAE,CAAC,WAAW,CAAC;QACvB,WAAW,EAAE,sEAAsE;QACnF,cAAc,EAAE;YACd,oDAAoD;YACpD,iDAAiD;YACjD,8CAA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