SystemGuardian is an advanced Windows service that provides automated system monitoring, protection, and recovery capabilities. It implements real-time component tracking, automatic recovery points, and intelligent event handling to maintain system stability and integrity.
- Real-time WMI-based event monitoring
- Automated recovery point management
- Registry state tracking and backup
- Component integrity verification
- Intelligent thread pool management
- SQLite-based component and event tracking
- Automated system restoration capabilities
- Smart component isolation and quarantine
- Windows Operating System (Windows 10/11 recommended)
- Minimum 4GB RAM
- 1GB free disk space for recovery points
- Python 3.8 or higher
- Required Python packages:
win32serviceutil
wmi
psutil
win10toast
sqlite3
C:/ProgramData/SystemGuardian/
├── logs/ # Rotating log files
├── backups/ # Registry and component backups
├── recovery_points/ # System recovery points
├── quarantine/ # Isolated components
└── guardian.db # SQLite database
CREATE TABLE components (
name TEXT PRIMARY KEY,
type TEXT,
path TEXT,
dependencies TEXT,
hash TEXT,
last_modified REAL,
status TEXT
);
CREATE TABLE recovery_points (
timestamp REAL PRIMARY KEY,
components TEXT,
registry_backup TEXT,
description TEXT
);
CREATE TABLE events (
id INTEGER PRIMARY KEY,
timestamp REAL,
type TEXT,
component TEXT,
description TEXT,
severity TEXT
);
python SystemGuardian.py install
- Start service
python SystemGuardian.py start
- Stop service
python SystemGuardian.py stop
- Update service
python SystemGuardian.py update
- Remove service
python SystemGuardian.py remove
- Automatic creation before critical operations
- Maximum retention: 5 recovery points
- Includes:
- Full registry state
- Component database snapshot
- System state metadata
Recovery points are automatically created:
- At service startup
- Before critical component modifications
- Before component isolation
- During service shutdown
- On-demand via API
# Example restoration code
guardian_service.restore_recovery_point(timestamp)
- Real-time event capture
- Efficient event filtering
- Resource-aware processing
- Automated response triggers
- SHA-256 hash verification
- Dependency validation
- Path existence checking
- Permission verification
- Maximum workers: 4
- Automatic task distribution
- Resource-aware scheduling
- Graceful shutdown handling
- Maximum size: 1000 events
- FIFO processing
- Overflow protection
- Priority handling
class Config:
MAX_QUEUE_SIZE = 1000
MAX_THREADS = 4
MAX_RECOVERY_POINTS = 5
MAX_BACKUP_AGE_DAYS = 7
EVENT_CHECK_INTERVAL = 5
CACHE_UPDATE_INTERVAL = 3600
BACKUP_INTERVAL = 86400
Monitored paths:
CRITICAL_REG_PATHS = [
r"SYSTEM\CurrentControlSet\Services",
r"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Drivers32",
r"SYSTEM\CurrentControlSet\Control\Class"
]
- Active: Component running normally
- Warning: Minor issues detected
- Critical: Major problems identified
- Isolated: Component quarantined
- Recovered: Restored from backup
- Create recovery point
- Backup component files
- Disable/stop component
- Update database status
- Notify administrator
- Verify recovery point integrity
- Restore registry state
- Restore component files
- Validate restoration
- Update component status
- Daily log files
- Maximum size: 10MB
- Retention: 5 files
- Format:
guardian_YYYYMMDD.log
- INFO: Normal operations
- WARNING: Potential issues
- ERROR: Operation failures
- CRITICAL: System failures
- CPU: <5% average
- Memory: ~100MB baseline
- Disk: ~1GB for recovery points
- Database: ~50MB typical
- Event batching
- Efficient WMI queries
- Thread pool management
- Queue size limits
- File hash validation
- Path verification
- Permission checking
- Dependency validation
- Encrypted storage
- Access control
- Integrity verification
- Secure deletion
-
Service Start Failure
- Check database permissions
- Verify directory access
- Review WMI permissions
- Check log files
-
Recovery Point Creation Failure
- Verify disk space
- Check backup directory permissions
- Review database connectivity
- Check registry access
-
Component Isolation Issues
- Verify administrative rights
- Check component dependencies
- Review isolation logs
- Verify backup creation
- Check service status
Get-Service SystemGuardian | Format-List *
- Review recent logs
Get-Content "C:\ProgramData\SystemGuardian\logs\guardian_*.log" -Tail 100
- Check recovery points
SELECT * FROM recovery_points ORDER BY timestamp DESC LIMIT 5;
- Verify component status
SELECT name, status FROM components WHERE status != 'Active';
- Regular database cleanup
- Log rotation verification
- Recovery point validation
- Component status review
- Regular log review
- Performance tracking
- Resource usage monitoring
- Event pattern analysis
- Regular recovery point testing
- Backup retention management
- Storage space monitoring
- Integrity verification
- Stop service
- Backup database
- Update Python script
- Verify configuration
- Restart service
- Database integrity
- Recovery point validity
- Component status
- Resource usage
- 1001: Database connection failure
- 1002: Recovery point creation failed
- 1003: Component isolation error
- 1004: Registry backup failed
- 1005: WMI monitoring error
Detailed for each error code in the logs with specific troubleshooting procedures and recovery steps.
<Windows 11 Home - Insider Preview build Production 09/02/25>