Skip to content

Users and roles ​

Everyone logs in to PBXsight — also on the machine it runs on. A load-testing tool can place thousands of calls through a production-grade PBX with one click, so "who may start a test" and "who started this one" matter as much as for the PBX itself. This page covers the roles, sessions, password rules, what to do when nobody can log in, and the activity log.

First step: as an admin, open Users and add one account per person with the lowest role they need (Add and manage users).

Roles ​

There are three fixed roles. Each includes everything the role below it may do.

RoleMay
Viewerread everything: Dashboard, results and run pages, logs, exports and reports, compare, schedules, profiles (without secrets), extension sets (without passwords), the licence state; change their own password
Operatoreverything a viewer may, plus: start and stop tests, Run now, create / change / delete schedules, upload and delete extension sets, label and delete runs
Admineverything, plus: create / change / delete PBX profiles, enter or remove the licence key, manage users, read the activity log

How the server decides, for every request (one policy, so a new feature can't forget it):

  1. the login, setup and auth-state endpoints need no login; the UI's static files contain no data;
  2. your own session, password and API tokens (/api/auth/…, /api/tokens) need any role;
  3. /api/users and /api/audit (the activity log) need admin — also for reading;
  4. any other read (GET) needs viewer;
  5. changes to /api/profiles and /api/license need admin;
  6. every other change needs operator;
  7. with an API token instead of a browser login, managing tokens, users and passwords (/api/tokens, /api/users, /api/auth/… except reading who you are) is refused with 403, whatever the token's role.

Without a login the API answers 401; with a role that may not, 403 (your role (viewer) may not do this; ask an admin). The UI hides or disables what your role can't do. The WebSocket for live updates (/ws) needs a login like the API.

There are no per-profile permissions: a user's role applies to all PBX profiles.

The first admin ​

On the first start nobody can use the app until the first admin is created on the setup page — directly on the app's machine, or from elsewhere with the setup token printed in the log. Step by step: First start.

Add and manage users ​

Admins manage accounts on Users (your name in the top bar → Users).

The Users page with an Add a user form and a table of users with role selectors and buttons
Users: add a user with a role and an initial password; change the role, set a password, disable or delete.
  • Add a user: user name, role, initial password. User names have 1–64 characters (letters, digits and . _ - @) and are not case-sensitive (Anna and anna are the same user).
  • Role: change it in the table; it applies from the user's next request.
  • Set password: an admin sets a new password; the user's sessions end (except the admin's own current one when setting their own).
  • Disable / Enable: a disabled user can't log in, and their open sessions end at once — live views included. Prefer it to deleting when someone leaves: their name stays on the runs they started.
  • Delete: removes the account, its sessions and its API tokens. Runs and activity-log entries keep the name as text.
  • API tokens: the table shows how many API tokens each user has; Revoke tokens (click twice) revokes all of them — e.g. when someone leaves, together with Disable. Each user creates and revokes their own tokens on their account page; an admin can't create tokens for someone else. A disabled user's tokens stop working at once (and work again if re-enabled); a password change does not revoke tokens.
  • User limit: the licence may allow a number of enabled users; at the limit, adding or enabling a user is refused (Users per licence).

Guards, so an install can't lose its last admin by accident:

  • you can't disable yourself, change your own role or delete yourself — ask another admin;
  • the last enabled admin can't be demoted, disabled or deleted (NAME is the only enabled admin; make another user admin first).

Everyone changes their own password on Account (their name in the top bar): current password, new password twice. Their other sessions end; the current one stays. API tokens keep working — revoke them in the API tokens card on the same page when needed (see Automate with the API).

The Account page with a change-password form and a Session card
Account: change your own password; the Session card shows whether the connection is encrypted, the idle timeout and the licence state.

Passwords ​

  • At least 10 characters (counted as characters, so a passphrase with accents is fine), at most 1024 bytes, and not the user name. No composition rules: length beats complexity.
  • Stored as PBKDF2-HMAC-SHA256 hashes with 600 000 iterations and a random salt per password; the plain password is never stored or logged.
  • A login for an unknown user name takes as long as for a real one, so timing doesn't reveal which names exist.

Sessions ​

