---
title: "Staff console"
description: "The operator's support console: turning it on, limiting where it is reachable, the three staff roles, and what each can and cannot do to a customer."
---

The staff console is how the people who **run** a TRUSTIVAN deployment act on
the organizations in it: assign a plan, grant an entitlement exception, suspend
an organization or a person, end someone's sessions, and look inside a customer
organization when that customer has consented.

It is a separate identity plane. A staff member is not a user, belongs to no
organization, signs in at a different page with a different cookie, and
resolves to a different kind of principal. No customer credential reaches a
staff route, and no staff credential satisfies a customer route.

| | Customer accounts | Staff accounts |
|---|---|---|
| Sign in at | `/auth/login` | `/staff/login` |
| API prefix | `/api/v1/...` | `/api/v1/staff/...` |
| Session cookie | `trustivan_session` | `trustivan_staff`, scoped to the path `/api/v1/staff`, `SameSite=Strict` |
| Session lifetime | Refreshable | 8 hours absolute, 30 minutes idle |
| Second factor | The organization's policy | Always required |
| Created by | Sign-up, invitation, or `staffctl org create` | `staffctl bootstrap`, then the console |

For what a customer sees of all this, and how they grant or revoke consent,
see [Support access](/security/support-access).

## Off until you create an account

A new deployment has no staff accounts. The routes exist, and nothing can
sign in to them. The console starts existing, in any useful sense, when you
run [`staffctl bootstrap`](/cli-reference/staffctl).

If you operate a single organization for yourself, you may never need it.
You need it when you run TRUSTIVAN for other people: several customer
organizations, plans assigned by contract, and support requests.

## Enable it

