Skip to content

Architecture

flowchart TB
  subgraph Admin
    UI[Web UI]:::a
    API[REST API]:::a
    CLI[CLI: web terminal · fr0ntier cli · SSH]:::a
  end
  subgraph Daemon["fr0ntier serve (root)"]
    ST[Config store<br>candidate · running · versions]
    EN[Commit engine<br>validate · render · pre-check · apply · confirm]
    MON[Monitoring<br>collectors · TSDB · logs · alerts · exporters]
    AUTH[Auth<br>users · TOTP · tokens · audit]
  end
  UI --> API --> ST
  CLI --> ST
  ST --> EN
  EN --> NFT[nftables]
  EN --> NWD[systemd-networkd]
  EN --> DHCP[dnsmasq DHCP/RA]
  EN --> DNS["fr0ntier dns (fr0ntier-dns user)"]
  EN --> VPN[WireGuard · OpenVPN · strongSwan]
  EN --> WIFI[hostapd · wpa_supplicant]
  EN --> SYS[sysctl · chrony · sshd]
  MON --> EXP[Prometheus · InfluxDB · Graphite · syslog/CEF · HTTP · files]
  classDef a fill:#063,stroke:#0d0,color:#fff

One binary, several roles

Command Runs as Purpose
fr0ntier serve root, fr0ntier.service API + web UI (HTTPS 8443), commit engine, monitoring, CLI socket
fr0ntier dns fr0ntier-dns, fr0ntier-dns.service DNS resolver/filter on port 53 (only CAP_NET_BIND_SERVICE)
fr0ntier init / apply root, installer first configuration, write files before the first boot
fr0ntier cli / console / passwd root, shell local CLI over /run/fr0ntier/cli.sock, rescue menu, password reset

The binary is built with the Go standard library only (CGO_ENABLED=0) — no third-party code, small attack surface, trivial cross-compilation.

Declarative model and renderers

The whole firewall is one JSON document (/etc/fr0ntier/running.json). Renderers are pure functions turning it into native configuration:

Subsystem Generated files
nftables /etc/fr0ntier/nftables.nft (tables inet fr0ntier, inet fr0ntier_nat), /etc/fr0ntier/fastpath.nft (flowtable)
networkd /etc/systemd/network/10-fr0ntier-*.link, 15-fr0ntier-*.netdev, 20-fr0ntier-*.network
DHCP /etc/fr0ntier/dnsmasq.conf
DNS /etc/fr0ntier/dns.json
WireGuard netdevs + /etc/fr0ntier/wireguard/*.key
OpenVPN /etc/fr0ntier/openvpn/*.conf + PKI in /var/lib/fr0ntier/pki
IPsec /etc/swanctl/conf.d/fr0ntier.conf + XFRM netdevs
Wi-Fi /etc/fr0ntier/hostapd/*.conf, /etc/fr0ntier/wpa/*.conf
System sysctl, chrony sources/allow, sshd port, hostname, time zone

The engine compares rendered files with what is on disk and only reloads the subsystems whose files changed — committing a new address object does not restart networking.

Boot sequence

  1. fr0ntier-firewall.service loads the committed ruleset before networking (network-pre.target); if it cannot, a restrictive fail-safe ruleset is loaded.
  2. systemd-networkd brings up interfaces, VLANs, bridges, WireGuard and XFRM.
  3. fr0ntier.service starts, re-arms or executes a pending automatic rollback, reconciles the system with the running configuration and loads the fast path.
  4. fr0ntier-dns, fr0ntier-dhcp and VPN/Wi-Fi units start as configured.

Monitoring pipeline

Collectors run every 10 s (configurable) reading /proc, /sys, nftables counters, conntrack, wg, swanctl, OpenVPN status files, the DNS server and S.M.A.R.T. Gauges go into the embedded TSDB; events (firewall log via NFLOG, DNS queries, audit, alerts, flows, system) go through an internal bus to the log store and exporters.