AUTARCH v1.9 — remote monitoring, SSH manager, daemon, vault, cleanup
- Add Remote Monitoring Station with PIAP device profile system - Add SSH/SSHD manager with fail2ban integration - Add privileged daemon architecture for safe root operations - Add encrypted vault, HAL memory, HAL auto-analyst - Add network security suite, module creator, codex training - Add start.sh launcher script and GTK3 desktop launcher - Remove Output/ build artifacts, installer files, loose docs - Update .gitignore for runtime data and build artifacts - Update README for v1.9 with new launch method, screenshots, and features Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -46,12 +46,26 @@ class Defender:
|
||||
print(f" {Colors.DIM}{details}{Colors.RESET}")
|
||||
|
||||
def run_cmd(self, cmd: str) -> tuple:
|
||||
"""Run command and return (success, output)."""
|
||||
"""Run command and return (success, output).
|
||||
Routes through the privileged daemon for commands that need root."""
|
||||
try:
|
||||
result = subprocess.run(cmd, shell=True, capture_output=True, text=True, timeout=10)
|
||||
return result.returncode == 0, result.stdout.strip()
|
||||
except:
|
||||
return False, ""
|
||||
from core.daemon import root_exec
|
||||
import shlex
|
||||
# Strip shell redirections for the daemon (2>/dev/null, | head, etc.)
|
||||
# The daemon doesn't support shell pipes, so run the base command
|
||||
clean = cmd.split('2>/dev/null')[0].split('|')[0].strip()
|
||||
if clean.startswith('sudo '):
|
||||
clean = clean[5:].strip()
|
||||
parts = shlex.split(clean)
|
||||
r = root_exec(parts, timeout=10)
|
||||
return r['ok'], r['stdout'].strip()
|
||||
except Exception:
|
||||
# Fallback to direct shell execution
|
||||
try:
|
||||
result = subprocess.run(cmd, shell=True, capture_output=True, text=True, timeout=10)
|
||||
return result.returncode == 0, result.stdout.strip()
|
||||
except Exception:
|
||||
return False, ""
|
||||
|
||||
def check_firewall(self):
|
||||
"""Check if firewall is enabled."""
|
||||
|
||||
Reference in New Issue
Block a user