opena2a-cli 0.1.2 → 0.3.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/README.md +225 -1
- package/dist/commands/guard-hooks.d.ts +27 -0
- package/dist/commands/guard-hooks.d.ts.map +1 -0
- package/dist/commands/guard-hooks.js +207 -0
- package/dist/commands/guard-hooks.js.map +1 -0
- package/dist/commands/guard-policy.d.ts +54 -0
- package/dist/commands/guard-policy.d.ts.map +1 -0
- package/dist/commands/guard-policy.js +251 -0
- package/dist/commands/guard-policy.js.map +1 -0
- package/dist/commands/guard-signing.d.ts +52 -0
- package/dist/commands/guard-signing.d.ts.map +1 -0
- package/dist/commands/guard-signing.js +185 -0
- package/dist/commands/guard-signing.js.map +1 -0
- package/dist/commands/guard-snapshots.d.ts +54 -0
- package/dist/commands/guard-snapshots.d.ts.map +1 -0
- package/dist/commands/guard-snapshots.js +346 -0
- package/dist/commands/guard-snapshots.js.map +1 -0
- package/dist/commands/guard.d.ts +60 -4
- package/dist/commands/guard.d.ts.map +1 -1
- package/dist/commands/guard.js +475 -95
- package/dist/commands/guard.js.map +1 -1
- package/dist/commands/init.js +3 -4
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/review.d.ts +110 -0
- package/dist/commands/review.d.ts.map +1 -0
- package/dist/commands/review.js +634 -0
- package/dist/commands/review.js.map +1 -0
- package/dist/commands/shield.d.ts +3 -0
- package/dist/commands/shield.d.ts.map +1 -1
- package/dist/commands/shield.js +488 -34
- package/dist/commands/shield.js.map +1 -1
- package/dist/index.js +36 -6
- package/dist/index.js.map +1 -1
- package/dist/report/review-html.d.ts +16 -0
- package/dist/report/review-html.d.ts.map +1 -0
- package/dist/report/review-html.js +579 -0
- package/dist/report/review-html.js.map +1 -0
- package/dist/router.d.ts.map +1 -1
- package/dist/router.js +2 -1
- package/dist/router.js.map +1 -1
- package/dist/shield/ai-tool-config.d.ts +49 -0
- package/dist/shield/ai-tool-config.d.ts.map +1 -0
- package/dist/shield/ai-tool-config.js +169 -0
- package/dist/shield/ai-tool-config.js.map +1 -0
- package/dist/shield/arp-bridge.d.ts +62 -0
- package/dist/shield/arp-bridge.d.ts.map +1 -0
- package/dist/shield/arp-bridge.js +198 -0
- package/dist/shield/arp-bridge.js.map +1 -0
- package/dist/shield/baselines.d.ts +58 -0
- package/dist/shield/baselines.d.ts.map +1 -0
- package/dist/shield/baselines.js +371 -0
- package/dist/shield/baselines.js.map +1 -0
- package/dist/shield/findings.d.ts +52 -0
- package/dist/shield/findings.d.ts.map +1 -0
- package/dist/shield/findings.js +336 -0
- package/dist/shield/findings.js.map +1 -0
- package/dist/shield/init.d.ts +3 -0
- package/dist/shield/init.d.ts.map +1 -1
- package/dist/shield/init.js +145 -12
- package/dist/shield/init.js.map +1 -1
- package/dist/shield/integrity.d.ts.map +1 -1
- package/dist/shield/integrity.js +6 -2
- package/dist/shield/integrity.js.map +1 -1
- package/dist/shield/report-html.d.ts +29 -0
- package/dist/shield/report-html.d.ts.map +1 -0
- package/dist/shield/report-html.js +689 -0
- package/dist/shield/report-html.js.map +1 -0
- package/dist/shield/sarif.d.ts +65 -0
- package/dist/shield/sarif.d.ts.map +1 -0
- package/dist/shield/sarif.js +108 -0
- package/dist/shield/sarif.js.map +1 -0
- package/dist/shield/status.d.ts.map +1 -1
- package/dist/shield/status.js +19 -6
- package/dist/shield/status.js.map +1 -1
- package/dist/shield/types.d.ts +19 -1
- package/dist/shield/types.d.ts.map +1 -1
- package/dist/shield/types.js +2 -1
- package/dist/shield/types.js.map +1 -1
- package/package.json +5 -1
package/dist/router.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"router.js","sourceRoot":"","sources":["../src/router.ts"],"names":[],"mappings":";;AAsBA,sCA8CC;AAKD,
|
|
1
|
+
{"version":3,"file":"router.js","sourceRoot":"","sources":["../src/router.ts"],"names":[],"mappings":";;AAsBA,sCA8CC;AAKD,0CAwFC;AAjKD,kDAAoD;AAEpD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AO,GAAG,IAAA,wBAAa,EAAC,WAAW,CAAC,CAAC;IAC3C,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,oBAAoB,OAAO,IAAI,CAAC,CAAC;QACtD,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,gDAAgD,CAAC,CAAC;QACvE,OAAO,CAAC,CAAC;IACX,CAAC;IAED,MAAM,SAAS,GAAG,MAAM,OAAO,CAAC,WAAW,EAAE,CAAC;IAC9C,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,IAAI,sBAAsB,CAAC,CAAC;QACnE,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,2BAA2B,OAAO,CAAC,MAAM,CAAC,WAAW,IAAI,OAAO,CAAC,MAAM,CAAC,OAAO,IAAI,OAAO,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC,CAAC;QACjI,OAAO,CAAC,CAAC;IACX,CAAC;IAED,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;QAC/B,IAAI,EAAE,WAAW;QACjB,GAAG,aAAa;QAChB,GAAG,EAAE,aAAa,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,EAAE;KACxC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC,QAAQ,CAAC;AACzB,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AI Tool Configuration for Shield
|
|
3
|
+
*
|
|
4
|
+
* Adds Shield-specific security context to AI coding tool instruction files.
|
|
5
|
+
* Each tool gets its own marker so Secretless and Shield sections coexist
|
|
6
|
+
* without interfering with each other.
|
|
7
|
+
*
|
|
8
|
+
* Secretless owns: <!-- secretless:managed -->
|
|
9
|
+
* Shield owns: <!-- opena2a-shield:managed -->
|
|
10
|
+
*/
|
|
11
|
+
export interface AiToolConfigResult {
|
|
12
|
+
toolsConfigured: string[];
|
|
13
|
+
toolsSkipped: string[];
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Configure Claude Code with Shield context.
|
|
17
|
+
* Appends to CLAUDE.md if marker is not already present.
|
|
18
|
+
*/
|
|
19
|
+
export declare function configureClaudeCodeForShield(targetDir: string): boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Configure Cursor with Shield context.
|
|
22
|
+
* Appends to .cursorrules if marker is not already present.
|
|
23
|
+
*/
|
|
24
|
+
export declare function configureCursorForShield(targetDir: string): boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Configure Windsurf with Shield context.
|
|
27
|
+
* Appends to .windsurfrules if marker is not already present.
|
|
28
|
+
*/
|
|
29
|
+
export declare function configureWindsurfForShield(targetDir: string): boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Configure GitHub Copilot with Shield context.
|
|
32
|
+
* Appends to .github/copilot-instructions.md if marker is not already present.
|
|
33
|
+
*/
|
|
34
|
+
export declare function configureCopilotForShield(targetDir: string): boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Configure Cline with Shield context.
|
|
37
|
+
* Appends to .clinerules if marker is not already present.
|
|
38
|
+
*/
|
|
39
|
+
export declare function configureClineForShield(targetDir: string): boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Check if the Shield marker exists in a file.
|
|
42
|
+
*/
|
|
43
|
+
export declare function hasShieldMarker(filePath: string): boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Configure all detected AI tools with Shield context.
|
|
46
|
+
* Only configures tools that have existing config files (except CLAUDE.md which is always created).
|
|
47
|
+
*/
|
|
48
|
+
export declare function configureAiTools(targetDir: string, detectedAssistants: string[]): AiToolConfigResult;
|
|
49
|
+
//# sourceMappingURL=ai-tool-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai-tool-config.d.ts","sourceRoot":"","sources":["../../src/shield/ai-tool-config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAyBH,MAAM,WAAW,kBAAkB;IACjC,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB;AAED;;;GAGG;AACH,wBAAgB,4BAA4B,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAGvE;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAGnE;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAGrE;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAGpE;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAGlE;AA4BD;;GAEG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAOzD;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,EAAE,GAAG,kBAAkB,CAgDpG"}
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* AI Tool Configuration for Shield
|
|
4
|
+
*
|
|
5
|
+
* Adds Shield-specific security context to AI coding tool instruction files.
|
|
6
|
+
* Each tool gets its own marker so Secretless and Shield sections coexist
|
|
7
|
+
* without interfering with each other.
|
|
8
|
+
*
|
|
9
|
+
* Secretless owns: <!-- secretless:managed -->
|
|
10
|
+
* Shield owns: <!-- opena2a-shield:managed -->
|
|
11
|
+
*/
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.configureClaudeCodeForShield = configureClaudeCodeForShield;
|
|
14
|
+
exports.configureCursorForShield = configureCursorForShield;
|
|
15
|
+
exports.configureWindsurfForShield = configureWindsurfForShield;
|
|
16
|
+
exports.configureCopilotForShield = configureCopilotForShield;
|
|
17
|
+
exports.configureClineForShield = configureClineForShield;
|
|
18
|
+
exports.hasShieldMarker = hasShieldMarker;
|
|
19
|
+
exports.configureAiTools = configureAiTools;
|
|
20
|
+
const node_fs_1 = require("node:fs");
|
|
21
|
+
const node_path_1 = require("node:path");
|
|
22
|
+
const SHIELD_MARKER = '<!-- opena2a-shield:managed -->';
|
|
23
|
+
const SHIELD_SECTION = `${SHIELD_MARKER}
|
|
24
|
+
## Shield Security Context
|
|
25
|
+
|
|
26
|
+
This project is protected by OpenA2A Shield.
|
|
27
|
+
|
|
28
|
+
**Security posture:**
|
|
29
|
+
- \`opena2a shield status\` -- view protection status
|
|
30
|
+
- \`opena2a shield log\` -- query security event log
|
|
31
|
+
- \`opena2a shield selfcheck\` -- verify integrity
|
|
32
|
+
|
|
33
|
+
**Config file changes:**
|
|
34
|
+
- Run \`opena2a guard resign\` after intentional config modifications
|
|
35
|
+
- Config integrity is monitored -- unauthorized changes trigger alerts
|
|
36
|
+
|
|
37
|
+
**Agent identity:**
|
|
38
|
+
- This session has a local Ed25519 identity (view: \`opena2a shield session\`)
|
|
39
|
+
`;
|
|
40
|
+
/**
|
|
41
|
+
* Configure Claude Code with Shield context.
|
|
42
|
+
* Appends to CLAUDE.md if marker is not already present.
|
|
43
|
+
*/
|
|
44
|
+
function configureClaudeCodeForShield(targetDir) {
|
|
45
|
+
const claudeMdPath = (0, node_path_1.join)(targetDir, 'CLAUDE.md');
|
|
46
|
+
return appendShieldSection(claudeMdPath);
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Configure Cursor with Shield context.
|
|
50
|
+
* Appends to .cursorrules if marker is not already present.
|
|
51
|
+
*/
|
|
52
|
+
function configureCursorForShield(targetDir) {
|
|
53
|
+
const cursorPath = (0, node_path_1.join)(targetDir, '.cursorrules');
|
|
54
|
+
return appendShieldSection(cursorPath);
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Configure Windsurf with Shield context.
|
|
58
|
+
* Appends to .windsurfrules if marker is not already present.
|
|
59
|
+
*/
|
|
60
|
+
function configureWindsurfForShield(targetDir) {
|
|
61
|
+
const windsurfPath = (0, node_path_1.join)(targetDir, '.windsurfrules');
|
|
62
|
+
return appendShieldSection(windsurfPath);
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Configure GitHub Copilot with Shield context.
|
|
66
|
+
* Appends to .github/copilot-instructions.md if marker is not already present.
|
|
67
|
+
*/
|
|
68
|
+
function configureCopilotForShield(targetDir) {
|
|
69
|
+
const copilotPath = (0, node_path_1.join)(targetDir, '.github', 'copilot-instructions.md');
|
|
70
|
+
return appendShieldSection(copilotPath);
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Configure Cline with Shield context.
|
|
74
|
+
* Appends to .clinerules if marker is not already present.
|
|
75
|
+
*/
|
|
76
|
+
function configureClineForShield(targetDir) {
|
|
77
|
+
const clinePath = (0, node_path_1.join)(targetDir, '.clinerules');
|
|
78
|
+
return appendShieldSection(clinePath);
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Append the Shield section to a file if the marker is not already present.
|
|
82
|
+
* Creates the file if it doesn't exist.
|
|
83
|
+
* Returns true if the section was added, false if already present.
|
|
84
|
+
*/
|
|
85
|
+
function appendShieldSection(filePath) {
|
|
86
|
+
if ((0, node_fs_1.existsSync)(filePath)) {
|
|
87
|
+
const content = (0, node_fs_1.readFileSync)(filePath, 'utf-8');
|
|
88
|
+
if (content.includes(SHIELD_MARKER)) {
|
|
89
|
+
return false; // Already configured
|
|
90
|
+
}
|
|
91
|
+
// Append to existing file
|
|
92
|
+
const separator = content.endsWith('\n') ? '\n' : '\n\n';
|
|
93
|
+
(0, node_fs_1.writeFileSync)(filePath, content + separator + SHIELD_SECTION, { mode: 0o600 });
|
|
94
|
+
return true;
|
|
95
|
+
}
|
|
96
|
+
// Create new file with shield section
|
|
97
|
+
const dir = (0, node_path_1.dirname)(filePath);
|
|
98
|
+
if (!(0, node_fs_1.existsSync)(dir)) {
|
|
99
|
+
(0, node_fs_1.mkdirSync)(dir, { recursive: true });
|
|
100
|
+
}
|
|
101
|
+
(0, node_fs_1.writeFileSync)(filePath, SHIELD_SECTION, { mode: 0o600 });
|
|
102
|
+
return true;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Check if the Shield marker exists in a file.
|
|
106
|
+
*/
|
|
107
|
+
function hasShieldMarker(filePath) {
|
|
108
|
+
if (!(0, node_fs_1.existsSync)(filePath))
|
|
109
|
+
return false;
|
|
110
|
+
try {
|
|
111
|
+
return (0, node_fs_1.readFileSync)(filePath, 'utf-8').includes(SHIELD_MARKER);
|
|
112
|
+
}
|
|
113
|
+
catch {
|
|
114
|
+
return false;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Configure all detected AI tools with Shield context.
|
|
119
|
+
* Only configures tools that have existing config files (except CLAUDE.md which is always created).
|
|
120
|
+
*/
|
|
121
|
+
function configureAiTools(targetDir, detectedAssistants) {
|
|
122
|
+
const toolsConfigured = [];
|
|
123
|
+
const toolsSkipped = [];
|
|
124
|
+
// Always configure Claude Code (it's the primary target)
|
|
125
|
+
if (configureClaudeCodeForShield(targetDir)) {
|
|
126
|
+
toolsConfigured.push('Claude Code (CLAUDE.md)');
|
|
127
|
+
}
|
|
128
|
+
else {
|
|
129
|
+
toolsSkipped.push('Claude Code (already configured)');
|
|
130
|
+
}
|
|
131
|
+
// Configure Cursor if detected or .cursorrules exists
|
|
132
|
+
if (detectedAssistants.includes('Cursor') || (0, node_fs_1.existsSync)((0, node_path_1.join)(targetDir, '.cursorrules'))) {
|
|
133
|
+
if (configureCursorForShield(targetDir)) {
|
|
134
|
+
toolsConfigured.push('Cursor (.cursorrules)');
|
|
135
|
+
}
|
|
136
|
+
else {
|
|
137
|
+
toolsSkipped.push('Cursor (already configured)');
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
// Configure Windsurf if detected or .windsurfrules exists
|
|
141
|
+
if (detectedAssistants.includes('Windsurf') || (0, node_fs_1.existsSync)((0, node_path_1.join)(targetDir, '.windsurfrules'))) {
|
|
142
|
+
if (configureWindsurfForShield(targetDir)) {
|
|
143
|
+
toolsConfigured.push('Windsurf (.windsurfrules)');
|
|
144
|
+
}
|
|
145
|
+
else {
|
|
146
|
+
toolsSkipped.push('Windsurf (already configured)');
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
// Configure Copilot if .github/copilot-instructions.md exists
|
|
150
|
+
if ((0, node_fs_1.existsSync)((0, node_path_1.join)(targetDir, '.github', 'copilot-instructions.md'))) {
|
|
151
|
+
if (configureCopilotForShield(targetDir)) {
|
|
152
|
+
toolsConfigured.push('GitHub Copilot (.github/copilot-instructions.md)');
|
|
153
|
+
}
|
|
154
|
+
else {
|
|
155
|
+
toolsSkipped.push('GitHub Copilot (already configured)');
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
// Configure Cline if detected or .clinerules exists
|
|
159
|
+
if (detectedAssistants.includes('Cline') || (0, node_fs_1.existsSync)((0, node_path_1.join)(targetDir, '.clinerules'))) {
|
|
160
|
+
if (configureClineForShield(targetDir)) {
|
|
161
|
+
toolsConfigured.push('Cline (.clinerules)');
|
|
162
|
+
}
|
|
163
|
+
else {
|
|
164
|
+
toolsSkipped.push('Cline (already configured)');
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
return { toolsConfigured, toolsSkipped };
|
|
168
|
+
}
|
|
169
|
+
//# sourceMappingURL=ai-tool-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai-tool-config.js","sourceRoot":"","sources":["../../src/shield/ai-tool-config.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;;AAkCH,oEAGC;AAMD,4DAGC;AAMD,gEAGC;AAMD,8DAGC;AAMD,0DAGC;AA+BD,0CAOC;AAMD,4CAgDC;AAnKD,qCAA6E;AAC7E,yCAA0C;AAE1C,MAAM,aAAa,GAAG,iCA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SAAS,EAAE,aAAa,CAAC,CAAC,EAAE,CAAC;QACvF,IAAI,uBAAuB,CAAC,SAAS,CAAC,EAAE,CAAC;YACvC,eAAe,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC;QAC9C,CAAC;aAAM,CAAC;YACN,YAAY,CAAC,IAAI,CAAC,4BAA4B,CAAC,CAAC;QAClD,CAAC;IACH,CAAC;IAED,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,CAAC;AAC3C,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ARP-Shield Event Bridge
|
|
3
|
+
*
|
|
4
|
+
* Translates ARP (Agent Runtime Protection) events into Shield's
|
|
5
|
+
* tamper-evident hash chain. Supports both bulk import of existing
|
|
6
|
+
* ARP event logs and live bridging during ARP monitoring.
|
|
7
|
+
*
|
|
8
|
+
* ARP events live in .opena2a/arp/events.jsonl (ARP native format).
|
|
9
|
+
* Shield events live in ~/.opena2a/shield/events.jsonl (hash-chained).
|
|
10
|
+
*/
|
|
11
|
+
import type { ShieldEvent } from './types.js';
|
|
12
|
+
export interface ARPEvent {
|
|
13
|
+
id: string;
|
|
14
|
+
timestamp: string;
|
|
15
|
+
source: string;
|
|
16
|
+
category: string;
|
|
17
|
+
severity: string;
|
|
18
|
+
description: string;
|
|
19
|
+
data: Record<string, unknown>;
|
|
20
|
+
classifiedBy?: string;
|
|
21
|
+
llmAssessment?: {
|
|
22
|
+
consistent: boolean;
|
|
23
|
+
confidence: number;
|
|
24
|
+
reasoning: string;
|
|
25
|
+
recommendation: string;
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Translate a single ARP event into a Shield writeEvent partial.
|
|
30
|
+
* This does NOT write the event -- caller decides when to persist.
|
|
31
|
+
*/
|
|
32
|
+
export declare function translateARPEvent(arp: ARPEvent, agentName?: string): Omit<ShieldEvent, 'id' | 'timestamp' | 'version' | 'prevHash' | 'eventHash'>;
|
|
33
|
+
/**
|
|
34
|
+
* Read ARP events from .opena2a/arp/events.jsonl and import them into
|
|
35
|
+
* Shield's tamper-evident event log. Skips events that have already been
|
|
36
|
+
* imported (checks for matching arpEventId in existing Shield events).
|
|
37
|
+
*
|
|
38
|
+
* Returns the count of newly imported events.
|
|
39
|
+
*/
|
|
40
|
+
export declare function importARPEvents(targetDir: string, agentName?: string): {
|
|
41
|
+
imported: number;
|
|
42
|
+
skipped: number;
|
|
43
|
+
errors: number;
|
|
44
|
+
total: number;
|
|
45
|
+
};
|
|
46
|
+
export interface ARPStats {
|
|
47
|
+
totalEvents: number;
|
|
48
|
+
anomalies: number;
|
|
49
|
+
violations: number;
|
|
50
|
+
threats: number;
|
|
51
|
+
processEvents: number;
|
|
52
|
+
networkEvents: number;
|
|
53
|
+
filesystemEvents: number;
|
|
54
|
+
promptEvents: number;
|
|
55
|
+
enforcements: number;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Compute stats from ARP events in Shield's log (source === 'arp').
|
|
59
|
+
* Used by shield report to populate runtimeProtection section.
|
|
60
|
+
*/
|
|
61
|
+
export declare function getARPStats(since?: string): ARPStats;
|
|
62
|
+
//# sourceMappingURL=arp-bridge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"arp-bridge.d.ts","sourceRoot":"","sources":["../../src/shield/arp-bridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAMH,OAAO,KAAK,EAAE,WAAW,EAAkD,MAAM,YAAY,CAAC;AAM9F,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC9B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE;QACd,UAAU,EAAE,OAAO,CAAC;QACpB,UAAU,EAAE,MAAM,CAAC;QACnB,SAAS,EAAE,MAAM,CAAC;QAClB,cAAc,EAAE,MAAM,CAAC;KACxB,CAAC;CACH;AAkDD;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,GAAG,EAAE,QAAQ,EACb,SAAS,CAAC,EAAE,MAAM,GACjB,IAAI,CAAC,WAAW,EAAE,IAAI,GAAG,WAAW,GAAG,SAAS,GAAG,UAAU,GAAG,WAAW,CAAC,CAuB9E;AAMD;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG;IACtE,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf,CAmDA;AAMD,MAAM,WAAW,QAAQ;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;IACtB,gBAAgB,EAAE,MAAM,CAAC;IACzB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,QAAQ,CAgCpD"}
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* ARP-Shield Event Bridge
|
|
4
|
+
*
|
|
5
|
+
* Translates ARP (Agent Runtime Protection) events into Shield's
|
|
6
|
+
* tamper-evident hash chain. Supports both bulk import of existing
|
|
7
|
+
* ARP event logs and live bridging during ARP monitoring.
|
|
8
|
+
*
|
|
9
|
+
* ARP events live in .opena2a/arp/events.jsonl (ARP native format).
|
|
10
|
+
* Shield events live in ~/.opena2a/shield/events.jsonl (hash-chained).
|
|
11
|
+
*/
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.translateARPEvent = translateARPEvent;
|
|
14
|
+
exports.importARPEvents = importARPEvents;
|
|
15
|
+
exports.getARPStats = getARPStats;
|
|
16
|
+
const node_fs_1 = require("node:fs");
|
|
17
|
+
const node_path_1 = require("node:path");
|
|
18
|
+
const events_js_1 = require("./events.js");
|
|
19
|
+
// ---------------------------------------------------------------------------
|
|
20
|
+
// Translation
|
|
21
|
+
// ---------------------------------------------------------------------------
|
|
22
|
+
/** Map ARP category to Shield outcome. */
|
|
23
|
+
function mapOutcome(arpCategory, enforcement) {
|
|
24
|
+
if (enforcement === 'kill' || enforcement === 'pause')
|
|
25
|
+
return 'blocked';
|
|
26
|
+
if (arpCategory === 'violation' || arpCategory === 'threat')
|
|
27
|
+
return 'blocked';
|
|
28
|
+
if (arpCategory === 'anomaly')
|
|
29
|
+
return 'monitored';
|
|
30
|
+
return 'allowed';
|
|
31
|
+
}
|
|
32
|
+
/** Map ARP severity to Shield severity. */
|
|
33
|
+
function mapSeverity(arpSeverity) {
|
|
34
|
+
const map = {
|
|
35
|
+
info: 'info',
|
|
36
|
+
low: 'low',
|
|
37
|
+
medium: 'medium',
|
|
38
|
+
high: 'high',
|
|
39
|
+
critical: 'critical',
|
|
40
|
+
};
|
|
41
|
+
return map[arpSeverity] ?? 'info';
|
|
42
|
+
}
|
|
43
|
+
/** Build a human-readable action string from ARP event data. */
|
|
44
|
+
function buildAction(arp) {
|
|
45
|
+
const src = arp.source;
|
|
46
|
+
const cat = arp.category;
|
|
47
|
+
if (src === 'process')
|
|
48
|
+
return `process.${cat === 'normal' ? 'spawn' : cat}`;
|
|
49
|
+
if (src === 'network')
|
|
50
|
+
return `network.${cat === 'normal' ? 'connection' : cat}`;
|
|
51
|
+
if (src === 'filesystem')
|
|
52
|
+
return `filesystem.${cat === 'normal' ? 'access' : cat}`;
|
|
53
|
+
if (src === 'prompt')
|
|
54
|
+
return `prompt.${cat}`;
|
|
55
|
+
if (src === 'mcp-protocol')
|
|
56
|
+
return `mcp.${cat}`;
|
|
57
|
+
if (src === 'a2a-protocol')
|
|
58
|
+
return `a2a.${cat}`;
|
|
59
|
+
return `${src}.${cat}`;
|
|
60
|
+
}
|
|
61
|
+
/** Build a target string from ARP event data. */
|
|
62
|
+
function buildTarget(arp) {
|
|
63
|
+
const data = arp.data ?? {};
|
|
64
|
+
if (data.command)
|
|
65
|
+
return String(data.command);
|
|
66
|
+
if (data.host)
|
|
67
|
+
return String(data.host);
|
|
68
|
+
if (data.path)
|
|
69
|
+
return String(data.path);
|
|
70
|
+
if (data.name)
|
|
71
|
+
return String(data.name);
|
|
72
|
+
if (data.pid)
|
|
73
|
+
return `pid:${data.pid}`;
|
|
74
|
+
return arp.description?.slice(0, 80) ?? 'unknown';
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Translate a single ARP event into a Shield writeEvent partial.
|
|
78
|
+
* This does NOT write the event -- caller decides when to persist.
|
|
79
|
+
*/
|
|
80
|
+
function translateARPEvent(arp, agentName) {
|
|
81
|
+
return {
|
|
82
|
+
source: 'arp',
|
|
83
|
+
category: `arp.${arp.source}`,
|
|
84
|
+
severity: mapSeverity(arp.severity),
|
|
85
|
+
agent: agentName ?? arp.data?.agentName ?? null,
|
|
86
|
+
sessionId: null,
|
|
87
|
+
action: buildAction(arp),
|
|
88
|
+
target: buildTarget(arp),
|
|
89
|
+
outcome: mapOutcome(arp.category, arp.llmAssessment?.recommendation),
|
|
90
|
+
detail: {
|
|
91
|
+
arpEventId: arp.id,
|
|
92
|
+
arpSource: arp.source,
|
|
93
|
+
arpCategory: arp.category,
|
|
94
|
+
classifiedBy: arp.classifiedBy ?? 'L0-rules',
|
|
95
|
+
description: arp.description,
|
|
96
|
+
data: arp.data,
|
|
97
|
+
...(arp.llmAssessment ? { llmAssessment: arp.llmAssessment } : {}),
|
|
98
|
+
},
|
|
99
|
+
orgId: null,
|
|
100
|
+
managed: false,
|
|
101
|
+
agentId: null,
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
// ---------------------------------------------------------------------------
|
|
105
|
+
// Bulk import
|
|
106
|
+
// ---------------------------------------------------------------------------
|
|
107
|
+
/**
|
|
108
|
+
* Read ARP events from .opena2a/arp/events.jsonl and import them into
|
|
109
|
+
* Shield's tamper-evident event log. Skips events that have already been
|
|
110
|
+
* imported (checks for matching arpEventId in existing Shield events).
|
|
111
|
+
*
|
|
112
|
+
* Returns the count of newly imported events.
|
|
113
|
+
*/
|
|
114
|
+
function importARPEvents(targetDir, agentName) {
|
|
115
|
+
const arpEventsPath = (0, node_path_1.join)(targetDir, '.opena2a', 'arp', 'events.jsonl');
|
|
116
|
+
if (!(0, node_fs_1.existsSync)(arpEventsPath)) {
|
|
117
|
+
return { imported: 0, skipped: 0, errors: 0, total: 0 };
|
|
118
|
+
}
|
|
119
|
+
let content;
|
|
120
|
+
try {
|
|
121
|
+
content = (0, node_fs_1.readFileSync)(arpEventsPath, 'utf-8');
|
|
122
|
+
}
|
|
123
|
+
catch {
|
|
124
|
+
return { imported: 0, skipped: 0, errors: 0, total: 0 };
|
|
125
|
+
}
|
|
126
|
+
const lines = content.trim().split('\n').filter(Boolean);
|
|
127
|
+
// Build set of already-imported ARP event IDs
|
|
128
|
+
const existingEvents = (0, events_js_1.readEvents)({ count: 10000, source: 'arp' });
|
|
129
|
+
const importedIds = new Set();
|
|
130
|
+
for (const event of existingEvents) {
|
|
131
|
+
const detail = event.detail;
|
|
132
|
+
if (detail?.arpEventId) {
|
|
133
|
+
importedIds.add(String(detail.arpEventId));
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
let imported = 0;
|
|
137
|
+
let skipped = 0;
|
|
138
|
+
let errors = 0;
|
|
139
|
+
for (const line of lines) {
|
|
140
|
+
let arpEvent;
|
|
141
|
+
try {
|
|
142
|
+
arpEvent = JSON.parse(line);
|
|
143
|
+
}
|
|
144
|
+
catch {
|
|
145
|
+
errors++;
|
|
146
|
+
continue;
|
|
147
|
+
}
|
|
148
|
+
// Skip already-imported events
|
|
149
|
+
if (importedIds.has(arpEvent.id)) {
|
|
150
|
+
skipped++;
|
|
151
|
+
continue;
|
|
152
|
+
}
|
|
153
|
+
const partial = translateARPEvent(arpEvent, agentName);
|
|
154
|
+
(0, events_js_1.writeEvent)(partial);
|
|
155
|
+
imported++;
|
|
156
|
+
}
|
|
157
|
+
return { imported, skipped, errors, total: lines.length };
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Compute stats from ARP events in Shield's log (source === 'arp').
|
|
161
|
+
* Used by shield report to populate runtimeProtection section.
|
|
162
|
+
*/
|
|
163
|
+
function getARPStats(since) {
|
|
164
|
+
const events = (0, events_js_1.readEvents)({ source: 'arp', since, count: 10000 });
|
|
165
|
+
const stats = {
|
|
166
|
+
totalEvents: events.length,
|
|
167
|
+
anomalies: 0,
|
|
168
|
+
violations: 0,
|
|
169
|
+
threats: 0,
|
|
170
|
+
processEvents: 0,
|
|
171
|
+
networkEvents: 0,
|
|
172
|
+
filesystemEvents: 0,
|
|
173
|
+
promptEvents: 0,
|
|
174
|
+
enforcements: 0,
|
|
175
|
+
};
|
|
176
|
+
for (const event of events) {
|
|
177
|
+
const detail = event.detail;
|
|
178
|
+
const arpCategory = String(detail?.arpCategory ?? '');
|
|
179
|
+
if (arpCategory === 'anomaly')
|
|
180
|
+
stats.anomalies++;
|
|
181
|
+
if (arpCategory === 'violation')
|
|
182
|
+
stats.violations++;
|
|
183
|
+
if (arpCategory === 'threat')
|
|
184
|
+
stats.threats++;
|
|
185
|
+
if (event.category === 'arp.process')
|
|
186
|
+
stats.processEvents++;
|
|
187
|
+
if (event.category === 'arp.network')
|
|
188
|
+
stats.networkEvents++;
|
|
189
|
+
if (event.category === 'arp.filesystem')
|
|
190
|
+
stats.filesystemEvents++;
|
|
191
|
+
if (event.category === 'arp.prompt')
|
|
192
|
+
stats.promptEvents++;
|
|
193
|
+
if (event.outcome === 'blocked')
|
|
194
|
+
stats.enforcements++;
|
|
195
|
+
}
|
|
196
|
+
return stats;
|
|
197
|
+
}
|
|
198
|
+
//# sourceMappingURL=arp-bridge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"arp-bridge.js","sourceRoot":"","sources":["../../src/shield/arp-bridge.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;;AAiFH,8CA0BC;AAaD,0CAwDC;AAsBD,kCAgCC;AApOD,qCAAmD;AACnD,yCAAiC;AAEjC,2CAAqD;AAwBrD,8EAA8E;AAC9E,cAAc;AACd,8EAA8E;AAE9E,0CAA0C;AAC1C,SAAS,UAAU,CAAC,WAAmB,EAAE,WAAoB;IAC3D,IAAI,WAAW,KAAK,MAAM,IAAI,WAAW,KAAK,OAAO;QAAE,OAAO,SAAS,CAAC;IACxE,IAAI,WAAW,KAAK,WAAW,IAAI,WAAW,KAAK,QAAQ;QAAE,OAAO,SAAS,CAAC;IAC9E,IAAI,WAAW,KAAK,SAAS;QAAE,OAAO,WAAW,CAAC;IAClD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,2CAA2C;AAC3C,SAAS,WAAW,CAAC,WAAmB;IACtC,MAAM,GAAG,GAAkC;QACzC,IAAI,EAAE,MAAM;QACZ,GAAG,EAAE,KAAK;QACV,MAAM,EAAE,QAAQ;QAChB,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,UAAU;KACrB,CAAC;IACF,OAAO,GAAG,CAAC,WAAW,CAAC,IAAI,MAAM,CAAC;AACpC,CAAC;AAED,gEAAgE;AAChE,SAAS,WAAW,CAAC,GAAa;IAChC,MAAM,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC;IACvB,MAAM,GAAG,GAAG,GAAG,CAAC,QAAQ,CAAC;IACzB,IAAI,GAAG,KAAK,SAAS;QAAE,O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,KAAK,CAAC,QAAQ,KAAK,aAAa;YAAE,KAAK,CAAC,aAAa,EAAE,CAAC;QAC5D,IAAI,KAAK,CAAC,QAAQ,KAAK,aAAa;YAAE,KAAK,CAAC,aAAa,EAAE,CAAC;QAC5D,IAAI,KAAK,CAAC,QAAQ,KAAK,gBAAgB;YAAE,KAAK,CAAC,gBAAgB,EAAE,CAAC;QAClE,IAAI,KAAK,CAAC,QAAQ,KAAK,YAAY;YAAE,KAAK,CAAC,YAAY,EAAE,CAAC;QAE1D,IAAI,KAAK,CAAC,OAAO,KAAK,SAAS;YAAE,KAAK,CAAC,YAAY,EAAE,CAAC;IACxD,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shield adaptive baselines: learn / suggest / protect enforcement flow.
|
|
3
|
+
*
|
|
4
|
+
* Baselines track observed agent behavior over time. The stability
|
|
5
|
+
* algorithm determines when behavior has settled enough to recommend
|
|
6
|
+
* a policy. The developer must explicitly approve before Shield
|
|
7
|
+
* starts enforcing.
|
|
8
|
+
*
|
|
9
|
+
* Storage: ~/.opena2a/shield/baselines/{agent}.json (mode 0o600)
|
|
10
|
+
*/
|
|
11
|
+
import type { AgentBaseline } from './types.js';
|
|
12
|
+
/**
|
|
13
|
+
* Get or create a baseline for an agent.
|
|
14
|
+
*
|
|
15
|
+
* Checks the in-memory cache first, then disk, and finally creates
|
|
16
|
+
* a new baseline if none exists.
|
|
17
|
+
*/
|
|
18
|
+
export declare function getBaseline(agent: string): AgentBaseline;
|
|
19
|
+
/** List all persisted baselines (loads from disk). */
|
|
20
|
+
export declare function listBaselines(): AgentBaseline[];
|
|
21
|
+
/**
|
|
22
|
+
* Record an observed action from an agent into their baseline.
|
|
23
|
+
*
|
|
24
|
+
* This is the primary entry point for the adaptive enforcement loop.
|
|
25
|
+
* It handles session tracking, new-behavior detection, and stability
|
|
26
|
+
* recomputation.
|
|
27
|
+
*/
|
|
28
|
+
export declare function recordAction(agent: string, category: string, target: string): void;
|
|
29
|
+
/**
|
|
30
|
+
* Compute a stability score between 0.0 and 1.0.
|
|
31
|
+
*
|
|
32
|
+
* Stability measures the fraction of recent sessions that had no new
|
|
33
|
+
* behavior (no previously unseen processes, credentials, etc.).
|
|
34
|
+
*
|
|
35
|
+
* Returns 0 until minimum action and session thresholds are met.
|
|
36
|
+
*/
|
|
37
|
+
export declare function computeStability(baseline: AgentBaseline): number;
|
|
38
|
+
/**
|
|
39
|
+
* Check whether a baseline should transition phases.
|
|
40
|
+
*
|
|
41
|
+
* - learn -> suggest: stability >= STABILITY_THRESHOLD
|
|
42
|
+
* - suggest -> protect: manual approval only (approvePolicy)
|
|
43
|
+
*/
|
|
44
|
+
export declare function checkPhaseTransition(baseline: AgentBaseline): {
|
|
45
|
+
shouldTransition: boolean;
|
|
46
|
+
nextPhase: string;
|
|
47
|
+
reason: string;
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* Approve the recommended policy for an agent, transitioning
|
|
51
|
+
* from suggest to protect phase.
|
|
52
|
+
*/
|
|
53
|
+
export declare function approvePolicy(agent: string): AgentBaseline;
|
|
54
|
+
/** Save a baseline to disk at ~/.opena2a/shield/baselines/{agent}.json. */
|
|
55
|
+
export declare function saveBaseline(baseline: AgentBaseline): void;
|
|
56
|
+
/** Load a baseline from disk. Returns null if not found or corrupted. */
|
|
57
|
+
export declare function loadBaseline(agent: string): AgentBaseline | null;
|
|
58
|
+
//# sourceMappingURL=baselines.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"baselines.d.ts","sourceRoot":"","sources":["../../src/shield/baselines.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAaH,OAAO,KAAK,EAAE,aAAa,EAAe,MAAM,YAAY,CAAC;AAmF7D;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,aAAa,CAaxD;AAED,sDAAsD;AACtD,wBAAgB,aAAa,IAAI,aAAa,EAAE,CAmB/C;AA6BD;;;;;;GAMG;AACH,wBAAgB,YAAY,CAC1B,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,GACb,IAAI,CAkEN;AAMD;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,aAAa,GAAG,MAAM,CAuBhE;AAMD;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,aAAa,GAAG;IAC7D,gBAAgB,EAAE,OAAO,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;CAChB,CA8CA;AAMD;;;GAGG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,aAAa,CAsB1D;AAuCD,2EAA2E;AAC3E,wBAAgB,YAAY,CAAC,QAAQ,EAAE,aAAa,GAAG,IAAI,CAW1D;AAED,yEAAyE;AACzE,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI,CAkBhE"}
|