UNPKG

@mickdarling/dollhousemcp

Version:

DollhouseMCP - A Model Context Protocol (MCP) server that enables dynamic AI persona management from markdown files, allowing Claude and other compatible AI assistants to activate and switch between different behavioral personas.

58 lines 1.95 kB
/** * Security Monitor for DollhouseMCP * * Centralized security event logging and monitoring system * for tracking and alerting on security-related events. */ export interface SecurityEvent { type: 'CONTENT_INJECTION_ATTEMPT' | 'YAML_INJECTION_ATTEMPT' | 'PATH_TRAVERSAL_ATTEMPT' | 'TOKEN_VALIDATION_FAILURE' | 'UPDATE_SECURITY_VIOLATION' | 'RATE_LIMIT_EXCEEDED' | 'YAML_PARSING_WARNING' | 'YAML_PARSE_SUCCESS' | 'TOKEN_VALIDATION_SUCCESS' | 'RATE_LIMIT_WARNING' | 'TOKEN_CACHE_CLEARED'; severity: 'LOW' | 'MEDIUM' | 'HIGH' | 'CRITICAL'; source: string; details: string; userAgent?: string; ip?: string; additionalData?: Record<string, any>; } export interface SecurityLogEntry extends SecurityEvent { timestamp: string; id: string; } export declare class SecurityMonitor { private static eventCount; private static readonly events; private static readonly MAX_EVENTS; /** * Logs a security event */ static logSecurityEvent(event: SecurityEvent): void; /** * Sends security alerts for critical events */ private static sendSecurityAlert; /** * Gets recent security events for analysis */ static getRecentEvents(count?: number): SecurityLogEntry[]; /** * Gets events by severity */ static getEventsBySeverity(severity: SecurityEvent['severity']): SecurityLogEntry[]; /** * Gets events by type */ static getEventsByType(type: SecurityEvent['type']): SecurityLogEntry[]; /** * Generates a security report */ static generateSecurityReport(): { totalEvents: number; eventsBySeverity: Record<string, number>; eventsByType: Record<string, number>; recentCriticalEvents: SecurityLogEntry[]; }; /** * Clears old events (for memory management) */ static clearOldEvents(daysToKeep?: number): void; } //# sourceMappingURL=securityMonitor.d.ts.map