Infrastructure Tools
File: assistant/infra_tools.go
Infrastructure management tools providing real-time monitoring and agent-scoped remote SSH execution with safety checks.
Fortress Bottleneck Monitor
handleFortressBottleneckMonitor() — Aggregates real-time infrastructure metrics against configurable thresholds.
Data Sources (from floatingvariables):
- Gadgetzan CPU/RAM percentages
- cPanel cluster health status
- Virtualizor VM CPU utilization
Output: Formatted "Equilibrium Report" with thresholds:
- Default CPU threshold: 80%
- Default RAM threshold: 90%
Remote SSH Execution
handleRemoteSSHExecution() — MasterAdmin/NOC-only tool for executing commands on remote servers via persistent SSH.
Agent-Scoped Server ACLs
| Agent | Allowed Servers | Notes |
|---|---|---|
nova |
ldn.london-hosting.com |
London-Hosting only |
sysafe |
hosting.sysafe.co.uk, ldn.london-hosting.com |
Sysafe + London-Hosting |
sasha |
gadgetzan.dlan, dweb.dlan, ai.dlan, wifi.dlan, etc. |
Internal dLAN servers |
MasterAdmin |
All servers | Unrestricted |
Exported functions:
GetAllowedRemoteServers()— Returns all allowed serversGetAgentAllowedServers(agentName)— Returns servers for a specific agentIsServerAllowedForAgent(server, agentName)— ACL check
Connection Reliability
checkServerReachability() — 5 retry attempts with 3-second delays on TCP port 22 before giving up.
Command Safety
IsRemoteCommandSafe() — Blocks destructive commands:
Blocked patterns: rm -rf, rmdir, mkfs, dd, shutdown, reboot, halt, iptables -F, ufw disable, fork bombs, chmod -R 777, curl (in destructive contexts), etc.
Parse exit codes: parseCommandExitCode() interprets SSH command errors with helpful troubleshooting hints.
See also: CSF Firewall Management, Nightly Security Audit