Logging in creates a session and sets the cookie pbxsight_session: HttpOnly (scripts can't read it), SameSite=Lax, and Secure when the connection is HTTPS (directly or through a trusted proxy). The database stores only a SHA-256 of the token, so a copy of the database doesn't contain usable sessions.

A session ends when:

WhatDefaultConfig key
no request for this long7 days (168h)server.session_idle_timeout
this long after login, whatever the activity30 days (720h)server.session_max_age
the user logs out
the user's password is changed (by them: their other sessions; by an admin: all)
the user is disabled or deleted
the same user logs in from another browseralways (one session per user)

One session per user. Logging in ends that user's other sessions: the other browser drops to the login page with You were logged out: NAME logged in from another browser (one session per user). The activity log's login entry says logged out N other session(s). People who share an account keep logging each other out — give everyone their own user.

Both timeouts must be at least 1m. Activity is recorded at most once a minute; expired sessions are deleted every hour. A WebSocket's session is re-checked, so logging out or disabling a user also stops their live views.

Failed logins ​

Failed logins are counted in a sliding 15-minute window, and blocked with 429 (too many failed logins; try again in …, with Retry-After) when either limit is reached:

  • 5 failures per user name — protects one account from guessing;
  • 20 failures per client address — slows down trying many names from one place.

A successful login clears the user name's counter. Changing your own password counts wrong current passwords against the same per-name limit, and the setup page allows 5 wrong setup tokens per address. Every failed login is written to the activity log with the address (failed login, detail wrong user name or password or account disabled); the login page itself says only wrong user name or password (or the account is disabled), so it doesn't reveal which. The counters live in memory and reset when the app restarts.

Get back in when locked out ​

If nobody can log in as admin (forgotten password, the only admin disabled by direct database edits, an admin who left), run reset-admin on the app's machine with the same config the service uses:

sh
# .deb / .rpm
sudo -u pbxsight pbxsight -config /etc/pbxsight/config.yaml reset-admin NAME
# Docker
docker compose exec pbxsight /usr/bin/pbxsight -config /etc/pbxsight/config.yaml reset-admin NAME
# binary
./pbxsight -config config.yaml reset-admin NAME

NAME becomes an enabled admin — created if it doesn't exist — with a new random 20-character password, printed once:

NAME is an admin now. New password (shown once, change it after logging in):

    k3Jd9…

The user's existing sessions end. The activity log records it as reset an admin (command line) by (command line). It works while the app is running. Whoever can run this command can read the database anyway, so it adds no new risk.

Check the activity log ​

Admins see Activity (your name → Activity): who did what, when and from which address, newest first, 100 per page, filterable by user and by action group.

The Activity log page with filters and a table of time, user, action, target, details and address
Activity log: logins, tests, schedules, profiles, extension sets, users. Secrets are never logged.
Action (as shown)Logged whenDetails
set up the app (first admin)the first admin is created
logged in / logged out
failed loginwrong password, unknown or disabled userthe reason
changed own password
started a testby hand, Run now, or by a schedule (user (schedule))type and profile, or the schedule
stopped a test / labelled a run / deleted a runthe label
created / changed / deleted a scheduleincluding switching it on or off
created / changed / deleted a PBX profilewhich sections changed (never secret values)
uploaded / deleted an extension setnumber of extensions, profile
added a user / changed a user / set a password / deleted a userrole, name and role changes, enabled/disabled
reset an admin (command line)reset-admin
created / revoked an API tokenby its owner, or revoked by an admin (Revoke tokens)role and expiry; for an admin's revoke, the owner
set the licence key / removed the licence keya licence key entered or removedplan, customer, end date

Anything done with an API token is logged under the token owner's name with [token NAME] after the detail (e.g. registration, profile qa [token gitlab-ci]). Runs started by a user also show by NAME on the run page, and schedules show who created them. The log is kept in the database with no automatic expiry. The same data is available as GET /api/audit?user=&action=&page=&limit= (admin; an action ending in . matches a group, e.g. test.).

Use scripts and the API ​

Scripts and CI jobs use API tokens: create one on your account page, store it in the CI's secret store and send it as Authorization: Bearer pbxs_…. A token isn't affected by the one-session rule, so a script can use the same user as a person without logging them out, and no password is stored in CI. Give each token the smallest role that works (viewer for reading results, operator to start tests). Everything about tokens and a CI example: Automate with the API.

sh
curl -H "Authorization: Bearer $PBXSIGHT_TOKEN" http://127.0.0.1:8080/api/tests

Requests that change something must send JSON (Content-Type: application/json) or multipart; see HTTPS and remote access.

PBXsight — load testing and monitoring for FreeSWITCH PBXes. Only test systems you own or may test.