@agenshield/ipc 0.1.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.
Files changed (54) hide show
  1. package/catalog.d.ts +24 -0
  2. package/catalog.d.ts.map +1 -0
  3. package/constants.d.ts +59 -0
  4. package/constants.d.ts.map +1 -0
  5. package/index.d.ts +19 -0
  6. package/index.d.ts.map +1 -0
  7. package/index.js +1377 -0
  8. package/package.json +20 -0
  9. package/schemas/agenco.schema.d.ts +189 -0
  10. package/schemas/agenco.schema.d.ts.map +1 -0
  11. package/schemas/auth.schema.d.ts +112 -0
  12. package/schemas/auth.schema.d.ts.map +1 -0
  13. package/schemas/config.schema.d.ts +218 -0
  14. package/schemas/config.schema.d.ts.map +1 -0
  15. package/schemas/index.d.ts +11 -0
  16. package/schemas/index.d.ts.map +1 -0
  17. package/schemas/ops.schema.d.ts +128 -0
  18. package/schemas/ops.schema.d.ts.map +1 -0
  19. package/schemas/policy.schema.d.ts +148 -0
  20. package/schemas/policy.schema.d.ts.map +1 -0
  21. package/schemas/state.schema.d.ts +128 -0
  22. package/schemas/state.schema.d.ts.map +1 -0
  23. package/schemas/vault.schema.d.ts +38 -0
  24. package/schemas/vault.schema.d.ts.map +1 -0
  25. package/types/agenco.d.ts +211 -0
  26. package/types/agenco.d.ts.map +1 -0
  27. package/types/api.d.ts +59 -0
  28. package/types/api.d.ts.map +1 -0
  29. package/types/auth.d.ts +121 -0
  30. package/types/auth.d.ts.map +1 -0
  31. package/types/backup.d.ts +79 -0
  32. package/types/backup.d.ts.map +1 -0
  33. package/types/catalog.d.ts +13 -0
  34. package/types/catalog.d.ts.map +1 -0
  35. package/types/config.d.ts +208 -0
  36. package/types/config.d.ts.map +1 -0
  37. package/types/daemon.d.ts +22 -0
  38. package/types/daemon.d.ts.map +1 -0
  39. package/types/discovery.d.ts +121 -0
  40. package/types/discovery.d.ts.map +1 -0
  41. package/types/events.d.ts +83 -0
  42. package/types/events.d.ts.map +1 -0
  43. package/types/index.d.ts +18 -0
  44. package/types/index.d.ts.map +1 -0
  45. package/types/marketplace.d.ts +101 -0
  46. package/types/marketplace.d.ts.map +1 -0
  47. package/types/ops.d.ts +141 -0
  48. package/types/ops.d.ts.map +1 -0
  49. package/types/policy.d.ts +100 -0
  50. package/types/policy.d.ts.map +1 -0
  51. package/types/state.d.ts +105 -0
  52. package/types/state.d.ts.map +1 -0
  53. package/types/vault.d.ts +62 -0
  54. package/types/vault.d.ts.map +1 -0
