feat: AI Agent Security Firewall MVP - CLI monitoring, sandboxing, audit logging, 11 tests passing

This commit is contained in:
Bun Bun
2026-06-15 12:24:35 +00:00
commit f1c4fe68e1
15 changed files with 1336 additions and 0 deletions
+55
View File
@@ -0,0 +1,55 @@
export interface Rule {
id: string;
name: string;
type: 'file' | 'network' | 'process';
action: 'allow' | 'block' | 'flag';
pattern: string;
description?: string;
}
export interface Config {
watchPaths: string[];
auditLogPath: string;
rules: Rule[];
maxLogSizeMB: number;
enableNetworkMonitoring: boolean;
enableProcessMonitoring: boolean;
blockedHosts: string[];
blockedFilePatterns: string[];
alertThreshold: number;
}
export interface AuditEvent {
timestamp: string;
type: 'file' | 'network' | 'process' | 'rule_violation';
severity: 'info' | 'warning' | 'critical';
action: string;
target: string;
details: string;
pid?: number;
ruleId?: string;
}
export interface NetworkConnection {
localAddress: string;
localPort: string;
remoteAddress: string;
remotePort: string;
state: string;
inode: string;
uid: number;
}
export interface FileEvent {
path: string;
eventType: 'create' | 'modify' | 'delete' | 'rename';
timestamp: string;
}
export interface SandboxResult {
command: string;
exitCode: number;
events: AuditEvent[];
violations: AuditEvent[];
duration: number;
}