@neurosec/sentry 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +118 -0
- package/bin/cli.js +18 -0
- package/bin/sentryd.js +19 -0
- package/dist/api.d.ts +21 -0
- package/dist/api.d.ts.map +1 -0
- package/dist/api.js +161 -0
- package/dist/api.js.map +1 -0
- package/dist/audit.d.ts +18 -0
- package/dist/audit.d.ts.map +1 -0
- package/dist/audit.js +114 -0
- package/dist/audit.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +255 -0
- package/dist/cli.js.map +1 -0
- package/dist/config.d.ts +54 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +160 -0
- package/dist/config.js.map +1 -0
- package/dist/discovery.d.ts +5 -0
- package/dist/discovery.d.ts.map +1 -0
- package/dist/discovery.js +279 -0
- package/dist/discovery.js.map +1 -0
- package/dist/enforcement/enforcement-engine.d.ts +37 -0
- package/dist/enforcement/enforcement-engine.d.ts.map +1 -0
- package/dist/enforcement/enforcement-engine.js +325 -0
- package/dist/enforcement/enforcement-engine.js.map +1 -0
- package/dist/enforcement/file-monitor.d.ts +4 -0
- package/dist/enforcement/file-monitor.d.ts.map +1 -0
- package/dist/enforcement/file-monitor.js +114 -0
- package/dist/enforcement/file-monitor.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +248 -0
- package/dist/index.js.map +1 -0
- package/dist/logger.d.ts +2 -0
- package/dist/logger.d.ts.map +1 -0
- package/dist/logger.js +17 -0
- package/dist/logger.js.map +1 -0
- package/dist/sandbox/index.d.ts +14 -0
- package/dist/sandbox/index.d.ts.map +1 -0
- package/dist/sandbox/index.js +91 -0
- package/dist/sandbox/index.js.map +1 -0
- package/dist/sandbox/linux-sandbox.d.ts +21 -0
- package/dist/sandbox/linux-sandbox.d.ts.map +1 -0
- package/dist/sandbox/linux-sandbox.js +186 -0
- package/dist/sandbox/linux-sandbox.js.map +1 -0
- package/dist/sandbox/macos-sandbox.d.ts +17 -0
- package/dist/sandbox/macos-sandbox.d.ts.map +1 -0
- package/dist/sandbox/macos-sandbox.js +145 -0
- package/dist/sandbox/macos-sandbox.js.map +1 -0
- package/dist/setup.d.ts +14 -0
- package/dist/setup.d.ts.map +1 -0
- package/dist/setup.js +220 -0
- package/dist/setup.js.map +1 -0
- package/dist/skill-authz/skill-evaluator.d.ts +20 -0
- package/dist/skill-authz/skill-evaluator.d.ts.map +1 -0
- package/dist/skill-authz/skill-evaluator.js +159 -0
- package/dist/skill-authz/skill-evaluator.js.map +1 -0
- package/dist/skill-authz/skill-scanner.d.ts +18 -0
- package/dist/skill-authz/skill-scanner.d.ts.map +1 -0
- package/dist/skill-authz/skill-scanner.js +169 -0
- package/dist/skill-authz/skill-scanner.js.map +1 -0
- package/dist/telemetry.d.ts +18 -0
- package/dist/telemetry.d.ts.map +1 -0
- package/dist/telemetry.js +106 -0
- package/dist/telemetry.js.map +1 -0
- package/dist/types.d.ts +127 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +209 -0
- package/dist/types.js.map +1 -0
- package/package.json +69 -0
- package/scripts/install-sentry-macos.sh +238 -0
- package/scripts/install-sentry.sh +253 -0
- package/scripts/postinstall.js +191 -0
- package/scripts/prepack.js +33 -0
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.SkillEvaluator = void 0;
|
|
7
|
+
const os_1 = __importDefault(require("os"));
|
|
8
|
+
const uuid_1 = require("uuid");
|
|
9
|
+
const logger_1 = require("../logger");
|
|
10
|
+
const audit_1 = require("../audit");
|
|
11
|
+
class SkillEvaluator {
|
|
12
|
+
constructor(config, auditLogger) {
|
|
13
|
+
this.config = config;
|
|
14
|
+
this.pendingApprovals = new Map();
|
|
15
|
+
this.cache = new Map();
|
|
16
|
+
this.auditLogger = auditLogger ?? new audit_1.AuditLogger(config);
|
|
17
|
+
}
|
|
18
|
+
evaluate(request) {
|
|
19
|
+
const cacheKey = `${request.frameworkId}:${request.skillName}`;
|
|
20
|
+
const cached = this.cache.get(cacheKey);
|
|
21
|
+
if (cached && Date.now() - (cached.duration * 1000) < Date.now()) {
|
|
22
|
+
return cached;
|
|
23
|
+
}
|
|
24
|
+
const riskScore = this.computeRiskScore(request);
|
|
25
|
+
let action;
|
|
26
|
+
let reason;
|
|
27
|
+
const needsApproval = this.config.skillAuthz.requireApproval.some(pattern => request.skillName.toLowerCase().includes(pattern.toLowerCase()));
|
|
28
|
+
if (needsApproval && this.config.enforcement.mode !== 'monitor') {
|
|
29
|
+
action = 'require_approval';
|
|
30
|
+
reason = `Skill '${request.skillName}' requires interactive approval`;
|
|
31
|
+
}
|
|
32
|
+
else if (riskScore >= 75 && this.config.enforcement.mode === 'enforce') {
|
|
33
|
+
action = 'deny';
|
|
34
|
+
reason = `Risk score ${riskScore}/100 exceeds threshold for '${request.skillName}'`;
|
|
35
|
+
}
|
|
36
|
+
else if (riskScore >= 50 && this.config.enforcement.mode === 'enforce') {
|
|
37
|
+
action = 'require_approval';
|
|
38
|
+
reason = `Risk score ${riskScore}/100 requires approval for '${request.skillName}'`;
|
|
39
|
+
}
|
|
40
|
+
else if (!this.config.skillAuthz.allowUnknown && !this.config.skillAuthz.requireApproval.some(p => request.skillName.includes(p))) {
|
|
41
|
+
action = 'deny';
|
|
42
|
+
reason = `Skill '${request.skillName}' is not in the allowlist`;
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
action = 'allow';
|
|
46
|
+
reason = `Skill '${request.skillName}' authorized`;
|
|
47
|
+
}
|
|
48
|
+
if (this.config.enforcement.mode === 'monitor') {
|
|
49
|
+
action = 'allow';
|
|
50
|
+
reason = `[MONITOR] Would have: ${reason}`;
|
|
51
|
+
}
|
|
52
|
+
const decision = {
|
|
53
|
+
invocationId: request.invocationId,
|
|
54
|
+
action,
|
|
55
|
+
reason,
|
|
56
|
+
duration: 300,
|
|
57
|
+
redactArgs: riskScore >= 50 ? Object.keys(request.skillArgs) : undefined,
|
|
58
|
+
};
|
|
59
|
+
if (action === 'allow') {
|
|
60
|
+
this.cache.set(cacheKey, decision);
|
|
61
|
+
}
|
|
62
|
+
this.auditLogger.log({
|
|
63
|
+
id: (0, uuid_1.v4)(),
|
|
64
|
+
timestamp: Date.now(),
|
|
65
|
+
type: 'skill',
|
|
66
|
+
action: decision.action,
|
|
67
|
+
frameworkId: request.frameworkId,
|
|
68
|
+
frameworkName: request.frameworkId,
|
|
69
|
+
pid: request.agentPid,
|
|
70
|
+
reason: decision.reason,
|
|
71
|
+
detail: {
|
|
72
|
+
skillName: request.skillName,
|
|
73
|
+
riskScore,
|
|
74
|
+
invocationId: request.invocationId,
|
|
75
|
+
},
|
|
76
|
+
hostname: os_1.default.hostname(),
|
|
77
|
+
}).catch(err => {
|
|
78
|
+
logger_1.logger.error('Skill audit log failed', { err: err.message });
|
|
79
|
+
});
|
|
80
|
+
return decision;
|
|
81
|
+
}
|
|
82
|
+
approve(invocationId) {
|
|
83
|
+
const pending = this.pendingApprovals.get(invocationId);
|
|
84
|
+
if (!pending || pending.resolved || Date.now() > pending.expiresAt) {
|
|
85
|
+
return false;
|
|
86
|
+
}
|
|
87
|
+
pending.resolved = true;
|
|
88
|
+
pending.decision.action = 'allow';
|
|
89
|
+
pending.decision.reason = 'Approved by operator';
|
|
90
|
+
this.pendingApprovals.delete(invocationId);
|
|
91
|
+
return true;
|
|
92
|
+
}
|
|
93
|
+
deny(invocationId) {
|
|
94
|
+
const pending = this.pendingApprovals.get(invocationId);
|
|
95
|
+
if (!pending || pending.resolved)
|
|
96
|
+
return false;
|
|
97
|
+
pending.resolved = true;
|
|
98
|
+
pending.decision.action = 'deny';
|
|
99
|
+
pending.decision.reason = 'Denied by operator';
|
|
100
|
+
this.pendingApprovals.delete(invocationId);
|
|
101
|
+
return true;
|
|
102
|
+
}
|
|
103
|
+
getPendingApprovals() {
|
|
104
|
+
const result = [];
|
|
105
|
+
for (const [id, pending] of this.pendingApprovals) {
|
|
106
|
+
if (!pending.resolved && Date.now() < pending.expiresAt) {
|
|
107
|
+
result.push({
|
|
108
|
+
invocationId: id,
|
|
109
|
+
skillName: pending.request.skillName,
|
|
110
|
+
frameworkId: pending.request.frameworkId,
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
return result;
|
|
115
|
+
}
|
|
116
|
+
computeRiskScore(request) {
|
|
117
|
+
let score = 0;
|
|
118
|
+
const highRiskSkillNames = [
|
|
119
|
+
/exec/i, /shell/i, /bash/i, /terminal/i, /command/i,
|
|
120
|
+
/fs_|_fs_|filesystem|read_file|write_file|delete_file|remove_file/i,
|
|
121
|
+
/db_|_db_|database|query|execute_query/i,
|
|
122
|
+
/network|http|fetch|curl|wget|request|download/i,
|
|
123
|
+
/ssh|scp|rsync|sftp/i,
|
|
124
|
+
/sudo|su|chmod|chown|chattr/i,
|
|
125
|
+
/run|spawn|fork|exec/i,
|
|
126
|
+
/admin|root|privileged/i,
|
|
127
|
+
/eval/i,
|
|
128
|
+
];
|
|
129
|
+
for (const pattern of highRiskSkillNames) {
|
|
130
|
+
if (pattern.test(request.skillName))
|
|
131
|
+
score += 20;
|
|
132
|
+
}
|
|
133
|
+
const argString = JSON.stringify(request.skillArgs).toLowerCase();
|
|
134
|
+
const dangerousPatterns = [
|
|
135
|
+
/rm\s+-rf/i, /mkfs/i, /dd\s+if/i,
|
|
136
|
+
/:\/\/[\w\.]+@/i,
|
|
137
|
+
/chmod\s+777/i, /chmod\s+755/i,
|
|
138
|
+
/\/etc\/(passwd|shadow|sudoers)/i,
|
|
139
|
+
/\/\.ssh\//i, /\/\.aws\//i, /\/\.config\/gcloud/i,
|
|
140
|
+
/\/var\/log\/auth/i,
|
|
141
|
+
/bash\s+-c/i,
|
|
142
|
+
/curl\s+.*\|/i,
|
|
143
|
+
/wget\s+.*-O\s*-/i,
|
|
144
|
+
/python\s+-c/i,
|
|
145
|
+
];
|
|
146
|
+
for (const pattern of dangerousPatterns) {
|
|
147
|
+
if (pattern.test(argString))
|
|
148
|
+
score += 15;
|
|
149
|
+
}
|
|
150
|
+
const largePayloadThreshold = 100000;
|
|
151
|
+
const argSize = argString.length;
|
|
152
|
+
if (argSize > largePayloadThreshold) {
|
|
153
|
+
score += 10;
|
|
154
|
+
}
|
|
155
|
+
return Math.min(score, 100);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
exports.SkillEvaluator = SkillEvaluator;
|
|
159
|
+
//# sourceMappingURL=skill-evaluator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skill-evaluator.js","sourceRoot":"","sources":["../../src/skill-authz/skill-evaluator.ts"],"names":[],"mappings":";;;;;;AAAA,4CAAoB;AACpB,+BAAoC;AAGpC,sCAAmC;AACnC,oCAAuC;AAUvC,MAAa,cAAc;IAKzB,YACU,MAAoB,EAC5B,WAAyB;QADjB,WAAM,GAAN,MAAM,CAAc;QALtB,qBAAgB,GAAiC,IAAI,GAAG,EAAE,CAAC;QAC3D,UAAK,GAAoC,IAAI,GAAG,EAAE,CAAC;QAOzD,IAAI,CAAC,WAAW,GAAG,WAAW,IAAI,IAAI,mBAAW,CAAC,MAAM,CAAC,CAAC;IAC5D,CAAC;IAED,QAAQ,CAAC,OAA0B;QACjC,MAAM,QAAQ,GAAG,GAAG,OAAO,CAAC,WAAW,IAAI,OAAO,CAAC,SAAS,EAAE,CAAC;QAC/D,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QACxC,IAAI,MAAM,IAAI,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,MAAM,CAAC,QAAQ,G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xC,IAAI,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC;gBAAE,KAAK,IAAI,EAAE,CAAC;QAC3C,CAAC;QAED,MAAM,qBAAqB,GAAG,MAAM,CAAC;QACrC,MAAM,OAAO,GAAG,SAAS,CAAC,MAAM,CAAC;QACjC,IAAI,OAAO,GAAG,qBAAqB,EAAE,CAAC;YACpC,KAAK,IAAI,EAAE,CAAC;QACd,CAAC;QAED,OAAO,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IAC9B,CAAC;CACF;AAtKD,wCAsKC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { TaggedProcess } from '../types';
|
|
2
|
+
import { SentryConfig } from '../config';
|
|
3
|
+
interface DetectedSkill {
|
|
4
|
+
frameworkId: string;
|
|
5
|
+
frameworkName: string;
|
|
6
|
+
pid: number;
|
|
7
|
+
skills: SkillDefinition[];
|
|
8
|
+
}
|
|
9
|
+
interface SkillDefinition {
|
|
10
|
+
name: string;
|
|
11
|
+
source: string;
|
|
12
|
+
sourceType: 'mcp' | 'openai_function' | 'langchain_tool' | 'manifest' | 'inferred';
|
|
13
|
+
args?: Record<string, unknown>;
|
|
14
|
+
invocationCount: number;
|
|
15
|
+
}
|
|
16
|
+
export declare function scanSkills(config: SentryConfig, taggedProcesses: TaggedProcess[]): Promise<DetectedSkill[]>;
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=skill-scanner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skill-scanner.d.ts","sourceRoot":"","sources":["../../src/skill-authz/skill-scanner.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAGzC,UAAU,aAAa;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,eAAe,EAAE,CAAC;CAC3B;AAED,UAAU,eAAe;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,KAAK,GAAG,iBAAiB,GAAG,gBAAgB,GAAG,UAAU,GAAG,UAAU,CAAC;IACnF,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,eAAe,EAAE,MAAM,CAAC;CACzB;AAED,wBAAsB,UAAU,CAAC,MAAM,EAAE,YAAY,EAAE,eAAe,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC,CAiBjH"}
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.scanSkills = scanSkills;
|
|
7
|
+
const promises_1 = __importDefault(require("fs/promises"));
|
|
8
|
+
const path_1 = __importDefault(require("path"));
|
|
9
|
+
const logger_1 = require("../logger");
|
|
10
|
+
async function scanSkills(config, taggedProcesses) {
|
|
11
|
+
const results = [];
|
|
12
|
+
for (const proc of taggedProcesses) {
|
|
13
|
+
const skills = await detectSkillsForProcess(proc, config);
|
|
14
|
+
if (skills.length > 0) {
|
|
15
|
+
results.push({
|
|
16
|
+
frameworkId: proc.frameworkId,
|
|
17
|
+
frameworkName: proc.frameworkName,
|
|
18
|
+
pid: proc.pid,
|
|
19
|
+
skills,
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
logger_1.logger.info('Skill scan complete', { processesWithSkills: results.length });
|
|
24
|
+
return results;
|
|
25
|
+
}
|
|
26
|
+
async function detectSkillsForProcess(proc, config) {
|
|
27
|
+
const skills = [];
|
|
28
|
+
// 1. Scan env vars for skill/tool definitions
|
|
29
|
+
try {
|
|
30
|
+
const envContent = await promises_1.default.readFile(`/proc/${proc.pid}/environ`, 'utf8');
|
|
31
|
+
const envVars = envContent.split('\u0000').filter(Boolean);
|
|
32
|
+
for (const envVar of envVars) {
|
|
33
|
+
const [key, value] = envVar.split('=');
|
|
34
|
+
if (!key || !value)
|
|
35
|
+
continue;
|
|
36
|
+
if (/MCP_SERVER/i.test(key)) {
|
|
37
|
+
skills.push({
|
|
38
|
+
name: `mcp:${value.slice(0, 80)}`,
|
|
39
|
+
source: 'env',
|
|
40
|
+
sourceType: 'mcp',
|
|
41
|
+
invocationCount: 0,
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
if (/TOOL|SKILL|FUNCTION/i.test(key) && /openai|anthropic|langchain/i.test(value)) {
|
|
45
|
+
skills.push({
|
|
46
|
+
name: key,
|
|
47
|
+
source: value.slice(0, 120),
|
|
48
|
+
sourceType: 'inferred',
|
|
49
|
+
invocationCount: 0,
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
catch {
|
|
55
|
+
// /proc not available
|
|
56
|
+
}
|
|
57
|
+
// 2. Scan manifests
|
|
58
|
+
for (const sourcePath of config.discovery.sourcePaths) {
|
|
59
|
+
try {
|
|
60
|
+
const mcpConfigPath = path_1.default.join(sourcePath, 'mcp.json');
|
|
61
|
+
const content = await promises_1.default.readFile(mcpConfigPath, 'utf8').catch(() => null);
|
|
62
|
+
if (content) {
|
|
63
|
+
try {
|
|
64
|
+
const parsed = JSON.parse(content);
|
|
65
|
+
const servers = parsed.mcpServers;
|
|
66
|
+
if (servers && typeof servers === 'object') {
|
|
67
|
+
for (const [serverName] of Object.entries(servers)) {
|
|
68
|
+
skills.push({
|
|
69
|
+
name: serverName,
|
|
70
|
+
source: mcpConfigPath,
|
|
71
|
+
sourceType: 'mcp',
|
|
72
|
+
invocationCount: 0,
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
const tools = parsed.tools;
|
|
77
|
+
if (Array.isArray(tools)) {
|
|
78
|
+
for (const tool of tools) {
|
|
79
|
+
if (tool && typeof tool === 'object') {
|
|
80
|
+
skills.push({
|
|
81
|
+
name: String(tool.name ?? ''),
|
|
82
|
+
source: mcpConfigPath,
|
|
83
|
+
sourceType: 'mcp',
|
|
84
|
+
args: tool.parameters,
|
|
85
|
+
invocationCount: 0,
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
catch {
|
|
92
|
+
// Parse error
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
const claudeConfigPath = path_1.default.join(sourcePath, 'claude_desktop_config.json');
|
|
96
|
+
const claudeContent = await promises_1.default.readFile(claudeConfigPath, 'utf8').catch(() => null);
|
|
97
|
+
if (claudeContent) {
|
|
98
|
+
try {
|
|
99
|
+
const parsed = JSON.parse(claudeContent);
|
|
100
|
+
const servers = parsed.mcpServers;
|
|
101
|
+
if (servers && typeof servers === 'object') {
|
|
102
|
+
for (const [serverName] of Object.entries(servers)) {
|
|
103
|
+
skills.push({
|
|
104
|
+
name: serverName,
|
|
105
|
+
source: claudeConfigPath,
|
|
106
|
+
sourceType: 'mcp',
|
|
107
|
+
invocationCount: 0,
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
catch {
|
|
113
|
+
// Parse error
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
// Check agents.yaml (CrewAI etc.)
|
|
117
|
+
const agentsPath = path_1.default.join(sourcePath, 'agents.yaml');
|
|
118
|
+
await promises_1.default.access(agentsPath).then(async () => {
|
|
119
|
+
const content = await promises_1.default.readFile(agentsPath, 'utf8');
|
|
120
|
+
const toolMatch = content.match(/tools:\s*\n(\s+- \w[^\n]*\n?)+/g);
|
|
121
|
+
if (toolMatch) {
|
|
122
|
+
for (const block of toolMatch) {
|
|
123
|
+
const toolNames = block.match(/-\s+(\w+)/g);
|
|
124
|
+
if (toolNames) {
|
|
125
|
+
for (const t of toolNames) {
|
|
126
|
+
skills.push({
|
|
127
|
+
name: t.replace(/^-\s+/, ''),
|
|
128
|
+
source: agentsPath,
|
|
129
|
+
sourceType: 'manifest',
|
|
130
|
+
invocationCount: 0,
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}).catch(() => { });
|
|
137
|
+
}
|
|
138
|
+
catch {
|
|
139
|
+
// Path not accessible
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
// 3. Check process cmdline for tool-related patterns
|
|
143
|
+
try {
|
|
144
|
+
const cmdline = await promises_1.default.readFile(`/proc/${proc.pid}/cmdline`, 'utf8');
|
|
145
|
+
const cmd = cmdline.replace(/\u0000/g, ' ');
|
|
146
|
+
const toolIndicators = [
|
|
147
|
+
{ pattern: /--tool\s+(\w+)/gi, type: 'langchain_tool' },
|
|
148
|
+
{ pattern: /--function\s+(\w+)/gi, type: 'openai_function' },
|
|
149
|
+
{ pattern: /--mcp-server\s+(\S+)/gi, type: 'mcp' },
|
|
150
|
+
];
|
|
151
|
+
for (const { pattern, type } of toolIndicators) {
|
|
152
|
+
let match;
|
|
153
|
+
const re = new RegExp(pattern.source, 'gi');
|
|
154
|
+
while ((match = re.exec(cmd)) !== null) {
|
|
155
|
+
skills.push({
|
|
156
|
+
name: match[1],
|
|
157
|
+
source: cmd.slice(0, 100),
|
|
158
|
+
sourceType: type,
|
|
159
|
+
invocationCount: 0,
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
catch {
|
|
165
|
+
// /proc not available
|
|
166
|
+
}
|
|
167
|
+
return skills;
|
|
168
|
+
}
|
|
169
|
+
//# sourceMappingURL=skill-scanner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skill-scanner.js","sourceRoot":"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
3
|
+
export declare class TelemetryReporter {
|
|
4
|
+
private config;
|
|
5
|
+
private getStatus;
|
|
6
|
+
private getTaggedProcesses;
|
|
7
|
+
private getRecentDecisions;
|
|
8
|
+
private getPolicyVersion;
|
|
9
|
+
private heartbeatTimer;
|
|
10
|
+
private lastSyncAt;
|
|
11
|
+
constructor(config: SentryConfig, getStatus: () => SentryStatus, getTaggedProcesses: () => TaggedProcess[], getRecentDecisions: () => EnforcementDecision[], getPolicyVersion: () => string);
|
|
12
|
+
start(): void;
|
|
13
|
+
stop(): void;
|
|
14
|
+
getLastSyncAt(): string | null;
|
|
15
|
+
private sendHeartbeat;
|
|
16
|
+
private apiRequest;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=telemetry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"telemetry.d.ts","sourceRoot":"","sources":["../src/telemetry.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAoB3E,qBAAa,iBAAiB;IAK1B,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,SAAS;IACjB,OAAO,CAAC,kBAAkB;IAC1B,OAAO,CAAC,kBAAkB;IAC1B,OAAO,CAAC,gBAAgB;IAR1B,OAAO,CAAC,cAAc,CAA+C;IACrE,OAAO,CAAC,UAAU,CAAuB;gBAG/B,MAAM,EAAE,YAAY,EACpB,SAAS,EAAE,MAAM,YAAY,EAC7B,kBAAkB,EAAE,MAAM,aAAa,EAAE,EACzC,kBAAkB,EAAE,MAAM,mBAAmB,EAAE,EAC/C,gBAAgB,EAAE,MAAM,MAAM;IAGxC,KAAK,IAAI,IAAI;IASb,IAAI,IAAI,IAAI;IAOZ,aAAa,IAAI,MAAM,GAAG,IAAI;YAIhB,aAAa;YAmCb,UAAU;CAuCzB"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.TelemetryReporter = void 0;
|
|
7
|
+
const http_1 = __importDefault(require("http"));
|
|
8
|
+
const https_1 = __importDefault(require("https"));
|
|
9
|
+
const logger_1 = require("./logger");
|
|
10
|
+
class TelemetryReporter {
|
|
11
|
+
constructor(config, getStatus, getTaggedProcesses, getRecentDecisions, getPolicyVersion) {
|
|
12
|
+
this.config = config;
|
|
13
|
+
this.getStatus = getStatus;
|
|
14
|
+
this.getTaggedProcesses = getTaggedProcesses;
|
|
15
|
+
this.getRecentDecisions = getRecentDecisions;
|
|
16
|
+
this.getPolicyVersion = getPolicyVersion;
|
|
17
|
+
this.heartbeatTimer = null;
|
|
18
|
+
this.lastSyncAt = null;
|
|
19
|
+
}
|
|
20
|
+
start() {
|
|
21
|
+
this.sendHeartbeat().catch(() => { });
|
|
22
|
+
this.heartbeatTimer = setInterval(() => this.sendHeartbeat().catch(err => logger_1.logger.warn('Telemetry heartbeat failed', { err: err.message })), this.config.neurosec.heartbeatIntervalMs);
|
|
23
|
+
logger_1.logger.info('Telemetry reporter started', { intervalMs: this.config.neurosec.heartbeatIntervalMs });
|
|
24
|
+
}
|
|
25
|
+
stop() {
|
|
26
|
+
if (this.heartbeatTimer) {
|
|
27
|
+
clearInterval(this.heartbeatTimer);
|
|
28
|
+
this.heartbeatTimer = null;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
getLastSyncAt() {
|
|
32
|
+
return this.lastSyncAt;
|
|
33
|
+
}
|
|
34
|
+
async sendHeartbeat() {
|
|
35
|
+
if (!this.config.neurosec.endpoint)
|
|
36
|
+
return;
|
|
37
|
+
const status = this.getStatus();
|
|
38
|
+
const processes = this.getTaggedProcesses();
|
|
39
|
+
const decisions = this.getRecentDecisions();
|
|
40
|
+
const payload = {
|
|
41
|
+
hostId: this.config.sentry.hostId,
|
|
42
|
+
orgId: this.config.neurosec.orgId,
|
|
43
|
+
timestamp: Date.now(),
|
|
44
|
+
status,
|
|
45
|
+
processes: processes.map(p => ({
|
|
46
|
+
pid: p.pid,
|
|
47
|
+
frameworkId: p.frameworkId,
|
|
48
|
+
frameworkName: p.frameworkName,
|
|
49
|
+
sandboxed: p.sandboxed,
|
|
50
|
+
profileName: p.sandboxProfileName,
|
|
51
|
+
confidence: p.confidence,
|
|
52
|
+
})),
|
|
53
|
+
recentDecisions: decisions.slice(-20),
|
|
54
|
+
policyVersion: this.getPolicyVersion(),
|
|
55
|
+
};
|
|
56
|
+
try {
|
|
57
|
+
await this.apiRequest('POST', '/api/v1/sentry/heartbeat', payload);
|
|
58
|
+
this.lastSyncAt = new Date().toISOString();
|
|
59
|
+
logger_1.logger.debug('Telemetry sent', { processes: payload.processes.length });
|
|
60
|
+
}
|
|
61
|
+
catch (err) {
|
|
62
|
+
logger_1.logger.warn('Telemetry send failed (NeuroSec may be unreachable)', {
|
|
63
|
+
err: err.message,
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
async apiRequest(method, path, body) {
|
|
68
|
+
return new Promise((resolve, reject) => {
|
|
69
|
+
const url = new URL(path, this.config.neurosec.endpoint);
|
|
70
|
+
const isHttps = url.protocol === 'https:';
|
|
71
|
+
const lib = isHttps ? https_1.default : http_1.default;
|
|
72
|
+
const bodyStr = JSON.stringify(body);
|
|
73
|
+
const options = {
|
|
74
|
+
hostname: url.hostname,
|
|
75
|
+
port: url.port || (isHttps ? 443 : 80),
|
|
76
|
+
path: url.pathname,
|
|
77
|
+
method,
|
|
78
|
+
headers: {
|
|
79
|
+
'Content-Type': 'application/json',
|
|
80
|
+
'Content-Length': Buffer.byteLength(bodyStr).toString(),
|
|
81
|
+
'X-Sentry-Host-Id': this.config.sentry.hostId,
|
|
82
|
+
'X-Sentry-Org-Id': this.config.neurosec.orgId,
|
|
83
|
+
},
|
|
84
|
+
timeout: 10000,
|
|
85
|
+
};
|
|
86
|
+
const req = lib.request(options, res => {
|
|
87
|
+
let data = '';
|
|
88
|
+
res.on('data', chunk => { data += chunk; });
|
|
89
|
+
res.on('end', () => {
|
|
90
|
+
try {
|
|
91
|
+
resolve(JSON.parse(data));
|
|
92
|
+
}
|
|
93
|
+
catch {
|
|
94
|
+
resolve(data);
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
});
|
|
98
|
+
req.on('error', reject);
|
|
99
|
+
req.on('timeout', () => { req.destroy(); reject(new Error('Request timed out')); });
|
|
100
|
+
req.write(bodyStr);
|
|
101
|
+
req.end();
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
exports.TelemetryReporter = TelemetryReporter;
|
|
106
|
+
//# sourceMappingURL=telemetry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"telemetry.js","sourceRoot":"","sources":["../src/telemetry.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AACxB,kDAA0B;AAG1B,qCAAkC;AAmBlC,MAAa,iBAAiB;IAI5B,YACU,MAAoB,EACpB,SAA6B,EAC7B,kBAAyC,EACzC,kBAA+C,EAC/C,gBAA8B;QAJ9B,WAAM,GAAN,MAAM,CAAc;QACpB,cAAS,GAAT,SAAS,CAAoB;QAC7B,uBAAkB,GAAlB,kBAAkB,CAAuB;QACzC,uBAAkB,GAAlB,kBAAkB,CAA6B;QAC/C,qBAAgB,GAAhB,gBAAgB,CAAc;QARhC,mBAAc,GAA0C,IAAI,CAAC;QAC7D,eAAU,GAAkB,IAAI,CAAC;IAQtC,CAAC;IAEJ,KAAK;QACH,IAAI,CAAC,aAAa,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;QACrC,IAAI,CAAC,cAAc,GAAG,WAAW,CAC/B,GAAG,EAAE,CAAC,IAAI,CAAC,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AC,GAAG,EAAE,CAAC;QACZ,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AA1GD,8CA0GC"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
export type EnforcementMode = 'monitor' | 'enforce' | 'quarantine';
|
|
2
|
+
export type Platform = 'linux' | 'darwin' | 'unknown';
|
|
3
|
+
export interface TaggedProcess {
|
|
4
|
+
pid: number;
|
|
5
|
+
ppid: number;
|
|
6
|
+
frameworkId: string;
|
|
7
|
+
frameworkName: string;
|
|
8
|
+
command: string;
|
|
9
|
+
exePath: string;
|
|
10
|
+
confidence: number;
|
|
11
|
+
envKeys: string[];
|
|
12
|
+
discoveredAt: number;
|
|
13
|
+
sandboxed: boolean;
|
|
14
|
+
sandboxProfileName: string | null;
|
|
15
|
+
uid: number;
|
|
16
|
+
gid: number;
|
|
17
|
+
}
|
|
18
|
+
export interface SandboxProfile {
|
|
19
|
+
name: string;
|
|
20
|
+
frameworkIds: string[];
|
|
21
|
+
allowedSyscalls: string[];
|
|
22
|
+
blockedSyscalls: string[];
|
|
23
|
+
fsRules: FsRule[];
|
|
24
|
+
networkRules: NetworkRule[];
|
|
25
|
+
retainedCapabilities: string[];
|
|
26
|
+
cpuMax: string;
|
|
27
|
+
memoryMax: string;
|
|
28
|
+
pidMax: number;
|
|
29
|
+
blockedCapabilities: string[];
|
|
30
|
+
}
|
|
31
|
+
export interface FsRule {
|
|
32
|
+
path: string;
|
|
33
|
+
permissions: 'r' | 'w' | 'rw' | 'rx' | 'rwx' | 'none';
|
|
34
|
+
}
|
|
35
|
+
export interface NetworkRule {
|
|
36
|
+
direction: 'egress' | 'ingress';
|
|
37
|
+
host?: string;
|
|
38
|
+
port?: number;
|
|
39
|
+
cidr?: string;
|
|
40
|
+
action: 'allow' | 'deny';
|
|
41
|
+
}
|
|
42
|
+
export interface SkillRule {
|
|
43
|
+
id: string;
|
|
44
|
+
frameworkId: string;
|
|
45
|
+
skillName: string;
|
|
46
|
+
action: 'allow' | 'deny' | 'require_approval';
|
|
47
|
+
riskThreshold?: number;
|
|
48
|
+
argumentPatterns?: string[];
|
|
49
|
+
}
|
|
50
|
+
export interface SkillAuthzRequest {
|
|
51
|
+
agentPid: number;
|
|
52
|
+
frameworkId: string;
|
|
53
|
+
skillName: string;
|
|
54
|
+
skillArgs: Record<string, unknown>;
|
|
55
|
+
invocationId: string;
|
|
56
|
+
timestamp: number;
|
|
57
|
+
}
|
|
58
|
+
export interface SkillAuthzDecision {
|
|
59
|
+
invocationId: string;
|
|
60
|
+
action: 'allow' | 'deny' | 'require_approval';
|
|
61
|
+
reason: string;
|
|
62
|
+
duration: number;
|
|
63
|
+
redactArgs?: string[];
|
|
64
|
+
}
|
|
65
|
+
export interface FileAccessEvent {
|
|
66
|
+
pid: number;
|
|
67
|
+
processPath: string;
|
|
68
|
+
targetPath: string;
|
|
69
|
+
operation: 'read' | 'write' | 'execute' | 'delete' | 'chmod';
|
|
70
|
+
frameworkId: string | null;
|
|
71
|
+
decision: 'allow' | 'deny';
|
|
72
|
+
timestamp: number;
|
|
73
|
+
}
|
|
74
|
+
export interface NetworkEvent {
|
|
75
|
+
pid: number;
|
|
76
|
+
direction: 'egress' | 'ingress';
|
|
77
|
+
destIp: string;
|
|
78
|
+
destPort: number;
|
|
79
|
+
hostname: string | null;
|
|
80
|
+
frameworkId: string | null;
|
|
81
|
+
decision: 'allow' | 'deny';
|
|
82
|
+
timestamp: number;
|
|
83
|
+
}
|
|
84
|
+
export interface SyscallEvent {
|
|
85
|
+
pid: number;
|
|
86
|
+
syscall: string;
|
|
87
|
+
details: Record<string, string | number | undefined>;
|
|
88
|
+
frameworkId: string | null;
|
|
89
|
+
decision: 'allow' | 'deny' | 'alert';
|
|
90
|
+
timestamp: number;
|
|
91
|
+
}
|
|
92
|
+
export interface EnforcementDecision {
|
|
93
|
+
id: string;
|
|
94
|
+
type: 'file_access' | 'network' | 'syscall' | 'skill' | 'process';
|
|
95
|
+
action: 'allow' | 'deny' | 'quarantine';
|
|
96
|
+
reason: string;
|
|
97
|
+
frameworkId: string | null;
|
|
98
|
+
pid: number;
|
|
99
|
+
detail: Record<string, unknown>;
|
|
100
|
+
timestamp: number;
|
|
101
|
+
}
|
|
102
|
+
export interface AuditEntry {
|
|
103
|
+
id: string;
|
|
104
|
+
timestamp: number;
|
|
105
|
+
type: EnforcementDecision['type'];
|
|
106
|
+
action: EnforcementDecision['action'];
|
|
107
|
+
frameworkId: string | null;
|
|
108
|
+
frameworkName: string | null;
|
|
109
|
+
pid: number;
|
|
110
|
+
reason: string;
|
|
111
|
+
detail: Record<string, unknown>;
|
|
112
|
+
hostname: string;
|
|
113
|
+
}
|
|
114
|
+
export interface SentryStatus {
|
|
115
|
+
version: string;
|
|
116
|
+
uptime: number;
|
|
117
|
+
mode: EnforcementMode;
|
|
118
|
+
policyVersion: string;
|
|
119
|
+
taggedProcesses: number;
|
|
120
|
+
sandboxedProcesses: number;
|
|
121
|
+
decisionsTotal: number;
|
|
122
|
+
decisionsDenied: number;
|
|
123
|
+
lastSyncAt: string | null;
|
|
124
|
+
platform: Platform;
|
|
125
|
+
}
|
|
126
|
+
export declare const AGENT_SANDBOX_PROFILES: SandboxProfile[];
|
|
127
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,SAAS,GAAG,YAAY,CAAC;AAEnE,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,SAAS,CAAC;AAEtD,MAAM,WAAW,aAAa;IAC5B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,UA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