Firewall interface through OPNexus
With Open interface on the host page you open a firewall's web interface in a new browser tab, through OPNexus. This is mainly worthwhile for firewalls behind NAT that are reachable only through the management tunnel: your browser needs no access of its own to the tunnel network. You log in to the firewall as usual with its user and password; OPNexus neither knows nor stores these credentials and does not log in automatically.
The function is off by default and secured twice: it needs a setup on the server and a switch in the settings.
Setting up (in the .env in the OPNexus directory):
- HTTPS and
COOKIE_SECURE=true(see Network access and TLS). Without secure cookies the function cannot be switched on. - Activate the Compose profile
gui:COMPOSE_PROFILES=gui(comma-separated with other profiles, e.g.overlay,gui). This starts thegui-gatewaycontainer. - Set the slot addresses:
OPNEXUS_GUI_SITES=https://10.0.0.5:9441, https://10.0.0.5:9442, https://10.0.0.5:9443, https://10.0.0.5:9444. It is the same address as inOPNEXUS_SITES, one port per slot. These origins must not be inFRONTEND_ORIGIN(otherwise OPNexus does not start). - Shared secret
GUI_GATEWAY_TOKEN(at least 32 characters, e.g.openssl rand -hex 32). - Ports:
GUI_PORTS=9441-9444(the ports fromOPNEXUS_GUI_SITES) are the slot ports on the proxy. Set the entry explicitly: without it Docker assigns random free ports, so that an update does not fail on ports that are already taken (e.g. Portainer on 9443).GUI_BIND_ADDRESSdetermines where they listen; the default is127.0.0.1(local only). For access from the network, enter the address of the OPNexus machine and open the ports in the machine's firewall only for administrators. docker compose up -d, then switch it on under Settings › Firewall interface through OPNexus. If something is missing, the settings page names exactly what.
In the settings you also define: inactivity (default 15 minutes, 1 to 240), total duration (default 60 minutes, 5 to 720) and the number of simultaneous slots (default 4, 1 to 4). Switching it off ends all open sessions (the gateway notices at the latest after 20 seconds).
How it is secured:
- Own origin: every firewall interface runs on its own port (a "slot") and thus in its own browser origin, separate from OPNexus. Scripts of the firewall interface cannot address OPNexus; OPNexus also rejects requests carrying the login cookie from foreign origins.
- Cookies stay on the server: the gateway never passes the OPNexus session on to the firewall and never the firewall's cookies to your browser. The firewall session exists only in the gateway's memory.
- Admins only, only with a logged-in browser session (never with an API token). The gateway re-checks every 20 seconds: logging out, losing the admin role or switching the function off ends the session.
- One-time ticket: the click creates a ticket that is valid for only 30 seconds and exactly once and is bound to your session and the slot. Afterwards it disappears from the address bar.
- Secure firewalls only: https address and verified or pinned certificate (see pinning); otherwise the button stays disabled and names the reason.
- Time limits (inactivity and total duration) and audit: under Monitoring › Audit (kind "GUI access") ticket, start and end of every session appear with user, firewall, slot and client IP. What you do in the interface is logged by the firewall itself, but there with the address of OPNexus; the OPNexus audit shows who was behind it.
- Login protection: the gateway allows at most three failed logins per firewall in five minutes.
Important: enter the OPNexus address in the firewall's login protection. Through the gateway all logins come from OPNexus's address (for firewalls in the tunnel, from the hub's). OPNsense's login lockout (sshguard) blocks this address after several failed attempts, and with it also OPNexus's API access. Therefore add it on every firewall under System › Settings › Administration (Login Protection) to the whitelist before you use the function.
Limitations:
- No WebSocket (functions that need one do not work) and no automatic login.
- At most 4 slots at the same time. A slot stays with the same firewall per OPNexus session; if all are taken, close an interface or wait until it expires.
- Cool-down: a freed slot goes to a different firewall only 5 minutes after the end of the last session there (same user; a still-open session counts as taken). The same firewall gets it back immediately. Reason: a tab of the old firewall interface may still be open and shares its cookies with the slot. If all slots are taken or still cooling down, OPNexus names the reason; close the old tabs after your work.
- Change of the firewall address: if the address, pinned certificate or tunnel path of a firewall changes while its interface is open, the session ends at the next check at the latest (20 seconds).
- At most 64 sessions run at the same time. A running session is never displaced by a new one; once the limit is reached, the new one is rejected until one ends.
- After a restart of the wg-hub the management tunnel needs 2 to 4 minutes until the firewalls have reconnected; until then the interface cannot be opened.
- With
COOKIE_SECURE=falsethe function is not available.
Note for operators with their own scripts: since this function the session cookie is called
__Host-opnexus-session with HTTPS, and requests to /api with a cookie
and Sec-Fetch-Site: same-site or cross-site are rejected. Since 1.29 the old cookie opnexus-session
is no longer accepted with HTTPS: whoever has not logged in again since the change has to do so once
(scripts with a raw session cookie must use the new name; without HTTPS opnexus-session remains the
normal name). Scripts with an API token (Authorization: Bearer)
are not affected.
Alternative without this function: you set up your own WireGuard access into the firewalls' network (e.g. at the site or on the firewall itself) and open the interface directly. This is independent of OPNexus, but has no role check and no audit by OPNexus.