@opena2a/oasb 0.2.0 → 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 +57 -16
- package/dist/harness/adapter.d.ts +187 -0
- package/dist/harness/adapter.js +18 -0
- package/dist/harness/arp-wrapper.d.ts +24 -20
- package/dist/harness/arp-wrapper.js +114 -28
- package/dist/harness/create-adapter.d.ts +16 -0
- package/dist/harness/create-adapter.js +36 -0
- package/dist/harness/event-collector.d.ts +1 -1
- package/dist/harness/llm-guard-wrapper.d.ts +31 -0
- package/dist/harness/llm-guard-wrapper.js +315 -0
- package/dist/harness/mock-llm-adapter.d.ts +2 -2
- package/dist/harness/mock-llm-adapter.js +6 -5
- package/dist/harness/types.d.ts +4 -38
- package/package.json +15 -7
- package/src/atomic/ai-layer/AT-AI-001.prompt-input-scan.test.ts +18 -42
- package/src/atomic/ai-layer/AT-AI-002.prompt-output-scan.test.ts +13 -32
- package/src/atomic/ai-layer/AT-AI-003.mcp-tool-scan.test.ts +18 -42
- package/src/atomic/ai-layer/AT-AI-004.a2a-message-scan.test.ts +14 -36
- package/src/atomic/ai-layer/AT-AI-005.pattern-coverage.test.ts +11 -5
- package/src/atomic/enforcement/AT-ENF-001.log-action.test.ts +4 -4
- package/src/atomic/enforcement/AT-ENF-002.alert-callback.test.ts +5 -5
- package/src/atomic/enforcement/AT-ENF-003.pause-sigstop.test.ts +4 -4
- package/src/atomic/enforcement/AT-ENF-004.kill-sigterm.test.ts +5 -5
- package/src/atomic/enforcement/AT-ENF-005.resume-sigcont.test.ts +4 -4
- package/src/atomic/intelligence/AT-INT-001.l0-rule-match.test.ts +1 -1
- package/src/atomic/intelligence/AT-INT-002.l1-anomaly-score.test.ts +10 -8
- package/src/atomic/intelligence/AT-INT-003.l2-escalation.test.ts +1 -1
- package/src/atomic/intelligence/AT-INT-004.budget-exhaustion.test.ts +8 -6
- package/src/atomic/intelligence/AT-INT-005.baseline-learning.test.ts +9 -9
- package/src/baseline/BL-002.anomaly-injection.test.ts +6 -6
- package/src/baseline/BL-003.baseline-persistence.test.ts +9 -9
- package/src/harness/adapter.ts +222 -0
- package/src/harness/arp-wrapper.ts +150 -42
- package/src/harness/create-adapter.ts +49 -0
- package/src/harness/event-collector.ts +1 -1
- package/src/harness/llm-guard-wrapper.ts +333 -0
- package/src/harness/mock-llm-adapter.ts +7 -6
- package/src/harness/types.ts +31 -39
- package/src/integration/INT-001.data-exfil-detection.test.ts +1 -1
- package/src/integration/INT-002.mcp-tool-abuse.test.ts +1 -1
- package/src/integration/INT-003.prompt-injection-response.test.ts +1 -1
- package/src/integration/INT-004.a2a-trust-exploitation.test.ts +1 -1
- package/src/integration/INT-005.baseline-then-attack.test.ts +1 -1
- package/src/integration/INT-006.multi-monitor-correlation.test.ts +1 -1
- package/src/integration/INT-007.budget-exhaustion-attack.test.ts +8 -8
- package/src/integration/INT-008.kill-switch-recovery.test.ts +6 -6
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
import { describe, it, expect, beforeEach, afterEach } from 'vitest';
|
|
13
13
|
import { spawn, type ChildProcess } from 'child_process';
|
|
14
14
|
import { ArpWrapper } from '../harness/arp-wrapper';
|
|
15
|
-
import type {
|
|
15
|
+
import type { SecurityEvent, AlertRule } from '../harness/adapter';
|
|
16
16
|
|
|
17
17
|
describe('INT-008: Kill Switch and Recovery', () => {
|
|
18
18
|
let arp: ArpWrapper;
|
|
@@ -107,7 +107,7 @@ describe('INT-008: Kill Switch and Recovery', () => {
|
|
|
107
107
|
expect(isProcessAlive(pid)).toBe(true);
|
|
108
108
|
|
|
109
109
|
// Create a mock event referencing the child PID
|
|
110
|
-
const mockEvent:
|
|
110
|
+
const mockEvent: SecurityEvent = {
|
|
111
111
|
id: 'kill-test-001',
|
|
112
112
|
timestamp: new Date().toISOString(),
|
|
113
113
|
source: 'process',
|
|
@@ -139,7 +139,7 @@ describe('INT-008: Kill Switch and Recovery', () => {
|
|
|
139
139
|
// Use a PID that almost certainly does not exist
|
|
140
140
|
const fakePid = 999999;
|
|
141
141
|
|
|
142
|
-
const mockEvent:
|
|
142
|
+
const mockEvent: SecurityEvent = {
|
|
143
143
|
id: 'kill-test-002',
|
|
144
144
|
timestamp: new Date().toISOString(),
|
|
145
145
|
source: 'process',
|
|
@@ -160,7 +160,7 @@ describe('INT-008: Kill Switch and Recovery', () => {
|
|
|
160
160
|
});
|
|
161
161
|
|
|
162
162
|
it('should report failure when no PID is provided for kill', async () => {
|
|
163
|
-
const mockEvent:
|
|
163
|
+
const mockEvent: SecurityEvent = {
|
|
164
164
|
id: 'kill-test-003',
|
|
165
165
|
timestamp: new Date().toISOString(),
|
|
166
166
|
source: 'process',
|
|
@@ -184,7 +184,7 @@ describe('INT-008: Kill Switch and Recovery', () => {
|
|
|
184
184
|
const pid = child.pid!;
|
|
185
185
|
|
|
186
186
|
// Kill the child
|
|
187
|
-
const mockEvent:
|
|
187
|
+
const mockEvent: SecurityEvent = {
|
|
188
188
|
id: 'kill-test-004',
|
|
189
189
|
timestamp: new Date().toISOString(),
|
|
190
190
|
source: 'process',
|
|
@@ -272,7 +272,7 @@ describe('INT-008: Kill Switch and Recovery', () => {
|
|
|
272
272
|
const pid = child.pid!;
|
|
273
273
|
|
|
274
274
|
// Kill the child via enforcement
|
|
275
|
-
const mockEvent:
|
|
275
|
+
const mockEvent: SecurityEvent = {
|
|
276
276
|
id: 'kill-test-006',
|
|
277
277
|
timestamp: new Date().toISOString(),
|
|
278
278
|
source: 'process',
|