Securely wipe state.db on exit (#216)

- Add secure_wipe_file() to utils/crypto.py for file overwrites + deletion
- Add secure_wipe parameter to StateManager.stop() method
- Wipes all SQLite WAL files (.db, .db-wal, .db-shm) with 3 passes
- Normal exit now calls state.stop(secure_wipe=True) to clear state database
- Falls back to regular delete if secure wipe fails
- Prevents state.db from persisting on disk after shutdown
This commit is contained in:
Cobra
2026-04-06 11:44:44 -04:00
parent edf2ea7c36
commit 78738622eb
3 changed files with 59 additions and 3 deletions
+1 -1
View File
@@ -244,7 +244,7 @@ def start(daemon, passive_only):
res_mon.stop()
engine.stop_all()
tool_manager.stop_all()
state.stop()
state.stop(secure_wipe=True)
bus.stop()
console.print("[green]SystemMonitor stopped.[/green]")