/** * Change Log * * Tracks all configuration changes for SOC2 compliance. * Provides audit trail for system modifications. * * Added by Pantheon Security for enterprise compliance support. */ import type { ChangeRecord } from "./types.js"; /** * Change Log class */ export declare class ChangeLog { private static instance; private logDir; private currentLogFile; private constructor(); /** * Get singleton instance */ static getInstance(): ChangeLog; /** * Initialize log file for current month */ private initializeLogFile; /** * Record a configuration change */ recordChange(component: string, setting: string, oldValue: unknown, newValue: unknown, options?: { changedBy?: "user" | "system" | "admin"; method?: "cli" | "env" | "api" | "config_file"; requiresApproval?: boolean; approvedBy?: string; impact?: "low" | "medium" | "high"; affectedCompliance?: string[]; }): Promise; /** * Sanitize value for logging (remove sensitive data) */ private sanitizeValue; /** * Get changes by component */ getChangesByComponent(component: string, limit?: number): Promise; /** * Get changes by setting */ getChangesBySetting(setting: string, limit?: number): Promise; /** * Get changes within date range */ getChangesInRange(from: Date, to: Date, limit?: number): Promise; /** * Get all changes (most recent first) */ getAllChanges(limit?: number): Promise; /** * Select monthly log files whose YYYY-MM month overlaps the [from, to] range. * Filenames are `changes-YYYY-MM.jsonl`; pushing the date filter into file * selection avoids reading (and event-loop-blocking on) years of history when * only a narrow report window is requested (L48). Returns newest-first. */ private getLogFilesInRange; /** * Read change records from a specific set of files, applying an optional * date-range predicate. Used by range-bounded queries so only relevant * monthly files are read rather than the entire history. */ private readChangesFromFiles; /** * Get high-impact changes */ getHighImpactChanges(limit?: number): Promise; /** * Get changes affecting compliance */ getComplianceAffectingChanges(regulation?: string, limit?: number): Promise; /** * Get change statistics */ getStatistics(from?: Date, to?: Date): Promise<{ total_changes: number; by_component: Record; by_impact: Record; by_method: Record; requiring_approval: number; compliance_affecting: number; }>; /** * Export changes for audit */ exportForAudit(from: Date, to: Date): Promise<{ period: { from: string; to: string; }; total_changes: number; high_impact_changes: number; compliance_affecting_changes: number; changes: ChangeRecord[]; }>; } /** * Get the change log instance */ export declare function getChangeLog(): ChangeLog; /** * Record a configuration change */ export declare function recordConfigChange(component: string, setting: string, oldValue: unknown, newValue: unknown, options?: { changedBy?: "user" | "system" | "admin"; method?: "cli" | "env" | "api" | "config_file"; requiresApproval?: boolean; approvedBy?: string; impact?: "low" | "medium" | "high"; affectedCompliance?: string[]; }): Promise; /** * Get recent configuration changes */ export declare function getRecentChanges(limit?: number): Promise; /** * Get change statistics */ export declare function getChangeStatistics(from?: Date, to?: Date): Promise>;