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:
@@ -7,6 +7,7 @@ import socket
|
||||
import json
|
||||
from flask import Blueprint, render_template, request, jsonify, Response, stream_with_context
|
||||
from web.auth import login_required
|
||||
from core.daemon import root_exec
|
||||
|
||||
defense_bp = Blueprint('defense', __name__, url_prefix='/defense')
|
||||
|
||||
@@ -40,6 +41,9 @@ def index():
|
||||
except Exception:
|
||||
sys_info['ip'] = '127.0.0.1'
|
||||
|
||||
# Return JSON if requested (for OS detection by sub-pages)
|
||||
if request.headers.get('Accept', '') == 'application/json':
|
||||
return jsonify(sys_info)
|
||||
return render_template('defense.html', modules=modules, sys_info=sys_info)
|
||||
|
||||
|
||||
@@ -108,7 +112,8 @@ def linux_check(check_name):
|
||||
@login_required
|
||||
def linux_firewall_rules():
|
||||
"""Get current iptables rules."""
|
||||
success, output = _run_cmd("sudo iptables -L -n --line-numbers 2>/dev/null")
|
||||
r = root_exec(['iptables', '-L', '-n', '--line-numbers'])
|
||||
success, output = r['ok'], r['stdout']
|
||||
if success:
|
||||
return jsonify({'rules': output})
|
||||
return jsonify({'rules': 'Could not read iptables rules (need sudo privileges)'})
|
||||
@@ -123,7 +128,8 @@ def linux_firewall_block():
|
||||
if not ip or not re.match(r'^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$', ip):
|
||||
return jsonify({'error': 'Invalid IP address', 'success': False})
|
||||
|
||||
success, _ = _run_cmd(f"sudo iptables -A INPUT -s {ip} -j DROP")
|
||||
r = root_exec(['iptables', '-A', 'INPUT', '-s', ip, '-j', 'DROP'])
|
||||
success, _ = r['ok'], r['stdout']
|
||||
if success:
|
||||
return jsonify({'message': f'Blocked {ip}', 'success': True})
|
||||
return jsonify({'error': f'Failed to block {ip} (need sudo)', 'success': False})
|
||||
@@ -138,7 +144,8 @@ def linux_firewall_unblock():
|
||||
if not ip or not re.match(r'^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$', ip):
|
||||
return jsonify({'error': 'Invalid IP address', 'success': False})
|
||||
|
||||
success, _ = _run_cmd(f"sudo iptables -D INPUT -s {ip} -j DROP")
|
||||
r = root_exec(['iptables', '-D', 'INPUT', '-s', ip, '-j', 'DROP'])
|
||||
success, _ = r['ok'], r['stdout']
|
||||
if success:
|
||||
return jsonify({'message': f'Unblocked {ip}', 'success': True})
|
||||
return jsonify({'error': f'Failed to unblock {ip}', 'success': False})
|
||||
|
||||
Reference in New Issue
Block a user