<Steps>
  <Step title="Restrict where the console is reachable">
    Do this first. See [the next section](#restrict-where-the-console-is-reachable).
  </Step>

  <Step title="Create the first administrator">
    ```bash
    docker compose -f infra/docker/docker-compose.prod.yml --env-file infra/docker/.env \
      exec api /app/staffctl bootstrap ops@example.com "Operations"
    ```

    The command prints a generated password once. It cannot be recovered
    afterwards, only replaced with `staffctl reset`.
  </Step>

  <Step title="Sign in and enrol a second factor">
    Open `/staff/login` on the dashboard's origin and sign in with the printed
    password. The first sign-in shows a TOTP secret to add to an authenticator
    app, then asks for a code from it. No session is issued until that code
    verifies.
  </Step>

  <Step title="Create the accounts people will actually use">
    As the administrator, create one account per person with the least role
    that does their job, on the **Staff** tab. Each password is generated and
    shown once. Keep at least two `platform_admin` accounts.
  </Step>
</Steps>

## Restrict where the console is reachable

| Variable | Default | Purpose |
|---|---|---|
| `STAFF_ALLOWED_CIDRS` | empty | Comma-separated IP addresses or CIDRs allowed to reach `/api/v1/staff/*`. Empty means nowhere: every request is answered `404` |

```bash
STAFF_ALLOWED_CIDRS=203.0.113.0/24,198.51.100.7
```

The console is **denied by default**. Until `STAFF_ALLOWED_CIDRS` lists at
least one address the staff API refuses every request, sign-in included, and
the API logs that the console is disabled when it starts.

To open the console to every network, set the single value `any`:

```bash
STAFF_ALLOWED_CIDRS=any
```

The API logs a warning at every start while `any` (or a `/0` prefix, which
means the same thing) is set. Use it only where another control already bounds
who can reach the API.

<Warning>
Upgrading from a release where empty meant "anywhere"? If you have a staff
account and never set `STAFF_ALLOWED_CIDRS`, set it **before** you deploy this
release. Otherwise the console answers `404` to your own operators after the
restart.
</Warning>

The restriction covers the **whole** staff API, the sign-in routes included.
A request from any other address is answered `404`, the same as a route that
does not exist, so an outside address learns nothing about whether the console
is there.

Three things to get right:

- **Set `TRUSTED_PROXIES` too.** The address checked is the client address the
  API resolves. Behind a reverse proxy that is the proxy's own address unless
  the proxy is listed in `TRUSTED_PROXIES`, and then every request either
  passes or fails together. See
  [Environment variables](/configuration/environment#rate-limiting-and-webhooks).
- **An invalid entry stops the API from starting.** A value that is neither an
  IP address nor a CIDR is a startup error naming the entry, so a typo cannot
  silently open the console or lock your support team out mid-incident.
- **It filters the API, not the page.** The dashboard still serves the
  `/staff/login` page to anyone who can load the dashboard. What an outside
  address cannot do is submit it.

Empty is the right value for a deployment with no staff accounts. Set it
before you run `bootstrap`, not after.

## Roles

Three roles. Each is a fixed list of capabilities, not a rank.

| Capability | `support_viewer` | `support_engineer` | `platform_admin` |
|---|:--:|:--:|:--:|
| `orgs:read`: search, and read an organization's commercial summary | Yes | Yes | Yes |
| `audit:read`: read the staff audit trail | Yes | Yes | Yes |
| `plan:assign` | | Yes | Yes |
| `entitlements:grant` | | Yes | Yes |
| `accounts:suspend` | | Yes | Yes |
| `sessions:revoke` | | Yes | Yes |
| `support:access`: open a consented read-only session | | Yes | Yes |
| `staff:manage`: list, create, disable and re-role staff accounts | | | Yes |
| `customers:create`: create a customer organization and its first owner | | | Yes |
| `members:invite`: invite somebody into a customer's organization | | | Yes |
| `users:reset-password`: issue a one-time password reset link for a person | | | Yes |
| `keys:read`: list customers' API keys (MCP clients use these too), never a secret | Yes | Yes | Yes |
| `keys:revoke`: revoke a customer's API key | | Yes | Yes |
| `usage:read`: every customer's monthly usage, and its CSV export | Yes | Yes | Yes |
| `users:manage`: reset a person's second factor, change their role in an organization, resend their verification email | | | Yes |
| `settings:manage`: change the announcement and maintenance mode | | | Yes |

`support_viewer` holds only capabilities that read; `platform_admin` holds every
capability. Anything not in a role's list is refused with `403` and recorded as
`staff.denied`.

`GET /api/v1/staff/me` returns the signed-in account's capabilities, and the
console hides what a role cannot do.

## What the console covers

The dashboard's console is four pages: `/staff/login`, the home page at `/staff`, one page per
organization at `/staff/organizations/{id}` and one per person at `/staff/users/{id}`. The home page
opens with the platform overview (organizations, people, live sessions, scans per day, failed and
queued scans, Ask AI tokens this month, and the API's database and cache health), then tabs for
**Customers**, **People**, **Trials**, **API keys**, **Usage**, **Settings**, **Staff** and **Audit
log**, each shown only to a role that can use it. Everything the staff API offers has a screen.

| Action | Where |
|---|---|
| Sign in, enrol the second factor, sign out | `/staff/login`, and the top of every page |
| Search organizations and people | **Organizations** and **People** tabs |
| Read an organization's commercial summary | Its page |
| Assign a plan, run a trial, grant or withdraw an override | Its page |
| Suspend or restore an organization | Its page |
| Open and close a support session | Its page |
| Invite somebody into an organization | Its page |
| Suspend or restore a person, end their sessions, issue a reset link | **People** tab, or the person's page |
| Read a person's account, change their role, reset their second factor, resend verification | The person's page |
| See an organization's products and usage against each limit | Its page |
| List and revoke customers' API keys | **API keys** tab |
| Read and export a month's usage | **Usage** tab |
| Set the announcement and maintenance mode | **Settings** tab |
| Configure mail, Stripe, AI, proxies, KMS and backups | **Platform setup** (platform_admin) |
| List, create, re-role, suspend, reset and reset the second factor of staff accounts | **Staff** tab |
| Read, filter and export the staff audit trail | **Audit log** tab |

## What staff can do

Every action that changes something requires a **reason**. A request without
one is refused with `400`, and the reason is written into the audit trail
beside the action.

### Find a customer

Search organizations or people by name or email. A search returns 25 results
by default and at most 100.

An organization's page shows its **commercial position** and nothing else:
plan, subscription status, trial and renewal dates, seats, asset count,
open-finding count, scans in the last 30 days, failed scans in the last 7,
the time of the last scan, the number of API keys, and any entitlement
overrides in force. It does not show a finding, a secret, a credential, a
policy, or anything a scan read. Viewing the page is itself recorded.

### Add a customer

**Add customer** on the console's home page takes the organization name, the owner's email and
a reason. It creates the organization on Free and the owner's account, and shows the owner's
password once: it is not stored in a readable form and cannot be shown again. An address that
already has an account is refused rather than made the owner of a second organization.

Only a `platform_admin` can do this, because it creates an owner and a credential. The audit
record is written first: if it cannot be written, nothing is created.

The organization's slug comes from its name. NHI Security copies the slug on the owner's first
visit and keeps it.

### Run a trial

A customer's page has a **Trial** card: pick `pro` or `enterprise` and an end date, at most a
year away. The customer has that plan until the end of that day (UTC), and is on Free from then
on, with nothing having to run. Their data stays.

The customer's owners are mailed three days before the end and again in its last 24
hours, once each, if this deployment has mail. A new end date means new notices. Staff
are not mailed: the **Trials** tab is where staff see what is ending.

Changing the date on the same card extends a running trial. **End trial now** moves the customer
to Free. To keep them, assign the plan.

The **Trials** tab on the home page lists every trial, soonest end first. An ended trial stays
listed until somebody assigns a plan, so the decision is not lost. The console sends no
notification when a trial ends.

On a deployment that sells through Stripe, a trial started here is replaced by what the provider
next reports for an organization that has a Stripe subscription, as an assigned plan is.

### Assign a plan

Set an organization to `free`, `pro` or `enterprise`. The subscription becomes
active on that plan immediately. This is how plans are assigned on a deployment
without a payment provider configured, which is the default: see
[Billing provider](/configuration/billing).

On a deployment that sells through Stripe, the provider's webhooks and the
hourly reconciliation write through the same path. For an organization that
also has a Stripe subscription, the provider's next report replaces what you
assigned.

### Grant an entitlement override

An override is a per-organization exception to its plan: one **limit** raised
or lowered, or one **feature** switched on or off, with an optional expiry.
Name exactly one of the two.

| Kind | Keys |
|---|---|
| Limit | `assets`, `scans_per_month`, `scan_frequency_seconds`, `users`, `api_keys`, `webhook_endpoints`, `finding_retention_days`, `audit_retention_days`, `policies`, `scan_concurrency`, `workloads` |
| Feature | `sso`, `scim`, `webhooks`, `api_keys`, `policy_engine`, `scheduled_scans`, `private_registries`, `audit_export`, `suppression`, `nhi_security`, `certificates`, `exposure` |

A key the product does not have is refused with `400`. On the customer's page, **Features** shows
a switch for each feature as it stands for them, and **Entitlement overrides** offers the limits
by name.

**Withdraw** on an override puts the customer back on what their plan gives. Through the API, that
is granting it again with an expiry in the past. Overrides are superseded rather than edited, so
the table reads as a history of what was granted and when it stopped. There is no customer-facing
route that grants one.
See [Billing and plans](/concepts/billing-and-plans) for what each limit and
feature means.

### Invite somebody into an organization

**Invite someone** on a customer's page takes an email address, a role and a reason. It offers
`admin`, `member` or `viewer`, because no invitation can confer `owner`. It uses a seat like any other
invitation, and an address that is already a member is refused. The link is shown once, with wording to
send alongside it, and is mailed as well if this deployment can send mail. The customer sees the
invitation in their member list and in their audit log, with the reason.

A staff member never becomes a member of the organization. The invitation is issued on the authority of
its longest-serving owner, so it stops working if that person stops being able to grant the role.

### Suspend an organization

Suspension refuses every way into the organization at once: member sessions,
API keys and workload credentials all stop authenticating. Nothing is deleted,
and restoring the organization brings everything back as it was.

### Reset a person's password

**Reset password** on the **People** tab gives a one-time link that lasts 24 hours and is also mailed if
this deployment can send mail. Whoever opens it chooses the new password, so nobody at your company learns
it, and any second factor on the account still applies. Using it ends every session the account has. It
is refused for a suspended or deleted account, and for one whose organization requires single sign-on.
Only a `platform_admin` can do this, and it appears in the customer's audit log with the reason.

### Suspend a person or end their sessions

Suspending a person disables their account in every organization they belong
to and revokes their sessions immediately. Ending their sessions without
suspending them is the separate "they lost their laptop" action: they sign in
again normally. Both are on the **People** tab.

### Change a person's role or reset their second factor

On a person's page a `platform_admin` can change their role in any organization
they belong to, to admin, member or viewer. Owner is never offered and an owner's
role cannot be changed: ownership moves only between the customer's own people.
**Reset two-factor** removes their authenticator and recovery codes and signs
them out everywhere; they enrol again at their next sign-in, or are made to if
their organization requires a second factor. Confirm who is asking before you do
it: the reason field is where you say how. **Resend verification** mails a fresh
link to the person; you never see it. Each lands in the customer's audit log.

### Revoke an API key

The **API keys** tab lists every customer's keys by prefix, name, creator and
last use, searchable by any of them or by organization name. It never shows a
secret or a hash: nobody holds the secret after the key is created. **Revoke**
takes a reason and stops the key on its next request, CI jobs and MCP clients
included. The request names the key's organization and runs inside it, so a key
from another customer matches nothing. A revoke goes ahead even if the staff
trail cannot be written, like a suspension.

A key's scopes are also capped by its creator's current role: demote the person
who made it and their keys lose what the new role does not include.

### Read usage

The **Usage** tab shows, for one calendar month (UTC), each customer's scans
started, findings first seen, Ask AI tokens and seats now. **Export CSV**
downloads the same rows, with any cell a spreadsheet would run as a formula
prefixed with an apostrophe. Ask AI tokens are kept for the current month only:
an earlier month shows "Not kept", and the CSV leaves the cell empty.

`ASSISTANT_MONTHLY_TOKENS` is the per-organization monthly budget. `0` turns Ask
AI off for every organization; `-1` is no limit.

### Announcement and maintenance mode

The **Settings** tab holds the announcement and maintenance mode. They are
fixed, typed fields, so no secret can be stored there. Deployment settings
that include secrets (mail relay, Stripe, the Anthropic key, backups) are on
the separate [platform setup](/deployment/platform-setup) page, platform admins
only:

- **Announcement**, up to 500 characters, as information or a warning, shown at
  the top of every customer page and the console.
- **Maintenance mode.** Every customer write (`POST`, `PUT`, `PATCH`, `DELETE`)
  is refused with `503`, code `unavailable`, `Retry-After: 300` and your
  maintenance message. Reads, sign-in and sign-out, and this console keep
  working. Pipelines that start scans fail while it is on.

Saving needs `settings:manage` and a reason. Each API replica picks a change up
within 10 seconds. `GET /api/v1/platform/notice` returns both, without signing
in, for anything that wants to show the banner.

### Open a support session

A support session is a read-only view inside one customer organization:
its members and their roles, its assets, and the status of its scans, including
a failed scan's error. It shows no finding content and no secret.

It needs the customer's consent. An owner of the organization grants a
time-boxed window, from 1 to 168 hours, in their own settings. Only then can a
`support_engineer` or `platform_admin` open a session, naming a reason. The
session:

- ends after 60 minutes or when the customer's window closes, whichever is
  first;
- is checked against the live consent on every request, so revoking consent
  ends it on the next one;
- reads inside a `READ ONLY` database transaction, so the database refuses a
  write rather than the application remembering not to make one.

An attempt with no consent in place is refused with `403` and recorded.

### Manage staff accounts

A `platform_admin` adds accounts, changes their role, suspends or restores them and resets their
passwords on the **Staff** tab. Through the API:

| Request | Body |
|---|---|
| `POST /api/v1/staff/accounts` | `email`, `name`, `role`. Answers `201` with the new account and its generated `password`, shown this once |
| `PUT /api/v1/staff/accounts/{id}/role` | `role`, `reason` |
| `PUT /api/v1/staff/accounts/{id}/suspension` | `suspended` (`true` or `false`), `reason` |
| `POST /api/v1/staff/accounts/{id}/password` | `reason`. Answers with a new generated `password`, shown this once |
| `POST /api/v1/staff/accounts/{id}/mfa-reset` | `reason`. Clears the second factor; the next sign-in enrols a new one before any session exists |

`role` is one of `support_viewer`, `support_engineer` or `platform_admin`. Nobody chooses a staff
password. Changing a role, suspending an account or resetting its password ends that account's
sessions, so the change applies to the next request. A password reset leaves the second factor as it
is. Each of these is written to the staff trail.

**A second `platform_admin`.** Add one on the **Staff** tab with the role Platform admin. Give them
the generated password over a channel you would use for any credential; they sign in at
`/staff/login` from an allowed address and enrol their authenticator before their first session
exists.

You cannot do any of these to your own account, so the last `platform_admin` cannot lock everybody
out. Keep at least two: another admin can reset a lost password or second factor in the console.
With only one, a lost password needs `staffctl reset` on the host, and a lost second factor a change
to the database.

## Sign-in rules

| Rule | Value |
|---|---|
| Password | At least 16 characters and at most 72 bytes, with an upper-case letter, a lower-case letter, a digit and a symbol |
| Second factor | TOTP, enrolled during the first sign-in. Required for every account |
| Sign-in challenge | Valid for 5 minutes and 5 code attempts |
| Lockout | After 5 consecutive failures on one account: 5 minutes, doubling with each further failure, capped at 60 minutes |
| Session | 8 hours from sign-in, or 30 minutes without a request, whichever is first. The sign-in page then says the session ended |
| Password recovery | `staffctl reset` on the host. There is no self-service reset |
| Lost authenticator | Another `platform_admin` resets the account's second factor; the next sign-in enrols a new one |

What the sign-in page says when it refuses:

| Message | Cause |
|---|---|
| "This network cannot reach the support console" | The API answered `404`: your address is not in `STAFF_ALLOWED_CIDRS`, or the API sees the proxy because `TRUSTED_PROXIES` is unset |
| "Those credentials were not accepted" | A wrong password, unknown address, disabled or locked account: deliberately one message |
| "That code was not accepted" | A wrong or reused code. After five, or five minutes, choose **Start again** |
| "Too many attempts from this address" | The per-address sign-in limiter |

The lockout is per **account**. The per-address limiter that covers every
sign-in endpoint applies as well.

## The two audit trails

Every staff action is recorded twice.

**The staff trail** is the deployment's own record, readable by any role
through `GET /api/v1/staff/audit` with the query parameters `staff_id`,
`organization_id`, `user_id`, `action`, `since`, `until` (RFC 3339 or `YYYY-MM-DD`, `until`
exclusive), `limit` and `offset`, and as CSV through `GET /api/v1/staff/audit/export` with the
same filters (at most 10,000 rows; the `X-Truncated` header says when more matched). An export is
itself recorded.

**Reads are recorded too.** Opening an organization, a person, the API key list
or the usage is written to the staff trail before the answer is returned, and
refused with `503` (`audit_unavailable`) if it cannot be. Actions that grant
something are refused the same way; actions that take access away (suspend,
sign out, revoke a key) go ahead. It is append-only, enforced by a database trigger
that binds the schema owner as well, and each entry carries the hash of the
one before it. To check the chain, as the schema owner:

```sql
SELECT * FROM verify_staff_audit_chain();
```

It returns `ok`, the number of rows checked, and the sequence number of the
first broken row if there is one.

**The customer's trail** receives a copy of every action taken against their
organization, attributed to an actor of kind `staff`. A customer can see what
your staff did without asking you. Deleting an organization does not remove the
staff trail's record of what was done to it.

## What the console does not do

- **No impersonation.** Staff cannot act as a customer's user, and cannot
  write anything inside an organization. A change a customer needs is made by
  the customer.
- **No finding or secret content**, with or without consent.
- **No staff single sign-on and no staff API key.** Every staff action is a
  person's, behind a password, a second factor and a session that expires.
- **No secrets in settings.** Runtime settings are an announcement and
  maintenance mode. Keys, provider credentials and mail settings stay in the
  deployment's environment.
- **No notification when a trial ends.** The Trials tab is the prompt.

## API surface

The console is a client of these routes. All are under `/api/v1/staff`, all
except the two sign-in routes need a staff session, and each is in the
[API reference](/api-reference/overview).

| Method and path | Capability | Purpose |
|---|---|---|
| `POST /login`, `POST /login/mfa` | none | Sign in, then complete the second factor |
| `POST /logout`, `GET /me` | a session | End the session; read the account and its capabilities |
| `POST /customers` | `customers:create` | Create a customer and its first owner |
| `GET /organizations`, `GET /organizations/{id}` | `orgs:read` | Search; read a commercial summary, with every feature and limit as they stand |
| `GET /trials` | `orgs:read` | List customers on a trial |
| `PUT /organizations/{id}/plan` | `plan:assign` | Assign a plan |
| `PUT /organizations/{id}/trial` | `plan:assign` | Start a trial, or move its end |
| `POST /organizations/{id}/entitlements` | `entitlements:grant` | Grant or withdraw an override |
| `PUT /organizations/{id}/suspension` | `accounts:suspend` | Suspend or restore an organization |
| `GET /users` | `orgs:read` | Search people |
| `PUT /users/{id}/suspension` | `accounts:suspend` | Suspend or restore a person |
| `POST /users/{id}/logout-all` | `sessions:revoke` | End a person's sessions |
| `POST /support-sessions` | `support:access` | Open a consented session |
| `GET /support-sessions/current`, `DELETE /support-sessions/current` | an open session | Read inside it; close it |
| `GET /audit` | `audit:read` | Read the staff trail |
| `GET /accounts`, `POST /accounts` | `staff:manage` | List and create staff accounts |
| `PUT /accounts/{id}/role`, `PUT /accounts/{id}/suspension` | `staff:manage` | Re-role; disable or restore |
| `POST /accounts/{id}/mfa-reset` | `staff:manage` | Reset a staff account's second factor |
| `GET /overview` | `orgs:read` | Customer counts, platform activity and the API's health |
| `GET /users/{id}` | `orgs:read` | A person's account and memberships |
| `POST /users/{id}/mfa-reset`, `POST /users/{id}/verification` | `users:manage` | Reset a person's second factor; resend verification |
| `PUT /users/{id}/memberships/{org}/role` | `users:manage` | Change a person's role in one organization |
| `GET /api-keys` | `keys:read` | Search customers' API keys |
| `POST /organizations/{id}/api-keys/{key}/revoke` | `keys:revoke` | Revoke one |
| `GET /usage`, `GET /usage/export` | `usage:read` | A month's usage; as CSV |
| `GET /settings`, `PUT /settings` | `orgs:read`; `settings:manage` | Read; change the announcement and maintenance mode |
| `GET /audit/export` | `audit:read` | The staff trail as CSV |

`GET /api/v1/platform/notice` is outside the staff group and needs no session.

## Related

- [`staffctl`](/cli-reference/staffctl): the host command behind steps 2 and
  password recovery.
- [Support access](/security/support-access): the customer's view of consent
  and the audit trail.
- [Sign-up and sign-in](/configuration/sign-up-and-sign-in): closing open
  sign-up, which is when `staffctl org create` becomes necessary.
