@neurosec/sentry 1.0.20 → 1.1.1
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 +4 -0
- package/dist/api-auth.d.ts +31 -0
- package/dist/api-auth.d.ts.map +1 -0
- package/dist/api-auth.js +105 -0
- package/dist/api-auth.js.map +1 -0
- package/dist/api-auth.test.d.ts +2 -0
- package/dist/api-auth.test.d.ts.map +1 -0
- package/dist/api-auth.test.js +89 -0
- package/dist/api-auth.test.js.map +1 -0
- package/dist/api.d.ts +8 -7
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +141 -134
- package/dist/api.js.map +1 -1
- package/dist/cli.d.ts +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +107 -14
- package/dist/cli.js.map +1 -1
- package/dist/cli.test.d.ts +2 -0
- package/dist/cli.test.d.ts.map +1 -0
- package/dist/cli.test.js +68 -0
- package/dist/cli.test.js.map +1 -0
- package/dist/config.d.ts +30 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +68 -2
- package/dist/config.js.map +1 -1
- package/dist/config.test.d.ts +2 -0
- package/dist/config.test.d.ts.map +1 -0
- package/dist/config.test.js +121 -0
- package/dist/config.test.js.map +1 -0
- package/dist/discovery-win.d.ts +4 -0
- package/dist/discovery-win.d.ts.map +1 -0
- package/dist/discovery-win.js +153 -0
- package/dist/discovery-win.js.map +1 -0
- package/dist/discovery.d.ts.map +1 -1
- package/dist/discovery.js +23 -97
- package/dist/discovery.js.map +1 -1
- package/dist/discovery.test.js +18 -109
- package/dist/discovery.test.js.map +1 -1
- package/dist/enforcement/file-monitor.d.ts +9 -0
- package/dist/enforcement/file-monitor.d.ts.map +1 -1
- package/dist/enforcement/file-monitor.js +9 -2
- package/dist/enforcement/file-monitor.js.map +1 -1
- package/dist/enforcement/network-monitor.d.ts.map +1 -1
- package/dist/enforcement/network-monitor.js +350 -9
- package/dist/enforcement/network-monitor.js.map +1 -1
- package/dist/enforcement/network-monitor.test.d.ts +2 -0
- package/dist/enforcement/network-monitor.test.d.ts.map +1 -0
- package/dist/enforcement/network-monitor.test.js +52 -0
- package/dist/enforcement/network-monitor.test.js.map +1 -0
- package/dist/enforcement/policy-executor.d.ts +24 -1
- package/dist/enforcement/policy-executor.d.ts.map +1 -1
- package/dist/enforcement/policy-executor.js +213 -69
- package/dist/enforcement/policy-executor.js.map +1 -1
- package/dist/enforcement/policy-executor.test.d.ts +2 -0
- package/dist/enforcement/policy-executor.test.d.ts.map +1 -0
- package/dist/enforcement/policy-executor.test.js +46 -0
- package/dist/enforcement/policy-executor.test.js.map +1 -0
- package/dist/enforcement/target-validator.d.ts +37 -0
- package/dist/enforcement/target-validator.d.ts.map +1 -0
- package/dist/enforcement/target-validator.js +0 -0
- package/dist/enforcement/target-validator.js.map +1 -0
- package/dist/enforcement/target-validator.test.d.ts +2 -0
- package/dist/enforcement/target-validator.test.d.ts.map +1 -0
- package/dist/enforcement/target-validator.test.js +103 -0
- package/dist/enforcement/target-validator.test.js.map +1 -0
- package/dist/http-client.d.ts +35 -0
- package/dist/http-client.d.ts.map +1 -0
- package/dist/http-client.js +179 -0
- package/dist/http-client.js.map +1 -0
- package/dist/http-client.test.d.ts +2 -0
- package/dist/http-client.test.d.ts.map +1 -0
- package/dist/http-client.test.js +175 -0
- package/dist/http-client.test.js.map +1 -0
- package/dist/index.js +190 -114
- package/dist/index.js.map +1 -1
- package/dist/launcher.d.ts +33 -0
- package/dist/launcher.d.ts.map +1 -0
- package/dist/launcher.js +425 -0
- package/dist/launcher.js.map +1 -0
- package/dist/launcher.test.d.ts +2 -0
- package/dist/launcher.test.d.ts.map +1 -0
- package/dist/launcher.test.js +109 -0
- package/dist/launcher.test.js.map +1 -0
- package/dist/proxy/cert-manager.d.ts +24 -0
- package/dist/proxy/cert-manager.d.ts.map +1 -0
- package/dist/proxy/cert-manager.js +117 -0
- package/dist/proxy/cert-manager.js.map +1 -0
- package/dist/proxy/cert-manager.test.d.ts +2 -0
- package/dist/proxy/cert-manager.test.d.ts.map +1 -0
- package/dist/proxy/cert-manager.test.js +70 -0
- package/dist/proxy/cert-manager.test.js.map +1 -0
- package/dist/proxy/index.d.ts +61 -0
- package/dist/proxy/index.d.ts.map +1 -0
- package/dist/proxy/index.js +74 -0
- package/dist/proxy/index.js.map +1 -0
- package/dist/proxy/policy-enforcer.d.ts +30 -0
- package/dist/proxy/policy-enforcer.d.ts.map +1 -0
- package/dist/proxy/policy-enforcer.js +143 -0
- package/dist/proxy/policy-enforcer.js.map +1 -0
- package/dist/proxy/proxy-server.d.ts +42 -0
- package/dist/proxy/proxy-server.d.ts.map +1 -0
- package/dist/proxy/proxy-server.js +652 -0
- package/dist/proxy/proxy-server.js.map +1 -0
- package/dist/proxy/redaction-engine.d.ts +4 -0
- package/dist/proxy/redaction-engine.d.ts.map +1 -0
- package/dist/proxy/redaction-engine.js +50 -0
- package/dist/proxy/redaction-engine.js.map +1 -0
- package/dist/proxy/response-redaction.test.d.ts +2 -0
- package/dist/proxy/response-redaction.test.d.ts.map +1 -0
- package/dist/proxy/response-redaction.test.js +125 -0
- package/dist/proxy/response-redaction.test.js.map +1 -0
- package/dist/proxy/threat-engine.d.ts +22 -0
- package/dist/proxy/threat-engine.d.ts.map +1 -0
- package/dist/proxy/threat-engine.js +291 -0
- package/dist/proxy/threat-engine.js.map +1 -0
- package/dist/proxy/threat-engine.test.d.ts +2 -0
- package/dist/proxy/threat-engine.test.d.ts.map +1 -0
- package/dist/proxy/threat-engine.test.js +27 -0
- package/dist/proxy/threat-engine.test.js.map +1 -0
- package/dist/redirect/env-injector.d.ts +72 -0
- package/dist/redirect/env-injector.d.ts.map +1 -0
- package/dist/redirect/env-injector.js +177 -0
- package/dist/redirect/env-injector.js.map +1 -0
- package/dist/redirect/env-injector.test.d.ts +2 -0
- package/dist/redirect/env-injector.test.d.ts.map +1 -0
- package/dist/redirect/env-injector.test.js +91 -0
- package/dist/redirect/env-injector.test.js.map +1 -0
- package/dist/redirect/index.d.ts +3 -0
- package/dist/redirect/index.d.ts.map +1 -0
- package/dist/redirect/index.js +8 -0
- package/dist/redirect/index.js.map +1 -0
- package/dist/redirect/platform-redirect.d.ts +42 -0
- package/dist/redirect/platform-redirect.d.ts.map +1 -0
- package/dist/redirect/platform-redirect.js +229 -0
- package/dist/redirect/platform-redirect.js.map +1 -0
- package/dist/redirect/platform-redirect.test.d.ts +2 -0
- package/dist/redirect/platform-redirect.test.d.ts.map +1 -0
- package/dist/redirect/platform-redirect.test.js +76 -0
- package/dist/redirect/platform-redirect.test.js.map +1 -0
- package/dist/sandbox/index.d.ts +23 -2
- package/dist/sandbox/index.d.ts.map +1 -1
- package/dist/sandbox/index.js +24 -7
- package/dist/sandbox/index.js.map +1 -1
- package/dist/sandbox/linux-sandbox.d.ts +13 -2
- package/dist/sandbox/linux-sandbox.d.ts.map +1 -1
- package/dist/sandbox/linux-sandbox.js +61 -27
- package/dist/sandbox/linux-sandbox.js.map +1 -1
- package/dist/sandbox/macos-sandbox.d.ts +15 -4
- package/dist/sandbox/macos-sandbox.d.ts.map +1 -1
- package/dist/sandbox/macos-sandbox.js +36 -18
- package/dist/sandbox/macos-sandbox.js.map +1 -1
- package/dist/sandbox/sandbox-result.test.d.ts +2 -0
- package/dist/sandbox/sandbox-result.test.d.ts.map +1 -0
- package/dist/sandbox/sandbox-result.test.js +87 -0
- package/dist/sandbox/sandbox-result.test.js.map +1 -0
- package/dist/sandbox/windows-sandbox.d.ts +34 -0
- package/dist/sandbox/windows-sandbox.d.ts.map +1 -0
- package/dist/sandbox/windows-sandbox.js +161 -0
- package/dist/sandbox/windows-sandbox.js.map +1 -0
- package/dist/setup.d.ts.map +1 -1
- package/dist/setup.js +33 -43
- package/dist/setup.js.map +1 -1
- package/dist/skill-authz/skill-evaluator.d.ts +30 -0
- package/dist/skill-authz/skill-evaluator.d.ts.map +1 -1
- package/dist/skill-authz/skill-evaluator.js +161 -30
- package/dist/skill-authz/skill-evaluator.js.map +1 -1
- package/dist/skill-authz/skill-evaluator.test.d.ts +2 -0
- package/dist/skill-authz/skill-evaluator.test.d.ts.map +1 -0
- package/dist/skill-authz/skill-evaluator.test.js +127 -0
- package/dist/skill-authz/skill-evaluator.test.js.map +1 -0
- package/dist/telemetry.d.ts +2 -8
- package/dist/telemetry.d.ts.map +1 -1
- package/dist/telemetry.js +17 -147
- package/dist/telemetry.js.map +1 -1
- package/dist/types.d.ts +48 -105
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +34 -1
- package/dist/types.js.map +1 -1
- package/package.json +7 -3
- package/scripts/install-sentry-windows.ps1 +217 -0
- package/dist/action-logger.d.ts +0 -40
- package/dist/action-logger.d.ts.map +0 -1
- package/dist/action-logger.js +0 -252
- package/dist/action-logger.js.map +0 -1
- package/dist/agent-registry.d.ts +0 -24
- package/dist/agent-registry.d.ts.map +0 -1
- package/dist/agent-registry.js +0 -176
- package/dist/agent-registry.js.map +0 -1
- package/dist/anomaly-detector.d.ts +0 -26
- package/dist/anomaly-detector.d.ts.map +0 -1
- package/dist/anomaly-detector.js +0 -299
- package/dist/anomaly-detector.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neurosec/sentry",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "NeuroShield Sentry — host-level agent protection daemon. Detects and blocks malicious AI agent actions at the OS level.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai-security",
|
|
@@ -28,7 +28,8 @@
|
|
|
28
28
|
},
|
|
29
29
|
"os": [
|
|
30
30
|
"linux",
|
|
31
|
-
"darwin"
|
|
31
|
+
"darwin",
|
|
32
|
+
"win32"
|
|
32
33
|
],
|
|
33
34
|
"preferGlobal": true,
|
|
34
35
|
"bin": {
|
|
@@ -50,7 +51,10 @@
|
|
|
50
51
|
"lint": "eslint src --ext .ts",
|
|
51
52
|
"test": "vitest run",
|
|
52
53
|
"prepack": "npm run build && node scripts/prepack.js",
|
|
53
|
-
"postinstall": "node scripts/postinstall.js"
|
|
54
|
+
"postinstall": "node scripts/postinstall.js",
|
|
55
|
+
"install-service:linux": "sudo bash scripts/install-sentry.sh",
|
|
56
|
+
"install-service:macos": "sudo bash scripts/install-sentry-macos.sh",
|
|
57
|
+
"install-service:win": "powershell -ExecutionPolicy Bypass -File scripts/install-sentry-windows.ps1"
|
|
54
58
|
},
|
|
55
59
|
"dependencies": {
|
|
56
60
|
"yaml": "^2.3.4",
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
# NeuroShield Sentry Daemon — Windows Installation Script
|
|
2
|
+
# Run as Administrator: powershell -ExecutionPolicy Bypass -File install-sentry-windows.ps1
|
|
3
|
+
param(
|
|
4
|
+
[string]$Mode = "monitor",
|
|
5
|
+
[string]$NeurosecUrl = "https://api.neurosec.ai",
|
|
6
|
+
[string]$OrgId = "",
|
|
7
|
+
[string]$Token = ""
|
|
8
|
+
)
|
|
9
|
+
|
|
10
|
+
$ErrorActionPreference = "Stop"
|
|
11
|
+
$SentryVersion = "1.0.0"
|
|
12
|
+
$InstallDir = "$env:ProgramFiles\NeuroShield\Sentry"
|
|
13
|
+
$ConfigDir = "$env:ProgramData\NeuroShield\Sentry"
|
|
14
|
+
$StateDir = "$env:ProgramData\NeuroShield\Sentry\state"
|
|
15
|
+
$LogDir = "$env:ProgramData\NeuroShield\Sentry\logs"
|
|
16
|
+
$BinPath = "$InstallDir\bin\neuroshield-sentryd.cmd"
|
|
17
|
+
$ConfigPath = "$ConfigDir\sentry.yaml"
|
|
18
|
+
$ServiceName = "NeuroShieldSentry"
|
|
19
|
+
|
|
20
|
+
Write-Host "============================================" -ForegroundColor Cyan
|
|
21
|
+
Write-Host " NeuroShield Sentry v$SentryVersion Installer (Windows)" -ForegroundColor Cyan
|
|
22
|
+
Write-Host " Mode: $Mode" -ForegroundColor Cyan
|
|
23
|
+
Write-Host "============================================" -ForegroundColor Cyan
|
|
24
|
+
|
|
25
|
+
# Check if running as admin
|
|
26
|
+
$isAdmin = ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)
|
|
27
|
+
if (-not $isAdmin) {
|
|
28
|
+
Write-Host "ERROR: This script must be run as Administrator" -ForegroundColor Red
|
|
29
|
+
exit 1
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
# Check Node.js
|
|
33
|
+
try {
|
|
34
|
+
$nodeVersion = node --version
|
|
35
|
+
Write-Host "Node.js found: $nodeVersion" -ForegroundColor Green
|
|
36
|
+
} catch {
|
|
37
|
+
Write-Host "ERROR: Node.js is required (>= 20)" -ForegroundColor Red
|
|
38
|
+
exit 1
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
# Create directories
|
|
42
|
+
Write-Host "Creating directories..." -ForegroundColor Yellow
|
|
43
|
+
New-Item -ItemType Directory -Force -Path $InstallDir | Out-Null
|
|
44
|
+
New-Item -ItemType Directory -Force -Path $ConfigDir | Out-Null
|
|
45
|
+
New-Item -ItemType Directory -Force -Path $StateDir | Out-Null
|
|
46
|
+
New-Item -ItemType Directory -Force -Path $LogDir | Out-Null
|
|
47
|
+
|
|
48
|
+
# Copy sentry package files
|
|
49
|
+
$scriptPath = Split-Path -Parent $MyInvocation.MyCommand.Path
|
|
50
|
+
$projectDir = Resolve-Path "$scriptPath\..\..\.."
|
|
51
|
+
$sentryPackage = "$projectDir\packages\sentry"
|
|
52
|
+
|
|
53
|
+
if (Test-Path "$sentryPackage\package.json") {
|
|
54
|
+
Write-Host "Building sentry daemon from source..." -ForegroundColor Yellow
|
|
55
|
+
|
|
56
|
+
# Copy dist
|
|
57
|
+
if (Test-Path "$sentryPackage\dist") {
|
|
58
|
+
Copy-Item -Path "$sentryPackage\dist\*" -Destination "$InstallDir" -Recurse -Force
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
# Copy node_modules
|
|
62
|
+
if (Test-Path "$sentryPackage\node_modules") {
|
|
63
|
+
Copy-Item -Path "$sentryPackage\node_modules\*" -Destination "$InstallDir\node_modules" -Recurse -Force
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
Copy-Item -Path "$sentryPackage\package.json" -Destination "$InstallDir" -Force
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
# Create wrapper script
|
|
70
|
+
$wrapperContent = @"
|
|
71
|
+
@echo off
|
|
72
|
+
node "%~dp0..\dist\index.js" %*
|
|
73
|
+
"@
|
|
74
|
+
[System.IO.File]::WriteAllText($BinPath, $wrapperContent)
|
|
75
|
+
|
|
76
|
+
# Generate default config
|
|
77
|
+
if (-not (Test-Path $ConfigPath)) {
|
|
78
|
+
Write-Host "Generating default config..." -ForegroundColor Yellow
|
|
79
|
+
|
|
80
|
+
$hostId = "$env:COMPUTERNAME-sentry"
|
|
81
|
+
|
|
82
|
+
$configContent = @"
|
|
83
|
+
# NeuroShield Sentry Daemon Configuration (Windows)
|
|
84
|
+
sentry:
|
|
85
|
+
host_id: "$hostId"
|
|
86
|
+
version: "$SentryVersion"
|
|
87
|
+
health_port: 9190
|
|
88
|
+
api_port: 9191
|
|
89
|
+
state_dir: "$StateDir"
|
|
90
|
+
pid_file_path: "$StateDir\sentry.pid"
|
|
91
|
+
|
|
92
|
+
neurosec:
|
|
93
|
+
endpoint: "$NeurosecUrl"
|
|
94
|
+
org_id: "$OrgId"
|
|
95
|
+
token_path: "$ConfigDir\sentry.token"
|
|
96
|
+
tls_cert: "$ConfigDir\cert.pem"
|
|
97
|
+
tls_key: "$ConfigDir\key.pem"
|
|
98
|
+
sync_interval_ms: 30000
|
|
99
|
+
heartbeat_interval_ms: 300000
|
|
100
|
+
|
|
101
|
+
enforcement:
|
|
102
|
+
mode: "$Mode"
|
|
103
|
+
sandbox_enabled: false
|
|
104
|
+
syscall_filter_enabled: false
|
|
105
|
+
network_filter_enabled: true
|
|
106
|
+
filesystem_filter_enabled: false
|
|
107
|
+
|
|
108
|
+
sandbox_defaults:
|
|
109
|
+
cpu_max: "0.5"
|
|
110
|
+
memory_max: "512MB"
|
|
111
|
+
pid_max: 100
|
|
112
|
+
|
|
113
|
+
network:
|
|
114
|
+
allow_hosts:
|
|
115
|
+
- "api.openai.com:443"
|
|
116
|
+
- "api.anthropic.com:443"
|
|
117
|
+
- "api.neurosec.ai:443"
|
|
118
|
+
block_hosts:
|
|
119
|
+
- "*.pastebin.com"
|
|
120
|
+
- "*.ngrok.io"
|
|
121
|
+
- "*.requestbin.net"
|
|
122
|
+
- "*.webhook.site"
|
|
123
|
+
allow_private: false
|
|
124
|
+
dns_monitor_enabled: false
|
|
125
|
+
|
|
126
|
+
proxy:
|
|
127
|
+
enabled: true
|
|
128
|
+
port: 9081
|
|
129
|
+
bind_address: "127.0.0.1"
|
|
130
|
+
upstream_timeout_ms: 120000
|
|
131
|
+
max_buffer_size_mb: 10
|
|
132
|
+
intercept_https: false
|
|
133
|
+
|
|
134
|
+
redirect:
|
|
135
|
+
enabled: true
|
|
136
|
+
strategy: "env-inject"
|
|
137
|
+
preserve_original_key: true
|
|
138
|
+
inject_on_discover: true
|
|
139
|
+
|
|
140
|
+
skill_authz:
|
|
141
|
+
enabled: true
|
|
142
|
+
allow_unknown: false
|
|
143
|
+
require_approval:
|
|
144
|
+
- "shell_exec"
|
|
145
|
+
- "bash"
|
|
146
|
+
- "terminal"
|
|
147
|
+
- "run_command"
|
|
148
|
+
|
|
149
|
+
audit:
|
|
150
|
+
log_path: "$LogDir\sentry.log"
|
|
151
|
+
retention_days: 90
|
|
152
|
+
max_size_mb: 500
|
|
153
|
+
|
|
154
|
+
discovery:
|
|
155
|
+
interval_ms: 30000
|
|
156
|
+
source_paths:
|
|
157
|
+
- "C:\Users"
|
|
158
|
+
- "C:\Projects"
|
|
159
|
+
- "C:\Workspace"
|
|
160
|
+
"@
|
|
161
|
+
[System.IO.File]::WriteAllText($ConfigPath, $configContent)
|
|
162
|
+
Write-Host " Config written to $ConfigPath" -ForegroundColor Green
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
# Create empty token file
|
|
166
|
+
$tokenPath = "$ConfigDir\sentry.token"
|
|
167
|
+
if (-not (Test-Path $tokenPath)) {
|
|
168
|
+
if ($Token) {
|
|
169
|
+
[System.IO.File]::WriteAllText($tokenPath, $Token)
|
|
170
|
+
} else {
|
|
171
|
+
New-Item -ItemType File -Force -Path $tokenPath | Out-Null
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
# Install Windows service using NSSM or sc.exe
|
|
176
|
+
Write-Host "Installing Windows service..." -ForegroundColor Yellow
|
|
177
|
+
|
|
178
|
+
# Check if NSSM is available
|
|
179
|
+
$nssmPath = Get-Command "nssm" -ErrorAction SilentlyContinue
|
|
180
|
+
|
|
181
|
+
if ($nssmPath) {
|
|
182
|
+
# Use NSSM for service management
|
|
183
|
+
nssm install $ServiceName "node.exe" "$InstallDir\dist\index.js" "$ConfigPath"
|
|
184
|
+
nssm set $ServiceName AppDirectory "$InstallDir"
|
|
185
|
+
nssm set $ServiceName DisplayName "NeuroShield Sentry Daemon"
|
|
186
|
+
nssm set $ServiceName Description "Host-level AI agent protection daemon. Detects, sandboxes, and enforces policies on AI agent processes."
|
|
187
|
+
nssm set $ServiceName Start SERVICE_AUTO_START
|
|
188
|
+
nssm set $ServiceName AppStdout "$LogDir\sentry-stdout.log"
|
|
189
|
+
nssm set $ServiceName AppStderr "$LogDir\sentry-stderr.log"
|
|
190
|
+
nssm set $ServiceName AppEnvironmentExtra "NODE_ENV=production SENTRY_CONFIG_PATH=$ConfigPath LOG_LEVEL=info"
|
|
191
|
+
nssm start $ServiceName
|
|
192
|
+
} else {
|
|
193
|
+
# Use sc.exe for basic service creation
|
|
194
|
+
$binaryPath = "node.exe `"$InstallDir\dist\index.js`" `"$ConfigPath`""
|
|
195
|
+
sc.exe create $ServiceName binPath= $binaryPath start= auto
|
|
196
|
+
sc.exe description $ServiceName "Host-level AI agent protection daemon"
|
|
197
|
+
sc.exe failure $ServiceName reset= 86400 actions= restart/5000/restart/10000/restart/30000
|
|
198
|
+
sc.exe start $ServiceName
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
Write-Host ""
|
|
202
|
+
Write-Host "============================================" -ForegroundColor Cyan
|
|
203
|
+
Write-Host " Installation Complete!" -ForegroundColor Cyan
|
|
204
|
+
Write-Host "============================================" -ForegroundColor Cyan
|
|
205
|
+
Write-Host ""
|
|
206
|
+
Write-Host " Next steps:"
|
|
207
|
+
Write-Host " 1. Edit $ConfigPath with your NeuroSec org ID"
|
|
208
|
+
Write-Host " 2. Set your sentry token: echo 'your-token' > $ConfigDir\sentry.token"
|
|
209
|
+
Write-Host " 3. Service '$ServiceName' should be running"
|
|
210
|
+
Write-Host " 4. Check status: sc query $ServiceName"
|
|
211
|
+
Write-Host " 5. View logs: Get-Content $LogDir\sentry-stdout.log -Tail 50"
|
|
212
|
+
Write-Host " 6. Local API: curl http://127.0.0.1:9191/api/v1/status"
|
|
213
|
+
Write-Host ""
|
|
214
|
+
Write-Host " To uninstall:"
|
|
215
|
+
Write-Host " nssm stop $ServiceName"
|
|
216
|
+
Write-Host " nssm remove $ServiceName confirm"
|
|
217
|
+
Write-Host " Remove-Item -Recurse -Force '$InstallDir'"
|
package/dist/action-logger.d.ts
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { AgentAction, AgentActionType, EnforcementDecision, FileAccessEvent, NetworkEvent, TaggedProcess } from './types';
|
|
2
|
-
import { AuditLogger } from './audit';
|
|
3
|
-
export declare class ActionLogger {
|
|
4
|
-
private config;
|
|
5
|
-
private auditLogger;
|
|
6
|
-
private pending;
|
|
7
|
-
private flushTimer;
|
|
8
|
-
private processedCount;
|
|
9
|
-
constructor(auditLogger: AuditLogger, hostId: string);
|
|
10
|
-
start(): void;
|
|
11
|
-
stop(): void;
|
|
12
|
-
logAction(params: {
|
|
13
|
-
pid: number;
|
|
14
|
-
frameworkId: string;
|
|
15
|
-
type: AgentActionType;
|
|
16
|
-
intent: string;
|
|
17
|
-
context: string;
|
|
18
|
-
reasoningTrace?: string[];
|
|
19
|
-
input: string;
|
|
20
|
-
output: string;
|
|
21
|
-
durationMs: number;
|
|
22
|
-
success: boolean;
|
|
23
|
-
errorMessage?: string | null;
|
|
24
|
-
dataClassifications?: string[];
|
|
25
|
-
decision: AgentAction['decision'];
|
|
26
|
-
decisionReason: string;
|
|
27
|
-
}): void;
|
|
28
|
-
logFromDecision(pid: number, frameworkId: string, decision: EnforcementDecision): void;
|
|
29
|
-
logFileAccess(pid: number, frameworkId: string, event: FileAccessEvent, process: TaggedProcess): void;
|
|
30
|
-
logNetworkAccess(pid: number, frameworkId: string, event: NetworkEvent): void;
|
|
31
|
-
getRecentActions(limit?: number): AgentAction[];
|
|
32
|
-
getProcessedCount(): number;
|
|
33
|
-
private flush;
|
|
34
|
-
private detectSensitiveData;
|
|
35
|
-
private computeRiskScore;
|
|
36
|
-
private getRiskFactors;
|
|
37
|
-
private decisionTypeToActionType;
|
|
38
|
-
private classifyPath;
|
|
39
|
-
}
|
|
40
|
-
//# sourceMappingURL=action-logger.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"action-logger.d.ts","sourceRoot":"","sources":["../src/action-logger.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,mBAAmB,EAAE,eAAe,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC1H,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAWtC,qBAAa,YAAY;IACvB,OAAO,CAAC,MAAM,CAAqB;IACnC,OAAO,CAAC,WAAW,CAAc;IACjC,OAAO,CAAC,OAAO,CAAqB;IACpC,OAAO,CAAC,UAAU,CAA+C;IACjE,OAAO,CAAC,cAAc,CAAK;gBAEf,WAAW,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM;IAgBpD,KAAK,IAAI,IAAI;IAQb,IAAI,IAAI,IAAI;IAU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Logger = void 0;
|
|
4
|
-
const crypto_1 = require("crypto");
|
|
5
|
-
const logger_1 = require("./logger");
|
|
6
|
-
class ActionLogger {
|
|
7
|
-
constructor(auditLogger, hostId) {
|
|
8
|
-
this.pending = [];
|
|
9
|
-
this.flushTimer = null;
|
|
10
|
-
this.processedCount = 0;
|
|
11
|
-
this.auditLogger = auditLogger;
|
|
12
|
-
this.config = {
|
|
13
|
-
hostId,
|
|
14
|
-
batchSize: 50,
|
|
15
|
-
flushIntervalMs: 10000,
|
|
16
|
-
sensitivePatterns: [
|
|
17
|
-
/api[-_]?key/i, /secret/i, /password/i, /token/i, /credential/i,
|
|
18
|
-
/auth[-_]?header/i, /bearer/i, /sk-[a-zA-Z0-9]{20,}/i,
|
|
19
|
-
/-----BEGIN (RSA |EC )?PRIVATE KEY-----/,
|
|
20
|
-
/social_security/i, /ssn/i, /passport/i, /credit_card/i, /cvv/i,
|
|
21
|
-
],
|
|
22
|
-
maxActionInputLength: 10000,
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
start() {
|
|
26
|
-
this.flushTimer = setInterval(() => this.flush(), this.config.flushIntervalMs);
|
|
27
|
-
logger_1.logger.info('Action logger started', {
|
|
28
|
-
batchSize: this.config.batchSize,
|
|
29
|
-
intervalMs: this.config.flushIntervalMs,
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
stop() {
|
|
33
|
-
if (this.flushTimer) {
|
|
34
|
-
clearInterval(this.flushTimer);
|
|
35
|
-
this.flushTimer = null;
|
|
36
|
-
}
|
|
37
|
-
this.flush();
|
|
38
|
-
}
|
|
39
|
-
// ── AEGIS: Log agent actions with intent & reasoning context ─────────────
|
|
40
|
-
logAction(params) {
|
|
41
|
-
const sensitiveData = this.detectSensitiveData(params.input, params.output);
|
|
42
|
-
const riskScore = this.computeRiskScore(params.type, sensitiveData, params.intent, params.context);
|
|
43
|
-
const action = {
|
|
44
|
-
id: (0, crypto_1.randomUUID)(),
|
|
45
|
-
pid: params.pid,
|
|
46
|
-
frameworkId: params.frameworkId,
|
|
47
|
-
hostId: this.config.hostId,
|
|
48
|
-
type: params.type,
|
|
49
|
-
timestamp: Date.now(),
|
|
50
|
-
intent: params.intent,
|
|
51
|
-
context: params.context,
|
|
52
|
-
reasoningTrace: params.reasoningTrace ?? [],
|
|
53
|
-
input: params.input.slice(0, this.config.maxActionInputLength),
|
|
54
|
-
output: params.output.slice(0, this.config.maxActionInputLength),
|
|
55
|
-
durationMs: params.durationMs,
|
|
56
|
-
success: params.success,
|
|
57
|
-
errorMessage: params.errorMessage ?? null,
|
|
58
|
-
dataClassifications: params.dataClassifications ?? [],
|
|
59
|
-
sensitiveDataDetected: sensitiveData,
|
|
60
|
-
riskScore,
|
|
61
|
-
riskFactors: this.getRiskFactors(riskScore),
|
|
62
|
-
decision: params.decision,
|
|
63
|
-
decisionReason: params.decisionReason,
|
|
64
|
-
};
|
|
65
|
-
this.pending.push(action);
|
|
66
|
-
this.processedCount++;
|
|
67
|
-
if (this.pending.length >= this.config.batchSize) {
|
|
68
|
-
this.flush();
|
|
69
|
-
}
|
|
70
|
-
// Log high-risk actions immediately to audit log
|
|
71
|
-
if (riskScore >= 7) {
|
|
72
|
-
const auditAction = riskScore >= 8 ? 'deny' : 'allow';
|
|
73
|
-
this.auditLogger.log({
|
|
74
|
-
id: action.id,
|
|
75
|
-
timestamp: action.timestamp,
|
|
76
|
-
type: 'process',
|
|
77
|
-
action: auditAction,
|
|
78
|
-
frameworkId: action.frameworkId,
|
|
79
|
-
frameworkName: null,
|
|
80
|
-
pid: action.pid,
|
|
81
|
-
reason: `High-risk action: ${action.type} (score: ${riskScore})`,
|
|
82
|
-
detail: {
|
|
83
|
-
actionType: action.type,
|
|
84
|
-
intent: action.intent,
|
|
85
|
-
riskScore,
|
|
86
|
-
riskFactors: action.riskFactors,
|
|
87
|
-
sensitiveData: action.sensitiveDataDetected,
|
|
88
|
-
},
|
|
89
|
-
hostname: this.config.hostId,
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
// ── AEGIS: Log from enforcement decisions ────────────────────────────────
|
|
94
|
-
logFromDecision(pid, frameworkId, decision) {
|
|
95
|
-
this.logAction({
|
|
96
|
-
pid,
|
|
97
|
-
frameworkId,
|
|
98
|
-
type: this.decisionTypeToActionType(decision.type),
|
|
99
|
-
intent: decision.reason,
|
|
100
|
-
context: JSON.stringify(decision.detail),
|
|
101
|
-
input: '',
|
|
102
|
-
output: '',
|
|
103
|
-
durationMs: 0,
|
|
104
|
-
success: decision.action === 'allow',
|
|
105
|
-
errorMessage: decision.action !== 'allow' ? decision.reason : null,
|
|
106
|
-
decision: decision.action,
|
|
107
|
-
decisionReason: decision.reason,
|
|
108
|
-
});
|
|
109
|
-
}
|
|
110
|
-
logFileAccess(pid, frameworkId, event, process) {
|
|
111
|
-
this.logAction({
|
|
112
|
-
pid,
|
|
113
|
-
frameworkId,
|
|
114
|
-
type: event.operation === 'read' ? 'file_read' : 'file_write',
|
|
115
|
-
intent: `File ${event.operation} on ${event.targetPath}`,
|
|
116
|
-
context: `Process: ${process.command.slice(0, 200)}`,
|
|
117
|
-
input: event.targetPath,
|
|
118
|
-
output: '',
|
|
119
|
-
durationMs: 0,
|
|
120
|
-
success: event.decision === 'allow',
|
|
121
|
-
errorMessage: event.decision !== 'allow' ? 'Access denied by policy' : null,
|
|
122
|
-
dataClassifications: this.classifyPath(event.targetPath),
|
|
123
|
-
decision: event.decision,
|
|
124
|
-
decisionReason: event.decision === 'allow' ? 'Policy allowed' : 'Policy denied',
|
|
125
|
-
});
|
|
126
|
-
}
|
|
127
|
-
logNetworkAccess(pid, frameworkId, event) {
|
|
128
|
-
this.logAction({
|
|
129
|
-
pid,
|
|
130
|
-
frameworkId,
|
|
131
|
-
type: 'network_egress',
|
|
132
|
-
intent: `Network ${event.direction} to ${event.hostname ?? event.destIp}:${event.destPort}`,
|
|
133
|
-
context: `Destination: ${event.destIp}:${event.destPort}`,
|
|
134
|
-
input: `${event.hostname ?? event.destIp}:${event.destPort}`,
|
|
135
|
-
output: '',
|
|
136
|
-
durationMs: 0,
|
|
137
|
-
success: event.decision === 'allow',
|
|
138
|
-
errorMessage: event.decision !== 'allow' ? 'Connection denied by policy' : null,
|
|
139
|
-
decision: event.decision,
|
|
140
|
-
decisionReason: event.decision === 'allow' ? 'Policy allowed' : 'Policy denied',
|
|
141
|
-
});
|
|
142
|
-
}
|
|
143
|
-
// ── Query / stats ────────────────────────────────────────────────────────
|
|
144
|
-
getRecentActions(limit = 100) {
|
|
145
|
-
return this.pending.slice(-limit);
|
|
146
|
-
}
|
|
147
|
-
getProcessedCount() {
|
|
148
|
-
return this.processedCount;
|
|
149
|
-
}
|
|
150
|
-
// ── Internal ─────────────────────────────────────────────────────────────
|
|
151
|
-
flush() {
|
|
152
|
-
if (this.pending.length === 0)
|
|
153
|
-
return;
|
|
154
|
-
const batch = this.pending.splice(0, this.config.batchSize);
|
|
155
|
-
// Write to audit log as summary
|
|
156
|
-
const highRisk = batch.filter(a => a.riskScore >= 6);
|
|
157
|
-
for (const action of highRisk) {
|
|
158
|
-
this.auditLogger.log({
|
|
159
|
-
id: action.id,
|
|
160
|
-
timestamp: action.timestamp,
|
|
161
|
-
type: 'process',
|
|
162
|
-
action: action.decision === 'monitor' ? 'allow' : action.decision,
|
|
163
|
-
frameworkId: action.frameworkId,
|
|
164
|
-
frameworkName: null,
|
|
165
|
-
pid: action.pid,
|
|
166
|
-
reason: `AEGIS action: ${action.type} — ${action.intent}`,
|
|
167
|
-
detail: {
|
|
168
|
-
actionType: action.type,
|
|
169
|
-
riskScore: action.riskScore,
|
|
170
|
-
riskFactors: action.riskFactors,
|
|
171
|
-
sensitiveData: action.sensitiveDataDetected,
|
|
172
|
-
dataClassifications: action.dataClassifications,
|
|
173
|
-
durationMs: action.durationMs,
|
|
174
|
-
},
|
|
175
|
-
hostname: this.config.hostId,
|
|
176
|
-
});
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
detectSensitiveData(input, output) {
|
|
180
|
-
const combined = `${input} ${output}`;
|
|
181
|
-
return this.config.sensitivePatterns.some(p => p.test(combined));
|
|
182
|
-
}
|
|
183
|
-
computeRiskScore(type, sensitiveData, intent, context) {
|
|
184
|
-
let score = 0;
|
|
185
|
-
// High-risk action types
|
|
186
|
-
if (['file_delete', 'syscall', 'child_spawn'].includes(type))
|
|
187
|
-
score += 4;
|
|
188
|
-
if (['file_write', 'network_egress', 'skill_invoke', 'api_call'].includes(type))
|
|
189
|
-
score += 2;
|
|
190
|
-
if (['tool_call', 'network_ingress'].includes(type))
|
|
191
|
-
score += 1;
|
|
192
|
-
// Sensitive data increases risk
|
|
193
|
-
if (sensitiveData)
|
|
194
|
-
score += 3;
|
|
195
|
-
// Intent analysis
|
|
196
|
-
const highRiskIntent = /delete|remove|destroy|wipe|overwrite|chmod|chown|sudo|exec/i;
|
|
197
|
-
const moderateRiskIntent = /write|modify|update|deploy|push|publish|expose/i;
|
|
198
|
-
if (highRiskIntent.test(intent))
|
|
199
|
-
score += 3;
|
|
200
|
-
else if (moderateRiskIntent.test(intent))
|
|
201
|
-
score += 1;
|
|
202
|
-
// Context analysis
|
|
203
|
-
if (/production|prod|live/i.test(context))
|
|
204
|
-
score += 1;
|
|
205
|
-
return Math.min(score, 10);
|
|
206
|
-
}
|
|
207
|
-
getRiskFactors(score) {
|
|
208
|
-
const factors = [];
|
|
209
|
-
if (score >= 8)
|
|
210
|
-
factors.push('critical_risk');
|
|
211
|
-
if (score >= 6)
|
|
212
|
-
factors.push('high_risk');
|
|
213
|
-
if (score >= 4)
|
|
214
|
-
factors.push('elevated_risk');
|
|
215
|
-
if (score < 4)
|
|
216
|
-
factors.push('normal');
|
|
217
|
-
return factors;
|
|
218
|
-
}
|
|
219
|
-
decisionTypeToActionType(decisionType) {
|
|
220
|
-
switch (decisionType) {
|
|
221
|
-
case 'file_access': return 'file_read';
|
|
222
|
-
case 'network': return 'network_egress';
|
|
223
|
-
case 'syscall': return 'syscall';
|
|
224
|
-
case 'skill': return 'skill_invoke';
|
|
225
|
-
case 'process': return 'child_spawn';
|
|
226
|
-
default: return 'api_call';
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
classifyPath(filePath) {
|
|
230
|
-
const classifications = [];
|
|
231
|
-
if (/\.ssh\/|\.aws\/|\.kube\/|\.gcloud\//i.test(filePath)) {
|
|
232
|
-
classifications.push('infrastructure_credentials');
|
|
233
|
-
}
|
|
234
|
-
if (/\.git\/|\.svn\//i.test(filePath))
|
|
235
|
-
classifications.push('source_code');
|
|
236
|
-
if (/etc\/passwd|etc\/shadow|etc\/sudoers/i.test(filePath)) {
|
|
237
|
-
classifications.push('system_config');
|
|
238
|
-
}
|
|
239
|
-
if (/token|secret|key|credential/i.test(filePath)) {
|
|
240
|
-
classifications.push('secrets');
|
|
241
|
-
}
|
|
242
|
-
if (/\.pem$|\.key$|\.crt$|cert/i.test(filePath)) {
|
|
243
|
-
classifications.push('certificates');
|
|
244
|
-
}
|
|
245
|
-
if (/database|db\/|\.sql$|\.db$/i.test(filePath)) {
|
|
246
|
-
classifications.push('database');
|
|
247
|
-
}
|
|
248
|
-
return classifications;
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
exports.ActionLogger = ActionLogger;
|
|
252
|
-
//# sourceMappingURL=action-logger.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"action-logger.js","sourceRoot":"","sources":["../src/action-logger.ts"],"names":[],"mappings":";;;AAAA,mCAAoC;AAGpC,qCAAkC;AAUlC,MAAa,YAAY;IAOvB,YAAY,WAAwB,EAAE,MAAc;QAJ5C,YAAO,GAAkB,EAAE,CAAC;QAC5B,eAAU,GAA0C,IAAI,CAAC;QACzD,mBAAc,GAAG,CAAC,CAAC;QAGzB,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,MAAM,GAAG;YACZ,MAAM;YACN,SAAS,EAAE,EAAE;YACb,eAAe,EAAE,KAAK;YACtB,iB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AY,CAAC,QAAgB;QACnC,MAAM,eAAe,GAAa,EAAE,CAAC;QACrC,IAAI,sCAAsC,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC1D,eAAe,CAAC,IAAI,CAAC,4BAA4B,CAAC,CAAC;QACrD,CAAC;QACD,IAAI,kBAAkB,CAAC,IAAI,CAAC,QAAQ,CAAC;YAAE,eAAe,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QAC3E,IAAI,uCAAuC,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC3D,eAAe,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;QACxC,CAAC;QACD,IAAI,8BAA8B,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;YAClD,eAAe,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAClC,CAAC;QACD,IAAI,4BAA4B,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;YAChD,eAAe,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;QACvC,CAAC;QACD,IAAI,6BAA6B,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;YACjD,eAAe,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QACnC,CAAC;QACD,OAAO,eAAe,CAAC;IACzB,CAAC;CACF;AA9RD,oCA8RC"}
|
package/dist/agent-registry.d.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { AgentIdentity, AgentDocumentation, TaggedProcess, DecisionConstraint } from './types';
|
|
2
|
-
export declare class AgentRegistry {
|
|
3
|
-
private state;
|
|
4
|
-
private stateDir;
|
|
5
|
-
private dirty;
|
|
6
|
-
constructor(stateDir: string);
|
|
7
|
-
init(): Promise<void>;
|
|
8
|
-
registerOrUpdate(process: TaggedProcess, hostId: string): AgentIdentity;
|
|
9
|
-
decommission(frameworkId: string, pid: number): void;
|
|
10
|
-
quarantine(frameworkId: string, pid: number, reason: string): void;
|
|
11
|
-
updateDocumentation(frameworkId: string, pid: number, docs: Partial<AgentDocumentation>): void;
|
|
12
|
-
updateIdentity(frameworkId: string, pid: number, updates: Partial<AgentIdentity>): void;
|
|
13
|
-
setConstraint(constraint: DecisionConstraint): void;
|
|
14
|
-
getConstraint(frameworkId: string): DecisionConstraint | undefined;
|
|
15
|
-
getMaxDecisionLevel(frameworkId: string): DecisionConstraint['maxDecisionLevel'];
|
|
16
|
-
getActiveIdentities(): AgentIdentity[];
|
|
17
|
-
getIdentity(frameworkId: string, pid: number): AgentIdentity | undefined;
|
|
18
|
-
getIdentityById(id: string): AgentIdentity | undefined;
|
|
19
|
-
getAllIdentities(): AgentIdentity[];
|
|
20
|
-
getAgentOnAPage(frameworkId: string, pid: number): AgentIdentity | null;
|
|
21
|
-
private loadState;
|
|
22
|
-
flush(): Promise<void>;
|
|
23
|
-
}
|
|
24
|
-
//# sourceMappingURL=agent-registry.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"agent-registry.d.ts","sourceRoot":"","sources":["../src/agent-registry.ts"],"names":[],"mappings":"AACA,OAAO,EACL,aAAa,EACb,kBAAkB,EAClB,aAAa,EACb,kBAAkB,EACnB,MAAM,SAAS,CAAC;AAUjB,qBAAa,aAAa;IACxB,OAAO,CAAC,KAAK,CAGX;IACF,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,KAAK,CAAS;gBAEV,QAAQ,EAAE,MAAM;IAItB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAQ3B,gBAAgB,CAAC,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,GAAG,aAAa;IAkDvE,YAAY,CAAC,WAAW,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI;IAWpD,UAAU,CAAC,WAAW,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI;IAYlE,mBAAmB,CAAC,WAAW,EAAE,MAAM,EAAE,GAAG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