feat: implement self-healing auditor with remote LAPI sync
This commit is contained in:
1 parent
848a29543d
commit
672e821738
6 files changed
+56
-12
No files matched your search
@@ -8,7 +8,7 @@ from reporter import LocalStateReporter
|
||||
logging.basicConfig(
|
||||
level=logging.INFO,
|
||||
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
|
||||
filename='/home/patrick/threat-engine-agent/logs/threat-agent.log'
|
||||
filename='/root/threat-engine-agent/logs/threat-agent.log'
|
||||
)
|
||||
|
||||
def main():
|
||||
@@ -19,14 +19,17 @@ def main():
|
||||
reporter = LocalStateReporter()
|
||||
|
||||
CHECK_INTERVAL = 600
|
||||
logging.info("Threat Engine Agent initialized on Triton.")
|
||||
print(f"[*] Agent started. Check interval: {CHECK_INTERVAL}s")
|
||||
logging.info("Threat Engine Agent initialized on Zephyrus.")
|
||||
|
||||
while True:
|
||||
try:
|
||||
is_synced, count = auditor.reconcile()
|
||||
|
||||
reporter.update_status(is_synced, count)
|
||||
|
||||
status_msg = f"Audit Success: {count} IPs in sync." if is_synced else f"DESYNC: {count} in kernel. Healing..."
|
||||
print(f"[+] {status_msg}") # This will show up in your terminal!
|
||||
|
||||
if not is_synced:
|
||||
logging.warning(f"Desync detected ({count} IPs in kernel). Healing...")
|
||||
auditor.heal()
|
||||
@@ -34,6 +37,7 @@ def main():
|
||||
else:
|
||||
logging.info(f"Audit Success: {count} IPs in sync.")
|
||||
|
||||
print(f"[*] Sleeping for {CHECK_INTERVAL} seconds...")
|
||||
time.sleep(CHECK_INTERVAL)
|
||||
|
||||
except KeyboardInterrupt:
|
||||
|
||||
Reference in new issue
Block a user