Docs · Torii
Adding assets
An asset is something Torii watches for you. There are five kinds, and each has its own way of proving that it is yours to connect.
| Asset | How you add it | What proves it is yours |
|---|---|---|
| Repository | Settings, Sources, Connect GitHub | You install the Torii app on your code host and pick repositories. |
| Host | Settings, Hosts, Add host | A single-use enrolment token, redeemed with one of your API tokens. |
| Cloud account | Settings, Cloud accounts, Connect account | A role in your account that trusts Torii and an external id Torii issued to you. |
| Domain | Settings, Verified domains, Add domain | A DNS record that only the owner of the domain can publish. |
| Hostname | Cannot be added yet | It will sit under a verified domain. |
Adding an asset needs the owner, admin or security role. Removing one needs owner or admin. Every role can see them. Organisations and roles has the full table. The console shows the add buttons to everyone; if your role does not allow the change, it is refused when you submit.
Repositories
- Open Settings and find the Sources card.
- Choose Connect GitHub. The dialog explains the three steps; choose Continue to GitHub to install the Torii app on your organisation there.
- Back in Torii, the installation is listed in the Sources card. Choose Manage repositories on its row. A side panel lists every repository the app can see, each with a checkbox. Selection starts at none.
- Tick a repository to add it. The console confirms with Repository added — first scan queued. You do not start the first scan by hand.
- Untick a repository to stop. The console confirms with Repository removed.
The app has read-only access to the repositories you select. Torii does not use a personal access token of yours, and the short-lived tokens the app works with are created on the server and never reach your browser. Connected repositories are listed under Supply chain.
The Repositories column in the Sources card shows Scanning once at least one repository is selected, None selected otherwise, and Suspended or Removed if the app was suspended or uninstalled on GitHub. On a suspended or removed installation you can still stop scanning a repository, but new selections are refused until the app is reconnected.
Hosts
A host is added by installing the agent on it and enrolling it. That has its own page: Enrolling a host.
Enrolled hosts are listed in Settings under Hosts and in the Runtime view, and through the API:
curl -sS "$TORII_CONTROL_PLANE_URL/v1/hosts" \ -H "Authorization: Bearer $TORII_API_TOKEN"
Cloud accounts
Torii connects to a cloud account by assuming a role that you create in your own account. It never receives or stores a long-lived credential of yours: no access key, no client secret, no service account key file. The table that records the connection has no column that could hold one.
- Open Settings, find Cloud accounts and choose Connect account.
- Pick the Provider and fill in the two or three identifiers it asks for, then choose Connect account.
- The connection is shown as Pending trust, with an External ID — shown once and the trust policy to apply. Copy the external id now.
- In your own cloud console, create the role with that trust policy and the read-only permissions.
| Provider | Account identifier | Role identifier | Also asked for |
|---|---|---|---|
| AWS | AWS account ID, 12 digits | Role ARN | Nothing |
| Azure | Subscription ID | Service principal object ID | Directory (tenant) ID, required |
| Google Cloud | Project ID | Service account email | Organisation ID, optional |
| Oracle Cloud | Tenancy OCID | Group OCID | Compartment OCID, optional |
Connecting the same account twice is refused with That is already connected to your organisation.
Why Torii chooses the external id
Torii is trusted by many customers through one identity of its own. Your role name and account number are not secrets. Without a second condition, another Torii customer who learned them could ask Torii to scan your account and be shown the result. The external id is that second condition: your trust policy accepts Torii only when it presents the value issued to you. If customers could choose their own value, an attacker would simply choose yours, so Torii generates it and the API has no field for supplying one.
If you lose the external id, rotate it through the API and update your trust policy. Rotating sets the connection back to pending trust. Torii will not display the old one again, and it is not written to the audit log. There is no rotate button in the console.
curl -sS -X POST "$TORII_CONTROL_PLANE_URL/v1/cloud-accounts/$ACCOUNT_ID/external-id/rotate" \ -H "Authorization: Bearer $TORII_API_TOKEN"
What the role lets Torii read
Configuration and metadata: which resources exist, how they are set up and who can reach them. The default permissions exclude anything that returns the contents of something, such as the value of a secret. You can remove the access at any time by deleting the role in your own console, without asking Torii.
Each connected account has a scan schedule: weekly (the default), daily or off. It is read and changed through the API, at /v1/cloud-accounts/ followed by the account id and /schedule; changing it needs a role that may change policy.
Domains
Before Torii scans anything from the outside, you have to prove you own the domain. Without that step the product would be a reconnaissance service that anyone could point at anyone.
- Open Settings, find Verified domains and choose Add domain.
- Enter a registrable domain such as
example.com. Not a URL and not a wildcard. Choose Add domain. - Torii shows a DNS record to create with your DNS provider: a
TXTrecord named_torii-challenge.example.comwith a value Torii generated.
The value is a public challenge, not a credential. It is meant to be published, and the API returns it again whenever you list your domains.
Hostnames
A hostname is a single public name, such as app.example.com, that Torii would check from the outside once its domain is verified. The API can list and remove hostnames at /v1/hostnames. There is no way to add one yet, in the console or the API.
Removing an asset
Owners and admins can remove a repository, host, cloud account, hostname or domain through the API. Each path in the table below answers GET for the list, GET with an id for one item, and DELETE with an id to remove it. In the console you can deselect a repository from a connection; there are no remove buttons for the other kinds yet.
curl -sS -X DELETE "$TORII_CONTROL_PLANE_URL/v1/hosts/$HOST_ID" \ -H "Authorization: Bearer $TORII_API_TOKEN"
| Asset | API path |
|---|---|
| Repositories | /v1/repositories |
| Hosts | /v1/hosts |
| Cloud accounts | /v1/cloud-accounts |
| Domains | /v1/domains |
| Hostnames | /v1/hostnames |