Torii user guide — contents

Docs · Torii

Organisations and roles

An organisation is the boundary around your data. A role decides what a person or a token may do inside it. They are two separate mechanisms, and the first one does not depend on the second.

Organisations

Everything in Torii belongs to exactly one organisation: every repository, host, cloud account, domain, token, finding and audit entry. An organisation has a name, a short slug, a plan, and the limits that come with the plan.

FieldMeaning
Name and slugHow the organisation is shown and addressed.
PlanThe plan the organisation is on.
Repository limitHow many repositories the plan allows. Not enforced yet.
Host limitHow many hosts the plan allows. Not enforced yet.
Seat limitHow many people the plan allows as members. Not enforced yet.
RetentionHow many days findings are meant to be kept. Nothing deletes findings on this schedule yet.

You can see these in the console under Settings, in the Organisation card, or read them from the API:

Read your organisation
curl -sS "$TORII_CONTROL_PLANE_URL/v1/organisation" \
  -H "Authorization: Bearer $TORII_API_TOKEN"

How organisations are kept apart

Separation is enforced by the database, not by the application. Every table that holds customer data carries a Postgres row-level security policy, and every request runs inside a transaction pinned to one organisation. The queries that read your assets carry no organisation filter of their own. A query that forgot one would return nothing, because the database has already decided which rows exist for that request.

Two consequences are visible from the outside:

  • Asking for something that belongs to another organisation gets the same 404 as asking for something that never existed. The response gives no hint which it was.
  • The service refuses to start if the database role it connects with would be able to bypass those policies.

A test harness exercises every API route with one organisation's credentials against another organisation's data, and runs on every change. A route that has no such test fails the build.

One organisation per sign-in

A person can belong to more than one organisation, but a signed-in session belongs to exactly one. When you sign in, Torii uses the organisation you joined first. The console at torii.minatolabs.com serves a single organisation, and a session for any other organisation is refused there. The console shows what that refusal looks like.

Roles

There are five roles. Each one is a fixed bundle of permissions, and every API route names the permission it needs.

RoleAPI valueIntended for
OwnerownerBilling, deletion and ownership.
AdminadminEverything except changing billing and deleting the organisation.
SecuritysecurityTriage, dismissal and policy. The role that runs the product day to day.
DeveloperdeveloperSees findings, may dismiss them on their own repositories, cannot change policy.
Read-onlyreadonlyReads. Nothing else.

What each role may do

OwnerAdminSecurityDeveloperRead-only
See assetsyesyesyesyesyes
Add assets and enrol hostsyesyesyes——
Remove assetsyesyes———
See findingsyesyesyesyesyes
Dismiss any findingyesyesyes——
Dismiss findings on their own repositories———yes—
See policyyesyesyesyesyes
Change policyyesyesyes——
See scansyesyesyesyesyes
Start a scanyesyesyesyes—
See membersyesyesyesyesyes
Invite, change role, remove membersyesyes———
Create API tokens and enrolment tokensyesyesyesyes—
Revoke tokensyesyesyes——
List every token in the organisationyesyes———
Read the audit logyesyesyes——
Exportyesyesyesyesyes
See billingyesyes———
Change billingyes————
Delete the organisationyes————

The roles are not a strict ladder. Security may change policy and Developer may not, while Developer has a dismissal permission that Security does not need. That is why Torii compares permissions, not role names, when it decides whether one role may act for another.

When a role is not enough

A request your role does not allow is answered with 403 and the name of the missing permission, and the refusal is written to the audit log:

A refused request
{ "error": "forbidden", "required": "AssetsDelete" }

This is different from the 404 above on purpose. You are a member of this organisation and already know the route exists, so Torii tells you what is missing. It never tells you anything about an organisation you do not belong to.

Your role in the console

The console talks to the API with a credential of its own and passes your signed-in session along with every request. The API then allows only what both your role and the console's credential allow. It can narrow what you may do, never widen it: a read-only member stays read-only in the console, and nobody can do through the console what the console's credential cannot. Actions you take in the console are recorded in the audit log as yours.

The console also hides some controls your role cannot use, such as Create token for a read-only member. Others are shown to everyone and refused when you use them; the message says your role does not allow it.

Your role is read from your membership on every request, so if minatolabs changes it, the API applies the change straight away and the console within about 30 seconds. You do not need to sign in again.

Plans and limits

Plans are designed to price scale and never visibility. The part of Torii that checks plan limits knows four things it can count: repositories, hosts, cloud accounts and seats. It has no limit for findings, at any plan, so a plan can never hide one of your own findings from you.

Workspaces

An organisation can contain workspaces, and an API token may be tied to one. The API lists them at /v1/workspaces and can remove one. There is no way to create a workspace, so for now treat the organisation as the only boundary.