Skip to content

Optional RBAC

ChannelWatch v1.0 ships with a built-in role-based access control system. It’s disabled by default, so single-user home lab deployments work exactly as they did before with no extra configuration. When you do enable it, you get three distinct roles that let you share dashboard access without giving everyone full control.

RoleWhat they can do
AdminFull access: manage DVR servers, change settings, manage users, rotate credentials, view all data
OperatorCan configure alerts and notification providers, view all dashboard data, but cannot manage users or rotate the encryption key
ViewerRead-only access to the dashboard and activity history. Cannot change any settings

RBAC is enabled in Settings > Security. Flip the Enable RBAC toggle. Before you do, make sure you have at least one admin user configured, or use the environment variable bootstrap described below.

When you enable RBAC, the security mode badge in the header changes to RBAC_WITH_API_KEY_FALLBACK (yellow). This means roles are active for browser sessions, but the existing API key still works as a bypass. To enforce roles strictly, disable the API key fallback in the same settings page.

There are two ways to create the initial admin account.

Section titled “Option 1: Environment variables (recommended for automation)”

Set CW_ADMIN_USER and CW_ADMIN_PASS before the first startup with RBAC enabled:

environment:
CW_ADMIN_USER: "admin"
CW_ADMIN_PASS: "your-strong-password"

On startup, ChannelWatch checks whether any users exist. If none do, it creates an admin account using these credentials. The environment variables are not stored after the account is created — you can remove them from your compose file after the first run.

If RBAC is enabled and no users exist, ChannelWatch blocks the UI with a setup wizard modal on first access. The wizard prompts you to create an admin username and password before you can proceed.

This path works well for interactive setups where you’re at the keyboard during first launch.

Once you’re logged in as an admin, go to Settings > Users to:

  • Add new users and assign roles
  • Change a user’s role
  • Reset a user’s password
  • Disable or delete a user

There is no limit on the number of users.

The security mode badge in the top-right corner of every page shows the current state. After enabling RBAC and disabling the API key fallback, the badge should show green RBAC_ONLY.

You can also check the current state via the API:

GET /api/v1/security/status

Look for "mode": "RBAC_ONLY" and "api_key_fallback_allowed": false to confirm strict enforcement is active.

If you lose access to all admin accounts, you can recover by setting CW_ADMIN_USER and CW_ADMIN_PASS environment variables and restarting the container. ChannelWatch will create a new admin account using those credentials if no users currently exist, or reset the named user’s password if the username matches an existing account.

environment:
CW_ADMIN_USER: "admin"
CW_ADMIN_PASS: "new-recovery-password"

After recovery, remove the environment variables and restart again to avoid leaving credentials in your compose file.

Browser sessions use secure, HTTP-only cookies with CSRF protection. Sessions expire after a configurable idle timeout (default: 24 hours). The session cookie is marked Secure when ChannelWatch detects it is running behind HTTPS.

When RBAC is enabled, the relationship between the API key and roles depends on the active security mode:

  • RBAC_WITH_API_KEY_FALLBACK: The API key bypasses all role checks. Any request with a valid API key has full admin-equivalent access.
  • RBAC_ONLY: The API key is disabled. All requests must authenticate as a named user. Automation that previously used the API key must be updated to use a service account with an appropriate role.

See Security Modes for a full explanation of the three modes and when to use each.