Security and users
Manage users and custom roles, passwords, two-factor authentication, single sign-on, API keys, TLS and secrets.
Users and roles
| Authority | Can |
|---|---|
| System administrator | Tenants, tenant profiles, server settings (mail, SMS, security, OAuth 2, queues) |
| Tenant administrator | Everything inside the tenant: devices, assets, dashboards, rule chains, users, customers, the catalogue |
| Customer user | Dashboards and entities assigned to their customer |
Create users under Users (tenant) or a customer's Users. New users get an activation link by e-mail, or you copy it from the user's page when no mail server is set.
Change the three demo accounts' passwords, or delete them, before the server is reachable by others. A production install (deploy/production/deploy.sh) creates no demo tenant or demo users, and replaces the system administrator's default password right after the first install (see the production README).
Custom roles
Customers & users > Roles (tenant administrator) defines roles: a name and, per resource (devices, assets, dashboards, alarms, rule chains, users, ...), the allowed actions (View, Edit, Create, Delete, Assign, Credentials, Commands (RPC), Claim; for alarms also Acknowledge and Clear). Assign a role to tenant administrators or customer users on the same page.
- A role only restricts. The server first applies the normal rights of the account type, then the role: a customer user with a role that ticks everything still sees only their own customer's entities.
- Users without a role are unchanged. Nothing changes until you assign a role.
- Anything not ticked is refused with HTTP 403. Always allowed: reading widgets, device and asset profiles, the own organization and the own profile; customer users also read their own customer.
- Only a tenant administrator without a role can manage roles, and nobody can give themselves a role. If every tenant administrator ended up with a role, the system administrator creates a new tenant administrator.
- Deleting a role removes it from its users: they get the full rights of their account type again.
- Users: All / Edit / Create, Rule chains: Edit / Create and Version control: Edit / Create let the holder create or take over unrestricted accounts or logic, so they amount to full rights. Signing in as another user, activation links and activation e-mails need Users: All.
What the server enforces: every single-entity request and every write, telemetry, attributes and commands (REST and WebSocket), the entity lists (/api/tenant/devices, /api/customer/{id}/assets, ...), entity and alarm queries (/api/entitiesQuery, /api/alarmsQuery) and dashboard subscriptions (rows of resources the role may not view are removed; no alarms without Alarms: View). Not filtered by role: entity counts (/api/entitiesQuery/count, count widgets), relation lists and the home dashboard. The UI hides the menu items, the add and delete buttons and makes details read-only according to the role; buttons inside widgets (for example acknowledge in an alarm table) stay visible and get "permission denied".
Roles are stored per tenant in the admin setting nexusRoles (no schema change). A change applies on the next request on the same server; other nodes of a cluster pick it up within nexus.roles.cache_ttl_sec seconds (default 30). REST API: GET/POST /api/nexus/roles, DELETE /api/nexus/roles/{roleId}, POST /api/nexus/roles/{roleId}/users/{userId}, DELETE /api/nexus/roles/users/{userId}, GET /api/nexus/roles/me.
The customer Nexus permissions (Customer workspace) are separate UI switches for a whole customer; roles are per user and enforced by the server.
Default dashboards, rules and profiles can be marked as protected so nobody can delete them: see Protected items. Lists have category filter buttons: see Category filters in lists.
Per-customer switches for alarm actions (acknowledge, clear, assign, comment) and device control: see Customer permissions.
Passwords, lockout and sessions
Settings > Security (system administrator): password policy (length, character classes, expiry, reuse), account lockout after failed logins, and JWT lifetimes (access token default 2.5 h, refresh token 1 week). Changing the JWT signing key logs everybody out.
Two-factor authentication
Settings > Two-factor authentication enables TOTP apps, SMS, e-mail and backup codes, and can force 2FA for all users. Users set it up in their profile (Security).
OAuth 2 / single sign-on
Settings > OAuth 2 connects an identity provider you control (Keycloak, Azure AD/Entra ID, any OpenID Connect provider). Aniston Nexus never needs a public Google or GitHub login; those templates are only examples. Map users to tenants and customers with the provider's claims.
API keys
Tenant administrators create API keys (Profile > API keys) for scripts. Send them as X-Authorization: ApiKey <key>. The package tools accept --api-key. Keys carry the creating user's permissions; give scripts their own user.
TLS
In production all browser and API traffic goes through the TLS proxy in deploy/production/tls-proxy/ (certificates from Let's Encrypt or your own CA). MQTT over TLS (8883) and CoAP over DTLS are enabled in the backend; see Devices.
Secrets
Secrets (database password, JWT key, API keys of nexus-services, SMS/SMTP credentials, Kafka credentials) live in deploy/production/.env on the server (mode 600) or in the CI environment production. They are never committed, never put in dashboards or widget settings that customers can read, and never sent to an AI model. The content tools refuse to publish items that contain them.
Tenant secret store
Passwords and tokens that tenant administrators need in their own configurations (cloud bridge brokers, ERP/CMMS connectors, the Water rule chain's ingest secret for the solution installer) can be kept in the tenant secret store of nexus-services instead of the server's environment. It is off by default: set NEXUS_SECRETS_ENABLED=true and a master key NEXUS_SECRETS_MASTER_KEY (32 bytes, openssl rand -base64 32; or NEXUS_SECRETS_MASTER_KEY_FILE). nexus-services does not start without the key; keep a copy of it, because without it the stored values cannot be decrypted.
- Values are encrypted with AES-256-GCM before they are stored (schema
nexus_water, tabletenant_secret); the tenant and the name are bound to the ciphertext, so a value copied to another tenant does not decrypt. GET/POST /api/water/v1/secrets,GET/PUT/DELETE /api/water/v1/secrets/{name}: tenant administrators only, for their own tenant. Values are write-only: the API returns names, descriptions, versions and who changed them, never a value.PUTwith a new value rotates it. Every change is written to the activity log (name only).- Refer to a secret as
secret:NAMEwhereverenv:NAMEandfile:/run/secrets/...work (cloud bridge and connector password, token and key fields). Connectors run in the service's own tenant, so their references are looked up there. The value is read on every use, so a rotation takes effect on the next connection or request.