---
title: "Control who can do what, from where"
sidebarTitle: "Roles, networks and sessions"
description: "Narrow members with custom roles, restrict the organization to your networks with an IP allow-list, and see and end every member's sessions."
keywords: ["custom roles", "permissions", "RBAC", "IP allow-list", "IP allowlist", "sessions", "sign out", "revoke session"]
---

Three controls an administrator uses together: **custom roles** decide what a
member may do, the **IP allow-list** decides where requests may come from, and
**session administration** ends sign-ins that should not be live.

## Custom roles

Every member has a built-in role: viewer, member, admin or owner. A **custom
role** is a named set of the organization's existing permissions, laid over
that built-in role. It only narrows: the member may do what **both** the
built-in role and the custom role allow. An Auditor role holding
`findings:read` and `assets:read`, laid over Admin, gives an administrator who
can read findings and assets and do nothing else.

<Steps>
  <Step title="Define the role">
    **Settings → Members → Custom roles → New role**. Pick a name and the
    permissions. Or `POST /api/v1/members/roles` with
    `{"name": "Auditor", "permissions": ["findings:read", "assets:read"]}`.
  </Step>
  <Step title="Assign it">
    In the same card, choose the role for a member. Or
    `PUT /api/v1/members/{userId}/custom-role` with `{"custom_role_id": "…"}`;
    `null` clears it. It applies on the member's next request.
  </Step>
</Steps>

The rules, all enforced by the server:

- A custom role cannot list `apikeys:manage`, `workloads:manage`,
  `members:manage`, `identity:manage` or `organization:delete`. Each of these
  creates or re-wires another principal, which would let a narrowed member mint
  authority bounded only by their built-in role.
- An owner is never narrowed, and you cannot narrow yourself or a member at or
  above your own rank.
- A role listing a permission the member's built-in role lacks is refused
  rather than silently ignored.
- A role in use cannot be deleted: dropping it would widen its members back to
  their whole built-in role. Reassign them first.
- `GET /api/v1/me/context` returns `permissions`, the session's effective set,
  the same answer every check gives.

Defining and assigning custom roles needs `members:manage` (admin and above),
which no custom role can carry.

## IP allow-list

**Settings → Identity → IP allow-list** (owner only). When the list has
entries, every authenticated request in the organization must come from one of
them: browser sessions, API keys and workloads alike. Anything else gets `403`
with code `ip_not_allowed`. An empty list means no restriction, the default.

- Entries are addresses or CIDR networks, IPv4 or IPv6, at most 100.
- A list that does not include the address you are saving it from is refused
  with `409`, so you cannot lock the organization out.
- A member refused by one organization's list can still list their
  organizations and switch to another one.
- The address is the client address as the API sees it. Behind a load balancer
  set `TRUSTED_PROXIES`, or every request appears to come from the balancer
  ([environment](/configuration/environment)).
- Another API replica applies a change within 30 seconds.
- The TRUSTIVAN support console is not subject to the list. Each support
  session opened while a list is in force is recorded in your audit trail as
  `ip_allowlist.staff_bypass`, with the address it came from, and needs your
  [support access grant](/security/support-access) in the first place.

Over the API: `GET` and `PUT /api/v1/settings/ip-allowlist`.

## Sessions

**Settings → Security → Where you are signed in** lists every sign-in of your
own: device, address, how you signed in, and when it was last renewed. **End**
stops one renewing; the access token it already holds lapses within 15 minutes.
Ending one session does not end the others.

Administrators see every member's sessions under **Settings → Members → Member
sessions**:

- **End** ends one sign-in.
- **End all** signs the member out everywhere at once: their refresh tokens are
  revoked and their access tokens stop working on the next request. A member of
  several organizations is signed out of all of them, because a session belongs
  to a person, not to an organization.

You can end the sessions of members below your own role. Every ending is
recorded in the audit trail (`session.revoked`, `session.revoked_all`).

Over the API: `GET /api/v1/auth/sessions`, `DELETE /api/v1/auth/sessions/{id}`;
`GET /api/v1/members/sessions`, `DELETE /api/v1/members/{userId}/sessions` and
`DELETE /api/v1/members/{userId}/sessions/{id}`.

## Related

- [Set up multi-factor authentication](/how-to/set-up-multi-factor-authentication), including passkeys.
- [Manage your account](/how-to/manage-your-account)
- [Envelope encryption and KMS](/deployment/envelope-encryption)
