Users, roles and login
Roles. There are three:
| Role | May |
|---|---|
admin | everything, including users, settings, creating/deleting hosts, OPNexus update, raw download of configuration backups |
operator | deploy and operate: rules, aliases, NAT, VPN, certificates, maintenance, backups, security check. Not: users, settings (notifications, backups, audit export, logs), creating/changing/deleting hosts, OPNexus update, downloading raw backups |
read_only | sees everything, changes nothing |
A read-only user cannot change anything: all write actions are disabled in the interface and rejected by the backend with 403. An operator also gets 403 on the admin actions ("requires the Admin role"); the attempt is recorded in the audit log. Only your own password as well as colour scheme and language remain changeable for every role.
Your own roles (1.42). Settings › Access › Roles lists the three built-in roles and lets you make more. A role is a set of permissions; an account has exactly one role. Typical examples: an auditor who only reads the audit trail and the change report, a drafter who prepares rules but may not roll them out, a network team that manages VPN and certificates but never touches rules.
- Make one: New role (or Copy as new role from a built-in or another custom role), name it, tick the permissions, save. The permissions are grouped by area and marked look, prepare, roll out or administer; prepare changes only drafts inside OPNexus, roll out puts changes onto firewalls, administer decides who may do what and where OPNexus sends data.
- A change applies from the next request. Everybody with that role is affected at once, no new sign-in needed. Give an account a custom role under System › Users, or map an SSO group to it.
- Nobody hands out more than they hold. You can only tick permissions you hold yourself; you cannot give an account a role that holds more than you do. What a role already has stays and can be taken away, but only by someone who holds everything that role holds. The same goes for accounts: whoever may manage users can only reset the password or second factor of, change the role of, or delete an account whose role holds no more than their own (so a "helpdesk" role cannot take over an administrator), and nobody changes their own role. Changing the single sign-on settings counts as handing out every role in the group list, so it needs the same.
- Built-in roles cannot be changed or deleted (copy one instead). A role in use by an account or an SSO group cannot be deleted; the message says how many.
- API tokens never do more than their account. A token holds the permissions of its scope (read, deploy, admin) that the account also holds. A role without the roll-out permissions gives tokens without them too, whatever the scope says. Permissions that expose secrets (raw backups, notification settings) are never part of a token below the scope admin, and a few actions (managing tokens, changing your own password, confirming a cleanup) work only in a browser session.
- Deny by default. A request to an endpoint that has no permission assigned is refused; a test fails the build when a new endpoint is missing one.
- Audited. Creating, changing and deleting a role is recorded with the permissions before and after.
The permissions and who holds them by default (¹ = the operator holds it only while Operators may deploy changes themselves is on):
| Permission | Kind | What it allows | admin | operator | read_only |
|---|---|---|---|---|---|
hosts.read | look | See the firewalls, their status and their data | ✔ | ✔ | ✔ |
hosts.prepare | prepare | Edit host variables and similar drafts | ✔ | ✔ | – |
hosts.operate | roll out | Operate firewalls: services, boot environments, interface and DNS/DHCP changes | ✔ | ✔ ¹ | – |
hosts.manage | administer | Register, edit and remove firewalls | ✔ | – | – |
hosts.gui | administer | Open a firewall's web interface through OPNexus | ✔ | – | – |
policy.read | look | See rules, aliases, NAT and the rule analysis | ✔ | ✔ | ✔ |
policy.write | prepare | Prepare rules, aliases, NAT and groups (nothing reaches a firewall) | ✔ | ✔ | – |
policy.deploy | roll out | Roll rules, aliases and NAT out to firewalls, take them back, delete them | ✔ | ✔ ¹ | – |
policy.cleanup | administer | Run and restore a rule cleanup | ✔ | – | – |
vpn.read | look | See VPN tunnels and instances | ✔ | ✔ | ✔ |
vpn.write | prepare | Prepare VPN tunnels and instances | ✔ | ✔ | – |
vpn.deploy | roll out | Roll VPN configuration out to firewalls and remove it | ✔ | ✔ ¹ | – |
certificates.read | look | See certificates and ACME accounts | ✔ | ✔ | ✔ |
certificates.write | prepare | Prepare certificates and ACME accounts | ✔ | ✔ | – |
certificates.deploy | roll out | Push certificates to firewalls, sign and renew them | ✔ | ✔ ¹ | – |
maintenance.read | look | See maintenance windows, rollouts and firmware status | ✔ | ✔ | ✔ |
maintenance.plan | prepare | Plan maintenance windows and firmware rollouts | ✔ | ✔ | – |
maintenance.execute | roll out | Run updates, reboots, CARP switches and rollouts | ✔ | ✔ ¹ | – |
logs.read | look | Read the firewall logs | ✔ | ✔ | ✔ |
logs.settings | administer | Change how logs are collected and kept | ✔ | – | – |
audit.read | look | Read the audit trail and the change report | ✔ | ✔ | ✔ |
audit.export | administer | Set up the audit export to syslog or a webhook | ✔ | – | – |
security.read | look | See security findings and compliance | ✔ | ✔ | ✔ |
security.check | prepare | Start security checks and scans | ✔ | ✔ | – |
backups.read | look | See the list of configuration backups | ✔ | ✔ | ✔ |
backups.run | prepare | Create, compare and restore backups | ✔ | ✔ | – |
backups.settings | administer | Change backup schedule and retention | ✔ | – | – |
backups.download | look | Download a raw configuration backup (holds password hashes and keys) | ✔ | – | – |
config.export | look | Export OPNexus' configuration as code and plan an import | ✔ | ✔ | ✔ |
config.apply | administer | Apply a configuration-as-code import | ✔ | – | – |
mcp.use | look | Use the MCP interface (read only) | ✔ | ✔ | ✔ |
metrics.read | look | Read the Prometheus metrics | ✔ | ✔ | ✔ |
notifications.read | look | See notification channels and settings (they hold webhook and mail data) | ✔ | ✔ | ✔ |
governance.read | look | See the separation-of-duties settings | ✔ | ✔ | ✔ |
system_settings.read | look | See OPNexus' system settings | ✔ | ✔ | ✔ |
system.read | look | See OPNexus' version and update information | ✔ | ✔ | ✔ |
system.status | look | See OPNexus' internal status | ✔ | – | – |
system.update | administer | Update OPNexus itself | ✔ | – | – |
ha.status | look | See the OPNexus high-availability status | ✔ | – | – |
ha.manage | administer | Set up and switch OPNexus high availability | ✔ | – | – |
settings.read | look | See OPNexus' own settings | ✔ | ✔ | ✔ |
settings.view | look | See the settings that hold secrets (SSO, e-mail, export targets) | ✔ | – | – |
settings.write | administer | Change OPNexus' settings: SSO, notifications, separation of duties, certificates | ✔ | – | – |
users.read | look | See the list of accounts | ✔ | ✔ | ✔ |
users.manage | administer | Create, change and remove accounts and give them roles | ✔ | – | – |
tokens.manage | administer | Create API tokens (everybody manages their own; this one sees all) | ✔ | – | – |
roles.manage | administer | Create, change and remove roles | ✔ | – | – |
Single sign-on (OIDC). Under Settings › Single sign-on (OIDC) you connect an
identity provider (Authentik, Keycloak, Entra ID, Google, …). The login page then shows an
additional button ("Sign in with …"). At the provider you need a client with the
Authorization Code flow (OPNexus additionally uses PKCE) and enter the displayed
redirect URI there (https://<your-opnexus>/api/auth/oidc/callback). In OPNexus you enter
issuer URL, client ID, client secret and the group names that map to the roles Admin, Operator
and Read-only. "Test provider" checks discovery and signing keys.
- Role from groups, at every login: the list of groups under Settings › Single sign-on (group → role, any built-in or own role) is read from top to bottom and the first row that matches applies; whoever is in none of the groups does not get in (and no account is created). If someone is removed from the group, access ends at the next login (running SSO sessions end after 12 hours at the latest; people blocked at the provider should therefore also be deleted in the user list).
- Accounts: SSO users are created at their first login (marked "SSO"). Role and password
change only at the provider; the provider handles two-factor login. An SSO account is never linked with
a local account of the same name: in case of a name conflict it gets a suffix (
~sso). - Local accounts remain: login with user name and password keeps working, e.g. for an emergency if the provider fails.
- Verified are the signature (asymmetric algorithms only, never
noneor HMAC), issuer, audience, expiry and nonce of the ID token; every login attempt (state) is valid exactly once and for 10 minutes and is bound by a cookie (with HTTPS__Host-opnexus-oidc-state) to the browser that started it; a call without this cookie always fails. Groups come from the ID token, alternatively from the userinfo endpoint. Issuer and endpoints must behttps://. This is tested against an imitated provider (including forged tokens) and against real servers of Keycloak 26 and Authelia 4.39 (login, roles from groups, role removal, intercepted callback); other providers: report what does not work with yours. The default scopes areopenid profile email; the groups must arrive as a claim in the ID token or userinfo (Keycloak: "Group Membership" mapper on the client; Entra ID: optional groups claim). Providers that only send groups on request (e.g. Okta, Authelia) additionally need the scopegroups.
Separation of duties. Settings › Separation of duties: if you switch off "Operators may deploy changes themselves", operators only prepare changes (create, edit, preview), and only an admin deploys: deploying, removing or rolling back a deployment, running or scheduling maintenance, applying network changes. The rejection ("administrator only") appears in the audit log. This is a two-person step (preparing and deploying by different people), not an approval queue.
User management (System › Users, admins only): create users, change the role,
reset the password, reset another user's two-factor login,
delete. You cannot delete yourself and cannot demote yourself from being the last admin. Only accounts that hold users.manage (admins by default) see the user list (GET /api/users); every other role,
including a token, sees only its own account.
Login.
- Several failed attempts (default: 5 in 5 minutes, per user and IP) lock the login for five minutes.
- A session lasts 30 days. Changing the password ends all sessions of the account.
- After login a notice shows time and IP of the previous login, failed attempts since then and the end of the current session. If something looks wrong, change the password.
Two-factor login (optional, per user): Settings › Two-factor login. Scan the QR code with an authenticator app, confirm the code and keep the 10 single-use recovery codes safe. The password is requested again during setup. A code can be used only once; wrong codes count towards the login lockout.
Lost access?
- Password:
./opnexus password [user], see First start. - Two-factor, if the recovery codes are gone too: another admin
resets it in the user list; for the last admin, on the server run
docker compose exec backend python -m app.reset_2fa <username>.