RBAC Setup
Role-Based Access Control (RBAC) adds operator authentication to ClawNex. When disabled (default), the dashboard is accessible to anyone on localhost without login.
Enabling RBAC
Set environment variables
Add to your .env or .env.local:
RBAC_ENABLED=true
NEXT_PUBLIC_RBAC_ENABLED=trueRebuild and restart
npm run build && npm startCreate the admin account
On first visit with RBAC enabled, a setup wizard prompts you to create the initial Admin account. Enter a username and a strong password. This account has full platform control.
The 5 Roles
| Role | What You Can Do |
|---|---|
| Admin | Full platform access — manage users, configure RBAC, change all settings |
| Security Manager | Manage shield rules, whitelist entries, alert triage, break-glass activation |
| Operator | Monitor traffic, acknowledge and investigate alerts, run shield tests |
| Viewer | Read-only access to all dashboards and reports |
| Auditor | Read-only access to audit trails, compliance reports, and security logs |
28 Permissions
Permissions are assigned per role and enforced on every API route. Key permissions include:
config:read,config:write— configuration accessshield:scan,shield:manage— shield operationsalerts:read,alerts:manage— alert triageaudit:read— audit trail accesssystem:manage— system-level operations (install, restart, backup)workspace:read— agent workspace file accesschat:use,voice:use— proxy and voice features
SETUP_SECRET
When ClawNex is exposed on a network (not just localhost), the admin setup page could be accessed by anyone who reaches port 5001. Use SETUP_SECRET to prevent unauthorized admin creation:
# In .env
SETUP_SECRET=your-random-secret-hereThen access the setup page with:
http://your-host:5001/setup?secret=your-random-secret-hereWithout the correct secret, the setup page will not load.
Use SETUP_SECRET for any deployment where port 5001 is reachable from other machines — production, staging, and shared development servers.
Session Management
- Session timeout — configurable from 1 to 720 hours in Configuration > Session Settings
- Concurrent sessions — maximum 5 per operator; oldest session is revoked when exceeded
- Password change — revokes all of that operator’s sessions immediately
Progressive Account Lockout
Failed login attempts trigger escalating lockouts:
| Failed Attempts | Lockout Duration |
|---|---|
| 5 | 1 minute |
| 10 | 5 minutes |
| 15 | 30 minutes |
| 20+ | Account auto-disabled (requires admin re-enable) |
Lockout is per-account, not per-IP. A successful login resets the failure counter.