package/index.js ADDED
@@ -0,0 +1,1377 @@
1
+ // libs/shield-ipc/src/types/backup.ts
2
+ var BACKUP_CONFIG = {
3
+ /** Directory for AgenShield configuration */
4
+ configDir: "/etc/agenshield",
5
+ /** Backup file path */
6
+ backupPath: "/etc/agenshield/backup.json",
7
+ /** Directory permissions (readable by all, writable by root) */
8
+ dirMode: 493,
9
+ /** File permissions (root only) */
10
+ fileMode: 384
11
+ };
12
+
13
+ // libs/shield-ipc/src/types/policy.ts
14
+ var DEFAULT_CHANNEL_RESTRICTIONS = [
15
+ { operation: "http_request", allowedChannels: ["socket", "http"] },
16
+ { operation: "file_read", allowedChannels: ["socket", "http"] },
17
+ { operation: "file_write", allowedChannels: ["socket"] },
18
+ { operation: "file_list", allowedChannels: ["socket", "http"] },
19
+ { operation: "exec", allowedChannels: ["socket"] },
20
+ { operation: "open_url", allowedChannels: ["socket", "http"] },
21
+ { operation: "secret_inject", allowedChannels: ["socket"] },
22
+ { operation: "ping", allowedChannels: ["socket", "http"] },
23
+ { operation: "policy_check", allowedChannels: ["socket", "http"] }
24
+ ];
25
+
26
+ // libs/shield-ipc/src/types/auth.ts
27
+ var DEFAULT_AUTH_CONFIG = {
28
+ sessionTtlMs: 30 * 60 * 1e3,
29
+ // 30 minutes
30
+ maxFailedAttempts: 5,
31
+ lockoutDurationMs: 15 * 60 * 1e3
32
+ // 15 minutes
33
+ };
34
+
35
+ // libs/shield-ipc/src/schemas/config.schema.ts
36
+ import { z } from "zod";
37
+ var UserDefinitionSchema = z.object({
38
+ username: z.string().min(1).max(32).regex(/^[a-z_][a-z0-9_-]*$/),
39
+ uid: z.number().int().min(500).max(65534),
40
+ gid: z.number().int().min(500).max(65534),
41
+ shell: z.string().min(1),
42
+ home: z.string().min(1),
43
+ realname: z.string().min(1).max(100),
44
+ groups: z.array(z.string().regex(/^[a-z_][a-z0-9_-]*$/))
45
+ });
46
+ var GroupDefinitionSchema = z.object({
47
+ name: z.string().min(1).max(32).regex(/^[a-z_][a-z0-9_-]*$/),
48
+ gid: z.number().int().min(500).max(65534),
49
+ description: z.string().min(1).max(100)
50
+ });
51
+ var UserConfigSchema = z.object({
52
+ agentUser: UserDefinitionSchema,
53
+ brokerUser: UserDefinitionSchema,
54
+ groups: z.object({
55
+ socket: GroupDefinitionSchema,
56
+ workspace: GroupDefinitionSchema
57
+ }),
58
+ prefix: z.string().max(20).default(""),
59
+ baseName: z.string().min(1).max(20).regex(/^[a-z][a-z0-9_]*$/).default("agenshield"),
60
+ baseUid: z.number().int().min(500).max(65e3).default(5200),
61
+ baseGid: z.number().int().min(500).max(65e3).default(5100)
62
+ });
63
+ var PathsConfigSchema = z.object({
64
+ socketPath: z.string().default("/var/run/agenshield/agenshield.sock"),
65
+ configDir: z.string().default("/opt/agenshield/config"),
66
+ policiesDir: z.string().default("/opt/agenshield/policies"),
67
+ seatbeltDir: z.string().default("/etc/agenshield/seatbelt"),
68
+ logDir: z.string().default("/var/log/agenshield"),
69
+ agentHomeDir: z.string().default("/Users/agenshield_agent"),
70
+ socketDir: z.string().default("/var/run/agenshield")
71
+ });
72
+ var InstallationConfigSchema = z.object({
73
+ users: UserConfigSchema,
74
+ paths: PathsConfigSchema,
75
+ httpFallback: z.boolean().default(true),
76
+ httpPort: z.number().int().min(1024).max(65535).default(5201)
77
+ // Broker HTTP fallback port
78
+ });
79
+ var DaemonConfigSchema = z.object({
80
+ port: z.number().min(1).max(65535).default(5200),
81
+ host: z.string().default("localhost"),
82
+ logLevel: z.enum(["debug", "info", "warn", "error"]).default("info"),
83
+ enableHostsEntry: z.boolean().default(false)
84
+ });
85
+ var PolicyConfigSchema = z.object({
86
+ id: z.string().uuid(),
87
+ name: z.string().min(1).max(100),
88
+ action: z.enum(["allow", "deny", "approval"]),
89
+ target: z.enum(["skill", "command", "url", "filesystem"]),
90
+ patterns: z.array(z.string()),
91
+ enabled: z.boolean().default(true),
92
+ operations: z.array(z.string()).optional()
93
+ });
94
+ var VaultConfigSchema = z.object({
95
+ enabled: z.boolean(),
96
+ provider: z.enum(["local", "env"])
97
+ });
98
+ var ShieldConfigSchema = z.object({
99
+ version: z.string(),
100
+ daemon: DaemonConfigSchema,
101
+ policies: z.array(PolicyConfigSchema).default([]),
102
+ vault: VaultConfigSchema.optional()
103
+ });
104
+
105
+ // libs/shield-ipc/src/schemas/ops.schema.ts
106
+ import { z as z2 } from "zod";
107
+ var OperationTypeSchema = z2.enum([
108
+ "http_request",
109
+ "file_read",
110
+ "file_write",
111
+ "file_list",
112
+ "exec",
113
+ "open_url",
114
+ "secret_inject",
115
+ "ping",
116
+ "policy_check"
117
+ ]);
118
+ var HttpRequestParamsSchema = z2.object({
119
+ url: z2.string().url(),
120
+ method: z2.enum(["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS"]).optional(),
121
+ headers: z2.record(z2.string(), z2.string()).optional(),
122
+ body: z2.string().optional(),
123
+ timeout: z2.number().positive().optional(),
124
+ followRedirects: z2.boolean().optional()
125
+ });
126
+ var FileReadParamsSchema = z2.object({
127
+ path: z2.string().min(1),
128
+ encoding: z2.string().optional()
129
+ });
130
+ var FileWriteParamsSchema = z2.object({
131
+ path: z2.string().min(1),
132
+ content: z2.string(),
133
+ encoding: z2.string().optional(),
134
+ mode: z2.number().optional()
135
+ });
136
+ var FileListParamsSchema = z2.object({
137
+ path: z2.string().min(1),
138
+ recursive: z2.boolean().optional(),
139
+ pattern: z2.string().optional()
140
+ });
141
+ var ExecParamsSchema = z2.object({
142
+ command: z2.string().min(1),
143
+ args: z2.array(z2.string()).optional(),
144
+ cwd: z2.string().optional(),
145
+ env: z2.record(z2.string(), z2.string()).optional(),
146
+ timeout: z2.number().positive().optional(),
147
+ shell: z2.boolean().optional()
148
+ });
149
+ var OpenUrlParamsSchema = z2.object({
150
+ url: z2.string().url(),
151
+ browser: z2.string().optional()
152
+ });
153
+ var SecretInjectParamsSchema = z2.object({
154
+ name: z2.string().min(1),
155
+ targetEnv: z2.string().optional()
156
+ });
157
+ var PingParamsSchema = z2.object({
158
+ echo: z2.string().optional()
159
+ });
160
+ var PolicyCheckParamsSchema = z2.object({
161
+ operation: OperationTypeSchema,
162
+ target: z2.string().min(1)
163
+ });
164
+ var BrokerRequestSchema = z2.object({
165
+ jsonrpc: z2.literal("2.0"),
166
+ id: z2.union([z2.string(), z2.number()]),
167
+ method: OperationTypeSchema,
168
+ params: z2.record(z2.string(), z2.unknown()),
169
+ channel: z2.enum(["socket", "http"]).optional()
170
+ });
171
+ var BrokerErrorSchema = z2.object({
172
+ code: z2.number(),
173
+ message: z2.string(),
174
+ data: z2.unknown().optional()
175
+ });
176
+ var BrokerResponseSchema = z2.object({
177
+ jsonrpc: z2.literal("2.0"),
178
+ id: z2.union([z2.string(), z2.number()]),
179
+ result: z2.unknown().optional(),
180
+ error: BrokerErrorSchema.optional()
181
+ });
182
+
183
+ // libs/shield-ipc/src/schemas/policy.schema.ts
184
+ import { z as z3 } from "zod";
185
+ var PolicyRuleSchema = z3.object({
186
+ id: z3.string().min(1),
187
+ name: z3.string().min(1),
188
+ action: z3.enum(["allow", "deny", "approval"]),
189
+ target: z3.enum(["skill", "command", "url", "filesystem"]),
190
+ operations: z3.array(OperationTypeSchema),
191
+ patterns: z3.array(z3.string()),
192
+ enabled: z3.boolean(),
193
+ priority: z3.number().optional()
194
+ });
195
+ var FsConstraintsSchema = z3.object({
196
+ allowedPaths: z3.array(z3.string()),
197
+ deniedPatterns: z3.array(z3.string())
198
+ });
199
+ var NetworkConstraintsSchema = z3.object({
200
+ allowedHosts: z3.array(z3.string()),
201
+ deniedHosts: z3.array(z3.string()),
202
+ allowedPorts: z3.array(z3.number().int().positive())
203
+ });
204
+ var EnvInjectionRuleSchema = z3.object({
205
+ secretName: z3.string().min(1),
206
+ targetEnv: z3.string().min(1),
207
+ operations: z3.array(OperationTypeSchema)
208
+ });
209
+ var PolicyConfigurationSchema = z3.object({
210
+ version: z3.string(),
211
+ rules: z3.array(PolicyRuleSchema),
212
+ defaultAction: z3.enum(["allow", "deny"]),
213
+ fsConstraints: FsConstraintsSchema.optional(),
214
+ networkConstraints: NetworkConstraintsSchema.optional(),
215
+ envInjection: z3.array(EnvInjectionRuleSchema).optional()
216
+ });
217
+ var PolicyEvaluationResultSchema = z3.object({
218
+ allowed: z3.boolean(),
219
+ policyId: z3.string().optional(),
220
+ reason: z3.string().optional(),
221
+ durationMs: z3.number().optional()
222
+ });
223
+ var ChannelRestrictionSchema = z3.object({
224
+ operation: OperationTypeSchema,
225
+ allowedChannels: z3.array(z3.enum(["socket", "http"]))
226
+ });
227
+
228
+ // libs/shield-ipc/src/schemas/agenco.schema.ts
229
+ import { z as z4 } from "zod";
230
+ var AgenCoAuthStartRequestSchema = z4.object({
231
+ scopes: z4.array(z4.string()).optional()
232
+ });
233
+ var AgenCoAuthStartResponseSchema = z4.object({
234
+ authUrl: z4.string().url(),
235
+ state: z4.string().min(1),
236
+ callbackPort: z4.number().int().min(1024).max(65535)
237
+ });
238
+ var AgenCoAuthCallbackRequestSchema = z4.object({
239
+ code: z4.string().min(1),
240
+ state: z4.string().min(1)
241
+ });
242
+ var AgenCoAuthCallbackResponseSchema = z4.object({
243
+ success: z4.boolean(),
244
+ error: z4.string().optional()
245
+ });
246
+ var AgenCoAuthStatusResponseSchema = z4.object({
247
+ authenticated: z4.boolean(),
248
+ expired: z4.boolean(),
249
+ expiresAt: z4.string().nullable(),
250
+ connectedIntegrations: z4.array(z4.string())
251
+ });
252
+ var AgenCoToolRunRequestSchema = z4.object({
253
+ integration: z4.string().min(1),
254
+ tool: z4.string().min(1),
255
+ params: z4.record(z4.string(), z4.unknown()).optional()
256
+ });
257
+ var AgenCoToolRunResponseSchema = z4.object({
258
+ success: z4.boolean(),
259
+ result: z4.unknown().optional(),
260
+ error: z4.string().optional()
261
+ });
262
+ var AgenCoToolListRequestSchema = z4.object({
263
+ integration: z4.string().optional(),
264
+ connectedOnly: z4.boolean().optional()
265
+ });
266
+ var AgenCoToolSchema = z4.object({
267
+ integration: z4.string(),
268
+ tool: z4.string(),
269
+ description: z4.string(),
270
+ connected: z4.boolean().optional(),
271
+ connectUrl: z4.string().optional()
272
+ });
273
+ var AgenCoToolListResponseSchema = z4.object({
274
+ tools: z4.array(AgenCoToolSchema)
275
+ });
276
+ var AgenCoToolSearchRequestSchema = z4.object({
277
+ query: z4.string().min(1),
278
+ integration: z4.string().optional()
279
+ });
280
+ var AgenCoIntegrationsListRequestSchema = z4.object({
281
+ category: z4.string().optional(),
282
+ search: z4.string().optional()
283
+ });
284
+ var AgenCoIntegrationActionSchema = z4.object({
285
+ name: z4.string(),
286
+ description: z4.string()
287
+ });
288
+ var AgenCoIntegrationSchema = z4.object({
289
+ id: z4.string(),
290
+ name: z4.string(),
291
+ description: z4.string(),
292
+ category: z4.string(),
293
+ toolsCount: z4.number().int().nonnegative(),
294
+ actions: z4.array(AgenCoIntegrationActionSchema).optional()
295
+ });
296
+ var AgenCoIntegrationsListResponseSchema = z4.object({
297
+ integrations: z4.array(AgenCoIntegrationSchema),
298
+ totalCount: z4.number().int().nonnegative()
299
+ });
300
+ var AgenCoConnectedIntegrationSchema = z4.object({
301
+ id: z4.string(),
302
+ name: z4.string(),
303
+ connectedAt: z4.string(),
304
+ status: z4.string(),
305
+ account: z4.string().optional(),
306
+ requiresReauth: z4.boolean().optional()
307
+ });
308
+ var AgenCoConnectedIntegrationsResponseSchema = z4.object({
309
+ integrations: z4.array(AgenCoConnectedIntegrationSchema)
310
+ });
311
+ var AgenCoConnectIntegrationRequestSchema = z4.object({
312
+ integration: z4.string().min(1),
313
+ scopes: z4.array(z4.string()).optional()
314
+ });
315
+ var AgenCoConnectIntegrationResponseSchema = z4.object({
316
+ status: z4.enum(["auth_required", "already_connected", "connected"]),
317
+ oauthUrl: z4.string().url().optional(),
318
+ expiresIn: z4.number().optional(),
319
+ instructions: z4.string().optional(),
320
+ account: z4.string().optional(),
321
+ connectedAt: z4.string().optional()
322
+ });
323
+
324
+ // libs/shield-ipc/src/schemas/state.schema.ts
325
+ import { z as z5 } from "zod";
326
+ var DaemonStateSchema = z5.object({
327
+ running: z5.boolean(),
328
+ pid: z5.number().int().positive().optional(),
329
+ startedAt: z5.string().optional(),
330
+ port: z5.number().int().min(1024).max(65535)
331
+ });
332
+ var UserStateSchema = z5.object({
333
+ username: z5.string().min(1).max(32).regex(/^[a-z_][a-z0-9_-]*$/),
334
+ uid: z5.number().int().min(500).max(65534),
335
+ type: z5.enum(["agent", "broker"]),
336
+ createdAt: z5.string(),
337
+ homeDir: z5.string().min(1)
338
+ });
339
+ var GroupStateSchema = z5.object({
340
+ name: z5.string().min(1).max(32).regex(/^[a-z_][a-z0-9_-]*$/),
341
+ gid: z5.number().int().min(500).max(65534),
342
+ type: z5.enum(["socket", "workspace"])
343
+ });
344
+ var AgenCoStateSchema = z5.object({
345
+ authenticated: z5.boolean(),
346
+ lastAuthAt: z5.string().optional(),
347
+ connectedIntegrations: z5.array(z5.string())
348
+ });
349
+ var InstallationStateSchema = z5.object({
350
+ preset: z5.string().min(1),
351
+ baseName: z5.string().min(1),
352
+ prefix: z5.string().optional(),
353
+ wrappers: z5.array(z5.string()),
354
+ seatbeltInstalled: z5.boolean()
355
+ });
356
+ var PasscodeProtectionStateSchema = z5.object({
357
+ enabled: z5.boolean(),
358
+ allowAnonymousReadOnly: z5.boolean().optional(),
359
+ failedAttempts: z5.number().int().nonnegative().optional(),
360
+ lockedUntil: z5.string().optional()
361
+ });
362
+ var SystemStateSchema = z5.object({
363
+ version: z5.string().min(1),
364
+ installedAt: z5.string(),
365
+ daemon: DaemonStateSchema,
366
+ users: z5.array(UserStateSchema),
367
+ groups: z5.array(GroupStateSchema),
368
+ agenco: AgenCoStateSchema,
369
+ installation: InstallationStateSchema,
370
+ passcodeProtection: PasscodeProtectionStateSchema.optional()
371
+ });
372
+
373
+ // libs/shield-ipc/src/schemas/vault.schema.ts
374
+ import { z as z7 } from "zod";
375
+
376
+ // libs/shield-ipc/src/schemas/auth.schema.ts
377
+ import { z as z6 } from "zod";
378
+ var passcodeSchema = z6.string().min(4, "Passcode must be at least 4 characters");
379
+ var AuthStatusResponseSchema = z6.object({
380
+ passcodeSet: z6.boolean(),
381
+ protectionEnabled: z6.boolean(),
382
+ allowAnonymousReadOnly: z6.boolean(),
383
+ lockedOut: z6.boolean(),
384
+ lockedUntil: z6.string().optional()
385
+ });
386
+ var UnlockRequestSchema = z6.object({
387
+ passcode: passcodeSchema
388
+ });
389
+ var UnlockResponseSchema = z6.object({
390
+ success: z6.boolean(),
391
+ token: z6.string().optional(),
392
+ expiresAt: z6.number().int().positive().optional(),
393
+ error: z6.string().optional(),
394
+ remainingAttempts: z6.number().int().nonnegative().optional()
395
+ });
396
+ var LockRequestSchema = z6.object({
397
+ token: z6.string().min(1)
398
+ });
399
+ var LockResponseSchema = z6.object({
400
+ success: z6.boolean()
401
+ });
402
+ var SetupPasscodeRequestSchema = z6.object({
403
+ passcode: passcodeSchema,
404
+ enableProtection: z6.boolean().optional()
405
+ });
406
+ var SetupPasscodeResponseSchema = z6.object({
407
+ success: z6.boolean(),
408
+ error: z6.string().optional()
409
+ });
410
+ var ChangePasscodeRequestSchema = z6.object({
411
+ oldPasscode: passcodeSchema.optional(),
412
+ newPasscode: passcodeSchema
413
+ });
414
+ var ChangePasscodeResponseSchema = z6.object({
415
+ success: z6.boolean(),
416
+ error: z6.string().optional()
417
+ });
418
+ var SessionSchema = z6.object({
419
+ token: z6.string().min(1),
420
+ createdAt: z6.number().int().positive(),
421
+ expiresAt: z6.number().int().positive(),
422
+ clientId: z6.string().optional()
423
+ });
424
+ var AuthConfigSchema = z6.object({
425
+ sessionTtlMs: z6.number().int().positive(),
426
+ maxFailedAttempts: z6.number().int().positive(),
427
+ lockoutDurationMs: z6.number().int().positive()
428
+ });
429
+ var PasscodeDataSchema = z6.object({
430
+ hash: z6.string().min(1),
431
+ setAt: z6.string(),
432
+ changedAt: z6.string().optional()
433
+ });
434
+
435
+ // libs/shield-ipc/src/schemas/vault.schema.ts
436
+ var AgenCoSecretsSchema = z7.object({
437
+ accessToken: z7.string().min(1),
438
+ refreshToken: z7.string().min(1),
439
+ expiresAt: z7.number().int().positive(),
440
+ clientId: z7.string().min(1),
441
+ clientSecret: z7.string().min(1)
442
+ });
443
+ var VaultContentsSchema = z7.object({
444
+ agenco: AgenCoSecretsSchema.optional(),
445
+ envSecrets: z7.record(z7.string(), z7.string()),
446
+ sensitivePatterns: z7.array(z7.string()),
447
+ passcode: PasscodeDataSchema.optional()
448
+ });
449
+
450
+ // libs/shield-ipc/src/catalog.ts
451
+ var COMMAND_CATALOG = {
452
+ // ── Network ────────────────────────────────────────────────
453
+ curl: {
454
+ description: "Transfer data using network protocols",
455
+ category: "network",
456
+ risk: "high",
457
+ riskReason: "Can exfiltrate data or download malicious payloads",
458
+ tags: ["http", "download", "upload", "api", "request"]
459
+ },
460
+ wget: {
461
+ description: "Download files from the web",
462
+ category: "network",
463
+ risk: "high",
464
+ riskReason: "Can download malicious payloads or exfiltrate via HTTP",
465
+ tags: ["http", "download", "fetch", "web"]
466
+ },
467
+ ssh: {
468
+ description: "Secure shell remote login",
469
+ category: "network",
470
+ risk: "high",
471
+ riskReason: "Opens remote shell sessions and can tunnel traffic",
472
+ tags: ["remote", "login", "tunnel", "secure"]
473
+ },
474
+ scp: {
475
+ description: "Secure copy files over SSH",
476
+ category: "network",
477
+ risk: "high",
478
+ riskReason: "Can exfiltrate files to remote hosts",
479
+ tags: ["copy", "remote", "transfer", "secure"]
480
+ },
481
+ rsync: {
482
+ description: "Fast incremental file transfer",
483
+ category: "network",
484
+ risk: "high",
485
+ riskReason: "Can sync large amounts of data to remote hosts",
486
+ tags: ["sync", "copy", "remote", "transfer", "backup"]
487
+ },
488
+ nc: {
489
+ description: "Netcat \u2014 arbitrary TCP/UDP connections",
490
+ category: "network",
491
+ risk: "high",
492
+ riskReason: "Can open arbitrary network connections and reverse shells",
493
+ tags: ["netcat", "tcp", "udp", "socket", "listen"]
494
+ },
495
+ telnet: {
496
+ description: "Unencrypted remote terminal protocol",
497
+ category: "network",
498
+ risk: "high",
499
+ riskReason: "Unencrypted remote access, can connect to arbitrary ports",
500
+ tags: ["remote", "terminal", "unencrypted"]
501
+ },
502
+ ftp: {
503
+ description: "File transfer protocol client",
504
+ category: "network",
505
+ risk: "high",
506
+ riskReason: "Unencrypted file transfers, can exfiltrate data",
507
+ tags: ["transfer", "upload", "download", "unencrypted"]
508
+ },
509
+ sftp: {
510
+ description: "Secure file transfer over SSH",
511
+ category: "network",
512
+ risk: "high",
513
+ riskReason: "Can transfer files to/from remote hosts",
514
+ tags: ["transfer", "upload", "download", "secure", "ssh"]
515
+ },
516
+ nslookup: {
517
+ description: "Query DNS name servers",
518
+ category: "network",
519
+ risk: "low",
520
+ riskReason: "Read-only DNS lookups",
521
+ tags: ["dns", "lookup", "resolve", "nameserver"]
522
+ },
523
+ dig: {
524
+ description: "DNS lookup utility",
525
+ category: "network",
526
+ risk: "low",
527
+ riskReason: "Read-only DNS queries",
528
+ tags: ["dns", "lookup", "resolve", "query"]
529
+ },
530
+ host: {
531
+ description: "DNS lookup utility",
532
+ category: "network",
533
+ risk: "low",
534
+ riskReason: "Read-only DNS resolution",
535
+ tags: ["dns", "lookup", "resolve"]
536
+ },
537
+ ping: {
538
+ description: "Send ICMP echo requests",
539
+ category: "network",
540
+ risk: "low",
541
+ riskReason: "Read-only network reachability check",
542
+ tags: ["icmp", "reachability", "latency", "network"]
543
+ },
544
+ traceroute: {
545
+ description: "Trace packet route to host",
546
+ category: "network",
547
+ risk: "low",
548
+ riskReason: "Read-only route tracing",
549
+ tags: ["route", "hops", "network", "diagnostics"]
550
+ },
551
+ netstat: {
552
+ description: "Display network connections and stats",
553
+ category: "network",
554
+ risk: "low",
555
+ riskReason: "Read-only network status",
556
+ tags: ["connections", "ports", "sockets", "status"]
557
+ },
558
+ ifconfig: {
559
+ description: "Configure or display network interfaces",
560
+ category: "network",
561
+ risk: "medium",
562
+ riskReason: "Can modify network interface configuration",
563
+ tags: ["interface", "ip", "config", "adapter"]
564
+ },
565
+ ip: {
566
+ description: "Show/manipulate routing and network devices",
567
+ category: "network",
568
+ risk: "medium",
569
+ riskReason: "Can modify routing tables and network interfaces",
570
+ tags: ["routing", "interface", "address", "link"]
571
+ },
572
+ // ── Package Managers ───────────────────────────────────────
573
+ npm: {
574
+ description: "Node.js package manager",
575
+ category: "package-manager",
576
+ risk: "medium",
577
+ riskReason: "Can install packages with arbitrary post-install scripts",
578
+ tags: ["node", "install", "packages", "javascript", "registry"]
579
+ },
580
+ npx: {
581
+ description: "Execute npm package binaries",
582
+ category: "package-manager",
583
+ risk: "high",
584
+ riskReason: "Downloads and executes arbitrary packages on the fly",
585
+ tags: ["node", "execute", "run", "packages", "javascript"]
586
+ },
587
+ yarn: {
588
+ description: "Fast Node.js package manager",
589
+ category: "package-manager",
590
+ risk: "medium",
591
+ riskReason: "Can install packages with arbitrary post-install scripts",
592
+ tags: ["node", "install", "packages", "javascript", "registry"]
593
+ },
594
+ pnpm: {
595
+ description: "Efficient Node.js package manager",
596
+ category: "package-manager",
597
+ risk: "medium",
598
+ riskReason: "Can install packages with arbitrary post-install scripts",
599
+ tags: ["node", "install", "packages", "javascript", "registry"]
600
+ },
601
+ pip: {
602
+ description: "Python package installer",
603
+ category: "package-manager",
604
+ risk: "medium",
605
+ riskReason: "Can install packages with arbitrary setup scripts",
606
+ tags: ["python", "install", "packages", "pypi"]
607
+ },
608
+ pip3: {
609
+ description: "Python 3 package installer",
610
+ category: "package-manager",
611
+ risk: "medium",
612
+ riskReason: "Can install packages with arbitrary setup scripts",
613
+ tags: ["python", "install", "packages", "pypi"]
614
+ },
615
+ brew: {
616
+ description: "macOS/Linux package manager",
617
+ category: "package-manager",
618
+ risk: "medium",
619
+ riskReason: "Can install system-level software and modify PATH",
620
+ tags: ["homebrew", "install", "macos", "linux", "packages"]
621
+ },
622
+ gem: {
623
+ description: "Ruby package manager",
624
+ category: "package-manager",
625
+ risk: "medium",
626
+ riskReason: "Can install packages with native extensions",
627
+ tags: ["ruby", "install", "packages", "rubygems"]
628
+ },
629
+ cargo: {
630
+ description: "Rust package manager and build tool",
631
+ category: "package-manager",
632
+ risk: "medium",
633
+ riskReason: "Compiles and runs arbitrary Rust code during install",
634
+ tags: ["rust", "install", "build", "crates", "compile"]
635
+ },
636
+ composer: {
637
+ description: "PHP dependency manager",
638
+ category: "package-manager",
639
+ risk: "medium",
640
+ riskReason: "Can install packages with arbitrary scripts",
641
+ tags: ["php", "install", "packages", "packagist"]
642
+ },
643
+ apt: {
644
+ description: "Debian/Ubuntu package manager",
645
+ category: "package-manager",
646
+ risk: "high",
647
+ riskReason: "System-level package installation requiring root",
648
+ tags: ["debian", "ubuntu", "install", "system", "linux"]
649
+ },
650
+ yum: {
651
+ description: "RPM-based package manager",
652
+ category: "package-manager",
653
+ risk: "high",
654
+ riskReason: "System-level package installation requiring root",
655
+ tags: ["redhat", "centos", "install", "system", "linux", "rpm"]
656
+ },
657
+ // ── Shells ─────────────────────────────────────────────────
658
+ bash: {
659
+ description: "Bourne-Again SHell",
660
+ category: "shell",
661
+ risk: "high",
662
+ riskReason: "Full shell access \u2014 can execute arbitrary commands",
663
+ tags: ["shell", "script", "terminal", "bourne"]
664
+ },
665
+ zsh: {
666
+ description: "Z shell",
667
+ category: "shell",
668
+ risk: "high",
669
+ riskReason: "Full shell access \u2014 can execute arbitrary commands",
670
+ tags: ["shell", "script", "terminal"]
671
+ },
672
+ sh: {
673
+ description: "POSIX shell",
674
+ category: "shell",
675
+ risk: "high",
676
+ riskReason: "Full shell access \u2014 can execute arbitrary commands",
677
+ tags: ["shell", "script", "terminal", "posix"]
678
+ },
679
+ fish: {
680
+ description: "Friendly interactive shell",
681
+ category: "shell",
682
+ risk: "high",
683
+ riskReason: "Full shell access \u2014 can execute arbitrary commands",
684
+ tags: ["shell", "script", "terminal", "interactive"]
685
+ },
686
+ dash: {
687
+ description: "Debian Almquist shell",
688
+ category: "shell",
689
+ risk: "high",
690
+ riskReason: "Full shell access \u2014 can execute arbitrary commands",
691
+ tags: ["shell", "script", "terminal", "posix"]
692
+ },
693
+ ksh: {
694
+ description: "KornShell",
695
+ category: "shell",
696
+ risk: "high",
697
+ riskReason: "Full shell access \u2014 can execute arbitrary commands",
698
+ tags: ["shell", "script", "terminal"]
699
+ },
700
+ csh: {
701
+ description: "C shell",
702
+ category: "shell",
703
+ risk: "high",
704
+ riskReason: "Full shell access \u2014 can execute arbitrary commands",
705
+ tags: ["shell", "script", "terminal"]
706
+ },
707
+ tcsh: {
708
+ description: "Enhanced C shell",
709
+ category: "shell",
710
+ risk: "high",
711
+ riskReason: "Full shell access \u2014 can execute arbitrary commands",
712
+ tags: ["shell", "script", "terminal"]
713
+ },
714
+ // ── System ─────────────────────────────────────────────────
715
+ ls: {
716
+ description: "List directory contents",
717
+ category: "system",
718
+ risk: "low",
719
+ riskReason: "Read-only directory listing",
720
+ tags: ["list", "directory", "files"]
721
+ },
722
+ cp: {
723
+ description: "Copy files and directories",
724
+ category: "system",
725
+ risk: "medium",
726
+ riskReason: "Can overwrite files and duplicate sensitive data",
727
+ tags: ["copy", "duplicate", "file"]
728
+ },
729
+ mv: {
730
+ description: "Move or rename files",
731
+ category: "system",
732
+ risk: "medium",
733
+ riskReason: "Can overwrite existing files",
734
+ tags: ["move", "rename", "file"]
735
+ },
736
+ rm: {
737
+ description: "Remove files or directories",
738
+ category: "system",
739
+ risk: "high",
740
+ riskReason: "Can permanently delete critical files",
741
+ tags: ["delete", "remove", "file"]
742
+ },
743
+ mkdir: {
744
+ description: "Create directories",
745
+ category: "system",
746
+ risk: "low",
747
+ riskReason: "Creates new directories only",
748
+ tags: ["create", "directory", "folder"]
749
+ },
750
+ chmod: {
751
+ description: "Change file permissions",
752
+ category: "system",
753
+ risk: "high",
754
+ riskReason: "Can make files executable or world-readable",
755
+ tags: ["permissions", "access", "mode", "security"]
756
+ },
757
+ chown: {
758
+ description: "Change file ownership",
759
+ category: "system",
760
+ risk: "high",
761
+ riskReason: "Can transfer file ownership, requires root",
762
+ tags: ["ownership", "user", "group", "security"]
763
+ },
764
+ chgrp: {
765
+ description: "Change group ownership",
766
+ category: "system",
767
+ risk: "medium",
768
+ riskReason: "Can change file group access",
769
+ tags: ["ownership", "group", "security"]
770
+ },
771
+ cat: {
772
+ description: "Concatenate and display files",
773
+ category: "system",
774
+ risk: "low",
775
+ riskReason: "Read-only file output",
776
+ tags: ["read", "display", "file", "output"]
777
+ },
778
+ echo: {
779
+ description: "Display text or write to files",
780
+ category: "system",
781
+ risk: "low",
782
+ riskReason: "Text output, low risk unless redirected",
783
+ tags: ["print", "text", "output"]
784
+ },
785
+ touch: {
786
+ description: "Create empty files or update timestamps",
787
+ category: "system",
788
+ risk: "low",
789
+ riskReason: "Creates empty files or updates metadata",
790
+ tags: ["create", "file", "timestamp"]
791
+ },
792
+ ln: {
793
+ description: "Create file links",
794
+ category: "system",
795
+ risk: "medium",
796
+ riskReason: "Symlinks can redirect file access",
797
+ tags: ["link", "symlink", "hardlink", "file"]
798
+ },
799
+ find: {
800
+ description: "Search for files in directory hierarchy",
801
+ category: "system",
802
+ risk: "low",
803
+ riskReason: "Read-only file search with exec option",
804
+ tags: ["search", "files", "directory", "locate"]
805
+ },
806
+ grep: {
807
+ description: "Search file contents with patterns",
808
+ category: "system",
809
+ risk: "low",
810
+ riskReason: "Read-only content search",
811
+ tags: ["search", "pattern", "regex", "text", "match"]
812
+ },
813
+ sed: {
814
+ description: "Stream editor for text transformation",
815
+ category: "system",
816
+ risk: "medium",
817
+ riskReason: "Can modify files in-place",
818
+ tags: ["edit", "transform", "text", "replace", "regex"]
819
+ },
820
+ awk: {
821
+ description: "Pattern scanning and text processing",
822
+ category: "system",
823
+ risk: "medium",
824
+ riskReason: "Turing-complete language, can execute system commands",
825
+ tags: ["text", "processing", "pattern", "columns", "transform"]
826
+ },
827
+ ps: {
828
+ description: "Report process status",
829
+ category: "system",
830
+ risk: "low",
831
+ riskReason: "Read-only process listing",
832
+ tags: ["process", "status", "list", "running"]
833
+ },
834
+ kill: {
835
+ description: "Send signals to processes",
836
+ category: "system",
837
+ risk: "high",
838
+ riskReason: "Can terminate critical processes",
839
+ tags: ["process", "signal", "terminate", "stop"]
840
+ },
841
+ top: {
842
+ description: "Display real-time process activity",
843
+ category: "system",
844
+ risk: "low",
845
+ riskReason: "Read-only system monitoring",
846
+ tags: ["process", "monitor", "cpu", "memory"]
847
+ },
848
+ df: {
849
+ description: "Report disk space usage",
850
+ category: "system",
851
+ risk: "low",
852
+ riskReason: "Read-only disk stats",
853
+ tags: ["disk", "space", "usage", "filesystem"]
854
+ },
855
+ du: {
856
+ description: "Estimate file space usage",
857
+ category: "system",
858
+ risk: "low",
859
+ riskReason: "Read-only file size inspection",
860
+ tags: ["disk", "size", "usage", "file"]
861
+ },
862
+ mount: {
863
+ description: "Mount filesystems",
864
+ category: "system",
865
+ risk: "high",
866
+ riskReason: "Can attach external filesystems, requires root",
867
+ tags: ["filesystem", "attach", "volume", "disk"]
868
+ },
869
+ umount: {
870
+ description: "Unmount filesystems",
871
+ category: "system",
872
+ risk: "high",
873
+ riskReason: "Can detach active filesystems, requires root",
874
+ tags: ["filesystem", "detach", "volume", "disk"]
875
+ },
876
+ head: {
877
+ description: "Output first part of files",
878
+ category: "system",
879
+ risk: "low",
880
+ riskReason: "Read-only file output",
881
+ tags: ["read", "file", "first", "lines", "output"]
882
+ },
883
+ tail: {
884
+ description: "Output last part of files",
885
+ category: "system",
886
+ risk: "low",
887
+ riskReason: "Read-only file output",
888
+ tags: ["read", "file", "last", "lines", "output", "follow"]
889
+ },
890
+ wc: {
891
+ description: "Count lines, words, and bytes",
892
+ category: "system",
893
+ risk: "low",
894
+ riskReason: "Read-only counting",
895
+ tags: ["count", "lines", "words", "bytes", "file"]
896
+ },
897
+ sort: {
898
+ description: "Sort lines of text",
899
+ category: "system",
900
+ risk: "low",
901
+ riskReason: "Text processing, low risk",
902
+ tags: ["sort", "order", "text", "lines"]
903
+ },
904
+ uniq: {
905
+ description: "Filter adjacent duplicate lines",
906
+ category: "system",
907
+ risk: "low",
908
+ riskReason: "Text processing, low risk",
909
+ tags: ["unique", "duplicate", "filter", "text"]
910
+ },
911
+ tar: {
912
+ description: "Archive and compress files",
913
+ category: "system",
914
+ risk: "medium",
915
+ riskReason: "Can overwrite files during extraction",
916
+ tags: ["archive", "compress", "extract", "backup", "gzip"]
917
+ },
918
+ xargs: {
919
+ description: "Build and execute commands from stdin",
920
+ category: "system",
921
+ risk: "medium",
922
+ riskReason: "Executes commands with piped arguments",
923
+ tags: ["execute", "pipe", "arguments", "build"]
924
+ },
925
+ tee: {
926
+ description: "Read stdin and write to files and stdout",
927
+ category: "system",
928
+ risk: "low",
929
+ riskReason: "Writes output to files",
930
+ tags: ["output", "write", "pipe", "file"]
931
+ },
932
+ env: {
933
+ description: "Display or set environment variables",
934
+ category: "system",
935
+ risk: "low",
936
+ riskReason: "Can expose environment variables including secrets",
937
+ tags: ["environment", "variables", "config"]
938
+ },
939
+ printenv: {
940
+ description: "Print environment variables",
941
+ category: "system",
942
+ risk: "low",
943
+ riskReason: "Can expose environment variables including secrets",
944
+ tags: ["environment", "variables", "display"]
945
+ },
946
+ which: {
947
+ description: "Locate a command",
948
+ category: "system",
949
+ risk: "info",
950
+ riskReason: "Read-only path lookup",
951
+ tags: ["locate", "path", "command", "binary"]
952
+ },
953
+ whoami: {
954
+ description: "Print current user name",
955
+ category: "system",
956
+ risk: "info",
957
+ riskReason: "Read-only user info",
958
+ tags: ["user", "identity", "login"]
959
+ },
960
+ uname: {
961
+ description: "Print system information",
962
+ category: "system",
963
+ risk: "info",
964
+ riskReason: "Read-only system info",
965
+ tags: ["system", "kernel", "os", "info"]
966
+ },
967
+ date: {
968
+ description: "Display or set date and time",
969
+ category: "system",
970
+ risk: "info",
971
+ riskReason: "Read-only time display",
972
+ tags: ["time", "date", "clock"]
973
+ },
974
+ sudo: {
975
+ description: "Execute command as superuser",
976
+ category: "system",
977
+ risk: "high",
978
+ riskReason: "Full root privilege escalation",
979
+ tags: ["root", "superuser", "privilege", "admin", "elevate"]
980
+ },
981
+ crontab: {
982
+ description: "Schedule periodic commands",
983
+ category: "system",
984
+ risk: "high",
985
+ riskReason: "Can schedule persistent background tasks",
986
+ tags: ["schedule", "cron", "periodic", "job", "task"]
987
+ },
988
+ // ── Language Runtimes ──────────────────────────────────────
989
+ node: {
990
+ description: "Node.js JavaScript runtime",
991
+ category: "language-runtime",
992
+ risk: "medium",
993
+ riskReason: "Can execute arbitrary code with network access",
994
+ tags: ["javascript", "runtime", "execute", "v8", "server"]
995
+ },
996
+ python: {
997
+ description: "Python interpreter",
998
+ category: "language-runtime",
999
+ risk: "medium",
1000
+ riskReason: "Can execute arbitrary code with full system access",
1001
+ tags: ["python", "runtime", "execute", "script", "interpreter"]
1002
+ },
1003
+ python3: {
1004
+ description: "Python 3 interpreter",
1005
+ category: "language-runtime",
1006
+ risk: "medium",
1007
+ riskReason: "Can execute arbitrary code with full system access",
1008
+ tags: ["python", "runtime", "execute", "script", "interpreter"]
1009
+ },
1010
+ ruby: {
1011
+ description: "Ruby interpreter",
1012
+ category: "language-runtime",
1013
+ risk: "medium",
1014
+ riskReason: "Can execute arbitrary code with full system access",
1015
+ tags: ["ruby", "runtime", "execute", "script", "interpreter"]
1016
+ },
1017
+ perl: {
1018
+ description: "Perl interpreter",
1019
+ category: "language-runtime",
1020
+ risk: "medium",
1021
+ riskReason: "Can execute arbitrary code with full system access",
1022
+ tags: ["perl", "runtime", "execute", "script", "interpreter"]
1023
+ },
1024
+ java: {
1025
+ description: "Java application launcher",
1026
+ category: "language-runtime",
1027
+ risk: "medium",
1028
+ riskReason: "Can execute arbitrary JVM code",
1029
+ tags: ["java", "jvm", "runtime", "execute", "jar"]
1030
+ },
1031
+ go: {
1032
+ description: "Go programming language tool",
1033
+ category: "language-runtime",
1034
+ risk: "medium",
1035
+ riskReason: "Can compile and run arbitrary Go code",
1036
+ tags: ["golang", "compile", "runtime", "build", "execute"]
1037
+ },
1038
+ rustc: {
1039
+ description: "Rust compiler",
1040
+ category: "language-runtime",
1041
+ risk: "medium",
1042
+ riskReason: "Compiles code that runs with full system access",
1043
+ tags: ["rust", "compile", "build"]
1044
+ },
1045
+ deno: {
1046
+ description: "Secure JavaScript/TypeScript runtime",
1047
+ category: "language-runtime",
1048
+ risk: "medium",
1049
+ riskReason: "Can execute code, sandboxed by default but flags allow access",
1050
+ tags: ["javascript", "typescript", "runtime", "execute", "secure"]
1051
+ },
1052
+ bun: {
1053
+ description: "Fast JavaScript runtime and toolkit",
1054
+ category: "language-runtime",
1055
+ risk: "medium",
1056
+ riskReason: "Can execute arbitrary code with network access",
1057
+ tags: ["javascript", "typescript", "runtime", "execute", "fast"]
1058
+ },
1059
+ php: {
1060
+ description: "PHP interpreter",
1061
+ category: "language-runtime",
1062
+ risk: "medium",
1063
+ riskReason: "Can execute arbitrary code with full system access",
1064
+ tags: ["php", "runtime", "execute", "script", "web"]
1065
+ },
1066
+ // ── Version Control ────────────────────────────────────────
1067
+ git: {
1068
+ description: "Distributed version control",
1069
+ category: "network",
1070
+ risk: "medium",
1071
+ riskReason: "Network ops can access remote repos and run hooks",
1072
+ tags: ["vcs", "clone", "push", "pull", "repository", "commit", "branch"]
1073
+ },
1074
+ svn: {
1075
+ description: "Subversion version control",
1076
+ category: "network",
1077
+ risk: "medium",
1078
+ riskReason: "Network access to remote repositories",
1079
+ tags: ["vcs", "checkout", "repository", "subversion"]
1080
+ },
1081
+ // ── Container & Orchestration ──────────────────────────────
1082
+ docker: {
1083
+ description: "Container runtime and management",
1084
+ category: "system",
1085
+ risk: "high",
1086
+ riskReason: "Can run containers with host access and mount volumes",
1087
+ tags: ["container", "image", "build", "run", "volume", "compose"]
1088
+ },
1089
+ "docker-compose": {
1090
+ description: "Multi-container Docker orchestration",
1091
+ category: "system",
1092
+ risk: "high",
1093
+ riskReason: "Can start multiple containers with host access",
1094
+ tags: ["container", "compose", "orchestrate", "multi-container"]
1095
+ },
1096
+ kubectl: {
1097
+ description: "Kubernetes cluster management",
1098
+ category: "system",
1099
+ risk: "high",
1100
+ riskReason: "Full cluster access \u2014 can deploy, delete, and modify workloads",
1101
+ tags: ["kubernetes", "k8s", "cluster", "deploy", "pods", "orchestrate"]
1102
+ },
1103
+ helm: {
1104
+ description: "Kubernetes package manager",
1105
+ category: "package-manager",
1106
+ risk: "high",
1107
+ riskReason: "Can install and modify Kubernetes deployments",
1108
+ tags: ["kubernetes", "k8s", "charts", "deploy", "install"]
1109
+ },
1110
+ podman: {
1111
+ description: "Daemonless container engine",
1112
+ category: "system",
1113
+ risk: "high",
1114
+ riskReason: "Can run containers with host access",
1115
+ tags: ["container", "image", "build", "run", "rootless"]
1116
+ },
1117
+ // ── Infrastructure & Cloud ─────────────────────────────────
1118
+ terraform: {
1119
+ description: "Infrastructure as code tool",
1120
+ category: "system",
1121
+ risk: "high",
1122
+ riskReason: "Can create, modify, and destroy cloud infrastructure",
1123
+ tags: ["iac", "cloud", "infrastructure", "provision", "hcl"]
1124
+ },
1125
+ aws: {
1126
+ description: "AWS command line interface",
1127
+ category: "network",
1128
+ risk: "high",
1129
+ riskReason: "Full AWS account access \u2014 can modify any service",
1130
+ tags: ["cloud", "amazon", "s3", "ec2", "lambda", "infrastructure"]
1131
+ },
1132
+ gcloud: {
1133
+ description: "Google Cloud CLI",
1134
+ category: "network",
1135
+ risk: "high",
1136
+ riskReason: "Full GCP access \u2014 can modify any service",
1137
+ tags: ["cloud", "google", "gcp", "infrastructure"]
1138
+ },
1139
+ az: {
1140
+ description: "Azure command line interface",
1141
+ category: "network",
1142
+ risk: "high",
1143
+ riskReason: "Full Azure access \u2014 can modify any service",
1144
+ tags: ["cloud", "azure", "microsoft", "infrastructure"]
1145
+ },
1146
+ // ── Build Tools ────────────────────────────────────────────
1147
+ make: {
1148
+ description: "Build automation tool",
1149
+ category: "system",
1150
+ risk: "medium",
1151
+ riskReason: "Executes Makefile targets which can run arbitrary commands",
1152
+ tags: ["build", "compile", "automation", "makefile"]
1153
+ },
1154
+ cmake: {
1155
+ description: "Cross-platform build system generator",
1156
+ category: "system",
1157
+ risk: "medium",
1158
+ riskReason: "Generates build files that can run arbitrary commands",
1159
+ tags: ["build", "compile", "generate", "cross-platform"]
1160
+ },
1161
+ nx: {
1162
+ description: "Monorepo build system",
1163
+ category: "system",
1164
+ risk: "medium",
1165
+ riskReason: "Can run arbitrary scripts defined in project configuration",
1166
+ tags: ["monorepo", "build", "workspace", "tasks"]
1167
+ },
1168
+ // ── Editors / Utilities ────────────────────────────────────
1169
+ vi: {
1170
+ description: "Visual text editor",
1171
+ category: "system",
1172
+ risk: "medium",
1173
+ riskReason: "Can execute shell commands from within editor",
1174
+ tags: ["editor", "text", "file", "edit"]
1175
+ },
1176
+ vim: {
1177
+ description: "Vi IMproved text editor",
1178
+ category: "system",
1179
+ risk: "medium",
1180
+ riskReason: "Can execute shell commands from within editor",
1181
+ tags: ["editor", "text", "file", "edit"]
1182
+ },
1183
+ nano: {
1184
+ description: "Simple terminal text editor",
1185
+ category: "system",
1186
+ risk: "low",
1187
+ riskReason: "File editing only, no command execution",
1188
+ tags: ["editor", "text", "file", "edit", "simple"]
1189
+ },
1190
+ less: {
1191
+ description: "File pager \u2014 view file contents",
1192
+ category: "system",
1193
+ risk: "low",
1194
+ riskReason: "Read-only file viewing",
1195
+ tags: ["view", "pager", "read", "file"]
1196
+ },
1197
+ more: {
1198
+ description: "File pager",
1199
+ category: "system",
1200
+ risk: "low",
1201
+ riskReason: "Read-only file viewing",
1202
+ tags: ["view", "pager", "read", "file"]
1203
+ }
1204
+ };
1205
+ function searchCatalog(query, entries = COMMAND_CATALOG, limit = 20) {
1206
+ const q = query.toLowerCase().trim();
1207
+ if (!q) {
1208
+ return Object.entries(entries).slice(0, limit).map(([name, entry]) => ({ name, entry, score: 0 }));
1209
+ }
1210
+ const tokens = q.split(/\s+/);
1211
+ const results = [];
1212
+ for (const [name, entry] of Object.entries(entries)) {
1213
+ let totalScore = 0;
1214
+ const nameLower = name.toLowerCase();
1215
+ const descLower = entry.description.toLowerCase();
1216
+ for (const token of tokens) {
1217
+ let tokenScore = 0;
1218
+ if (nameLower === token) {
1219
+ tokenScore = 100;
1220
+ } else if (nameLower.startsWith(token)) {
1221
+ tokenScore = 60;
1222
+ } else if (nameLower.includes(token)) {
1223
+ tokenScore = 40;
1224
+ }
1225
+ for (const tag of entry.tags) {
1226
+ const tagLower = tag.toLowerCase();
1227
+ if (tagLower === token) {
1228
+ tokenScore = Math.max(tokenScore, 30);
1229
+ } else if (tagLower.includes(token)) {
1230
+ tokenScore = Math.max(tokenScore, 15);
1231
+ }
1232
+ }
1233
+ if (descLower.includes(token)) {
1234
+ tokenScore = Math.max(tokenScore, 10);
1235
+ }
1236
+ totalScore += tokenScore;
1237
+ }
1238
+ if (totalScore > 0) {
1239
+ results.push({ name, entry, score: totalScore });
1240
+ }
1241
+ }
1242
+ results.sort((a, b) => b.score - a.score);
1243
+ return results.slice(0, limit);
1244
+ }
1245
+
1246
+ // libs/shield-ipc/src/constants.ts
1247
+ var DEFAULT_PORT = 5200;
1248
+ var DEFAULT_HOST = "127.0.0.1";
1249
+ var CUSTOM_HOSTNAME = "agen.shield";
1250
+ var CONFIG_DIR = ".agenshield";
1251
+ var CONFIG_FILE = "config.json";
1252
+ var PID_FILE = "daemon.pid";
1253
+ var LOG_FILE = "daemon.log";
1254
+ var STATE_FILE = "state.json";
1255
+ var VAULT_FILE = "vault.enc";
1256
+ var AGENCO_DIR = "agenco";
1257
+ var POLICIES_DIR = "policies";
1258
+ var USERS_DIR = "users";
1259
+ var MARKETPLACE_DIR = "marketplace";
1260
+ var CALLBACK_PORT = 9876;
1261
+ var MCP_GATEWAY = "https://mcp.marketplace.frontegg.com";
1262
+ var MARKETPLACE_API = "https://my.mcp.marketplace.frontegg.com";
1263
+ var API_PREFIX = "/api";
1264
+ var ENDPOINTS = {
1265
+ HEALTH: "/health",
1266
+ STATUS: "/status",
1267
+ CONFIG: "/config",
1268
+ POLICIES: "/policies",
1269
+ SECURITY: "/security"
1270
+ };
1271
+ var SSE_PREFIX = "/sse";
1272
+ var SSE_ENDPOINTS = {
1273
+ /** All events stream */
1274
+ EVENTS: "/sse/events",
1275
+ /** Security events only */
1276
+ SECURITY: "/sse/events/security",
1277
+ /** Broker events only */
1278
+ BROKER: "/sse/events/broker",
1279
+ /** API traffic events only */
1280
+ API: "/sse/events/api"
1281
+ };
1282
+ export {
1283
+ AGENCO_DIR,
1284
+ API_PREFIX,
1285
+ AgenCoAuthCallbackRequestSchema,
1286
+ AgenCoAuthCallbackResponseSchema,
1287
+ AgenCoAuthStartRequestSchema,
1288
+ AgenCoAuthStartResponseSchema,
1289
+ AgenCoAuthStatusResponseSchema,
1290
+ AgenCoConnectIntegrationRequestSchema,
1291
+ AgenCoConnectIntegrationResponseSchema,
1292
+ AgenCoConnectedIntegrationSchema,
1293
+ AgenCoConnectedIntegrationsResponseSchema,
1294
+ AgenCoIntegrationActionSchema,
1295
+ AgenCoIntegrationSchema,
1296
+ AgenCoIntegrationsListRequestSchema,
1297
+ AgenCoIntegrationsListResponseSchema,
1298
+ AgenCoSecretsSchema,
1299
+ AgenCoStateSchema,
1300
+ AgenCoToolListRequestSchema,
1301
+ AgenCoToolListResponseSchema,
1302
+ AgenCoToolRunRequestSchema,
1303
+ AgenCoToolRunResponseSchema,
1304
+ AgenCoToolSchema,
1305
+ AgenCoToolSearchRequestSchema,
1306
+ AuthConfigSchema,
1307
+ AuthStatusResponseSchema,
1308
+ BACKUP_CONFIG,
1309
+ BrokerErrorSchema,
1310
+ BrokerRequestSchema,
1311
+ BrokerResponseSchema,
1312
+ CALLBACK_PORT,
1313
+ COMMAND_CATALOG,
1314
+ CONFIG_DIR,
1315
+ CONFIG_FILE,
1316
+ CUSTOM_HOSTNAME,
1317
+ ChangePasscodeRequestSchema,
1318
+ ChangePasscodeResponseSchema,
1319
+ ChannelRestrictionSchema,
1320
+ DEFAULT_AUTH_CONFIG,
1321
+ DEFAULT_CHANNEL_RESTRICTIONS,
1322
+ DEFAULT_HOST,
1323
+ DEFAULT_PORT,
1324
+ DaemonConfigSchema,
1325
+ DaemonStateSchema,
1326
+ ENDPOINTS,
1327
+ EnvInjectionRuleSchema,
1328
+ ExecParamsSchema,
1329
+ FileListParamsSchema,
1330
+ FileReadParamsSchema,
1331
+ FileWriteParamsSchema,
1332
+ FsConstraintsSchema,
1333
+ GroupDefinitionSchema,
1334
+ GroupStateSchema,
1335
+ HttpRequestParamsSchema,
1336
+ InstallationConfigSchema,
1337
+ InstallationStateSchema,
1338
+ LOG_FILE,
1339
+ LockRequestSchema,
1340
+ LockResponseSchema,
1341
+ MARKETPLACE_API,
1342
+ MARKETPLACE_DIR,
1343
+ MCP_GATEWAY,
1344
+ NetworkConstraintsSchema,
1345
+ OpenUrlParamsSchema,
1346
+ OperationTypeSchema,
1347
+ PID_FILE,
1348
+ POLICIES_DIR,
1349
+ PasscodeDataSchema,
1350
+ PasscodeProtectionStateSchema,
1351
+ PathsConfigSchema,
1352
+ PingParamsSchema,
1353
+ PolicyCheckParamsSchema,
1354
+ PolicyConfigSchema,
1355
+ PolicyConfigurationSchema,
1356
+ PolicyEvaluationResultSchema,
1357
+ PolicyRuleSchema,
1358
+ SSE_ENDPOINTS,
1359
+ SSE_PREFIX,
1360
+ STATE_FILE,
1361
+ SecretInjectParamsSchema,
1362
+ SessionSchema,
1363
+ SetupPasscodeRequestSchema,
1364
+ SetupPasscodeResponseSchema,
1365
+ ShieldConfigSchema,
1366
+ SystemStateSchema,
1367
+ USERS_DIR,
1368
+ UnlockRequestSchema,
1369
+ UnlockResponseSchema,
1370
+ UserConfigSchema,
1371
+ UserDefinitionSchema,
1372
+ UserStateSchema,
1373
+ VAULT_FILE,
1374
+ VaultConfigSchema,
1375
+ VaultContentsSchema,
1376
+ searchCatalog
1377
+ };