55 lines
1.2 KiB
TypeScript
55 lines
1.2 KiB
TypeScript
export interface PermissionRule {
|
|
type: 'file' | 'command' | 'network' | 'env';
|
|
pattern: string;
|
|
action: 'allow' | 'deny' | 'warn';
|
|
description?: string;
|
|
}
|
|
|
|
export interface PermissionManifest {
|
|
name: string;
|
|
version: string;
|
|
rules: PermissionRule[];
|
|
defaultAction: 'allow' | 'deny' | 'warn';
|
|
compression: {
|
|
enabled: boolean;
|
|
maxTrailSize: number; // in MB
|
|
retentionDays: number;
|
|
};
|
|
sensitivePatterns: string[];
|
|
}
|
|
|
|
export interface AgentAction {
|
|
id: string;
|
|
timestamp: Date;
|
|
agentId: string;
|
|
type: 'file' | 'command' | 'network' | 'env' | 'bypass_attempt';
|
|
action: string;
|
|
target: string;
|
|
resolvedAction: 'allow' | 'deny' | 'warn' | 'unknown';
|
|
matchedRule?: string;
|
|
details?: Record<string, unknown>;
|
|
}
|
|
|
|
export interface AuditTrail {
|
|
manifest: string;
|
|
startedAt: Date;
|
|
endedAt?: Date;
|
|
actions: AgentAction[];
|
|
summary: {
|
|
total: number;
|
|
allowed: number;
|
|
denied: number;
|
|
warned: number;
|
|
bypassAttempts: number;
|
|
};
|
|
}
|
|
|
|
export interface ViolationReport {
|
|
timestamp: Date;
|
|
manifest: string;
|
|
violations: AgentAction[];
|
|
topViolatedRules: Array<{ rule: string; count: number }>;
|
|
topAgents: Array<{ agentId: string; violations: number }>;
|
|
riskScore: number; // 0-100
|
|
}
|