This commit is contained in:
2026-09-22 23:37:05 +03:00
parent cf1c31eb2a
commit 0fc35589e6
25 changed files with 2616 additions and 245 deletions

View File

@@ -7,6 +7,49 @@ WireGuard address only and allow TCP/9105 solely from the control-plane peer.
Alternatively bind to loopback and expose it through an authenticated tunnel.
TLS termination at the agent is supported when certificate paths are configured.
## Agent write features
On Debian/Ubuntu install the firewall userspace and persistence provider before
enabling managed writes:
```bash
sudo apt-get update
sudo apt-get install -y iptables iptables-persistent fail2ban
sudo systemctl enable --now netfilter-persistent vps-agent-helper.socket
```
Then edit `/etc/vps-agent/config.toml`. All write targets must be explicitly
allow-listed; use the real tunnel interface, management network and service
ports for the host:
```toml
[services]
allowed = ["nginx.service", "fail2ban.service"]
inventory_limit = 512
install_enabled = true
install_timeout_seconds = 300
packages = { "nginx.service" = "nginx", "fail2ban.service" = "fail2ban" }
[firewall]
management_enabled = true
persistence_enabled = true
allowed_interfaces = ["wg0"]
allowed_sources = ["192.168.50.0/24"]
allowed_ports = [22, 80, 443, 9105]
rollback_timeout_seconds = 60
max_snapshots = 5
[fail2ban]
management_enabled = true
allowed_jails = ["sshd", "nginx-http-auth"]
```
Restart the daemon after editing. The UI shows every iptables rule but only
rules in `VPS_CONTROL_INPUT` and `VPS_CONTROL_RATE` can be deleted. Successful
changes are saved through `netfilter-persistent`; failed changes restore the
last snapshot. Keep the control-panel port and source network in the allow-list
before adding restrictive rules.
## Control plane
```bash
@@ -36,7 +79,8 @@ needs only `/etc/vps-agent/`. For upgrades, pin image tags, back up, pull/build,
run `docker compose up -d`, then inspect health and audit events. Database
migrations are forward-only; restore the database backup for rollback.
Metric samples are retained for 30 days and collected logs for seven days by
Metric and connection samples are retained for 30 days and collected logs and
Fail2Ban history for seven days by
the backend cleanup loop. `METRICS_RETENTION` and `LOGS_RETENTION` control these
windows; log retention is constrained to one hour through 90 days. Configure
database-level backups independently of retention.