Trust credentials

Last validated:

Trust credentials provide a framework for delegated and scoped access to the Tailscale API. A trust credential creates access tokens for scoped API access, instead of using a fully-permitted access token which expires after 90 days (or less if the fully-permitted access token has a shorter expiry).

Trust credentials support the principle of least privilege by allowing fine-grained control on the access granted to the credential using scopes, unlike a fully-permitted access token which grants full access to the Tailscale API.

Trust credentials come in two forms: OAuth clients and federated OIDC workload identities (or federated identities for short).

Differences between OAuth clients and federated identities

OAuth clients and federated identities have a number of differences in the way they are used and additional setup required in external systems. The table below highlights these differences and may be helpful for determining which option is correct for your use case.

OAuth clientsFederated identities
Secure usage

OAuth clients require using a long-lived client secret for generating Tailscale access tokens. This long-lived secret must be stored securely, as it can be used to generate access tokens indefinitely until it is revoked.

Federated identities do not require storing long-lived secret material. They instead require an established trust relationship with a third-party system, and a short-lived identity token generated by this system, to create Tailscale access tokens.

Required setup

OAuth clients require no additional setup or external integrations to generate credentials. Only the client ID and client secret which are generated when creating the OAuth client are required for generating Tailscale access tokens.

Federated identities require setting up a trust relationship between Tailscale and a third-party system that is capable of generating OIDC-compliant JWT identity tokens to exchange for Tailscale access tokens. Not all scenarios where you might want to access the Tailscale API with granularly scoped access tokens may support generating these JWT identity tokens for workload identity federation.

Information common to both forms of trust credentials is shared below.

Scopes

Our scopes have changed to have more granular permissions associated with each scope. The previous set of scopes can be found in the legacy scopes section.

Scopes define which operations are permitted in API access tokens that are created by your trust credentials.

In addition to the endpoints listed below, all scopes allow access to GET /api/v2/tailnet/:tailnet/keys/:keyID for the key in use.

You can use the following scopes in Tailscale trust credentials:

Scope IDDescriptionAllowed endpoints
all:readThe credential has read-only access to the tailnet. This scope is not restricted to only read access of APIs that existed at the time the credential was initially authorized—the all:read scope also grants read access to new APIs created in the future. The all and all:read scopes are the only scopes which can get a list of all access tokens which exist in the tailnet.
  • All *:read endpoints, even endpoints which did not exist when the credential was initially authorized.
  • GET /api/v2/tailnet/:tailnet/keys/:keyID (for any key, not just itself)
allThe credential has complete access to the tailnet. This scope is not restricted to only access of APIs that existed at the time the credential was initially authorized—the all scope also grants access to new APIs created in the future. The all and all:read scopes are the only scopes which can get a list of all access tokens which exist in the tailnet.
  • All endpoints, even endpoints which did not exist when the credential was initially authorized.
  • GET, DELETE /api/v2/tailnet/:tailnet/keys/:keyID (for any key, not just itself)
dns:readThe credential has access to read DNS settings.
  • GET /api/v2/tailnet/:tailnet/dns/nameservers
  • GET /api/v2/tailnet/:tailnet/dns/preferences
  • GET /api/v2/tailnet/:tailnet/dns/searchpaths
  • GET /api/v2/tailnet/:tailnet/dns/split-dns
dnsThe credential has access to read and manipulate DNS settings.
  • Endpoints from dns:read

  • POST /api/v2/tailnet/:tailnet/dns/nameservers
  • POST /api/v2/tailnet/:tailnet/dns/preferences
  • POST /api/v2/tailnet/:tailnet/dns/searchpaths
  • PATCH, PUT /api/v2/tailnet/:tailnet/dns/split-dns
policy_file:read

The credential has access to read and validate the tailnet policy file. devices:posture_attributes:read and devices:core:read are required when using this scope.

  • GET /api/v2/tailnet/:tailnet/acl
  • POST /api/v2/tailnet/:tailnet/acl/preview
  • POST /api/v2/tailnet/:tailnet/acl/validate
policy_file

The credential has access to read, validate, and modify the tailnet policy file. devices:posture_attributes and devices:core:read are required when using this scope.

  • Endpoints from policy_file:read

  • POST /api/v2/tailnet/:tailnet/acl
users:readThe credential has access to read user information.
  • GET /api/v2/tailnet/:tailnet/users
  • GET /api/v2/user/:userID
usersThe credential has access to read user information, modify user roles, and handle user approval, suspension, deletion, and restoration.
  • Endpoints from user:read

  • POST /api/v2/user/:userID/role
  • POST /api/v2/user/:userID/approve
  • POST /api/v2/user/:userID/suspend
  • POST /api/v2/user/:userID/restore
  • POST /api/v2/user/:userID/delete
devices:core:readThe credential has access to read devices in the tailnet.
  • GET /api/v2/tailnet/:tailnet/devices
  • GET /api/v2/device/:deviceID
devices:core

The credential has access to read the list of all devices in the tailnet, authorize or remove machines, and manipulate tags on devices. You must select one or more tags when you create a credential with the devices:core scope. Auth keys created with this credential must have those exact tags, or tags owned by the credential's tags

  • Endpoints from devices:core:read

  • DELETE /api/v2/device/:deviceID
  • POST /api/v2/device/:deviceID/authorized
  • POST /api/v2/device/:deviceID/expire
  • POST /api/v2/device/:deviceID/ip
  • POST /api/v2/device/:deviceID/name
  • POST /api/v2/device/:deviceID/key
  • POST /api/v2/device/:deviceID/tags
devices:posture_attributes:readThe credential has access to read device posture attributes.
  • GET /api/v2/device/:deviceID/attributes
  • GET /api/v2/device/:deviceID/attributes/:attributeKey
devices:posture_attributes

The credential has access to manipulate and read device posture attributes.

  • Endpoints from devices:posture_attributes:read

  • POST, DELETE /api/v2/device/:deviceID/attributes
  • POST, DELETE /api/v2/device/:deviceID/attributes/:attributeKey
devices:routes:readThe credential has access to read subnet router settings and exit node settings.
  • GET /api/v2/device/:deviceID/routes
devices:routesThe credential has access to read or modify subnet router settings, approve and revoke subnet routes, and approve and revoke exit nodes.
  • Endpoints from devices:routes:read

  • POST /api/v2/device/:deviceID/routes
devices_invites:readThe credential has access to read device invites.
  • GET /api/v2/device/:deviceID/device-invites
  • GET /api/v2/device-invites/:deviceInviteID
devices_invitesThe credential has access to read or modify device invites.
  • Endpoints from device_invites:read

  • GET /api/v2/device/:deviceID/device-invites
  • GET, DELETE /api/v2/device-invites/:deviceInviteID
api_access_tokens:readThe credential has access to read API access tokens.
  • GET /api/v2/tailnet/:tailnet/keys (for API access tokens)

  • GET /api/v2/tailnet/:tailnet/keys/:keyID (for API access tokens)

api_access_tokensThe credential has access to read or modify API access tokens.
  • Endpoints from api_access_tokens:read

  • DELETE /api/v2/tailnet/:tailnet/keys/:keyID (for API access tokens)

auth_keys:readThe credential has access to read auth keys.
  • GET /api/v2/tailnet/:tailnet/keys (for auth keys)

  • GET /api/v2/tailnet/:tailnet/keys/:keyID (for auth keys)

auth_keysThe credential has access to read or modify auth keys.
  • Endpoints from auth_keys:read

  • POST /api/v2/tailnet/:tailnet/keys (for auth keys)

  • DELETE /api/v2/tailnet/:tailnet/keys/:keyID (for auth keys)

oauth_keys:readThe credential has access to read OAuth credentials and keys.
  • GET /api/v2/tailnet/:tailnet/keys/:keyID (only OAuth credentials and OAuth keys)

oauth_keysThe credential has access to read or modify OAuth credentials and keys.
  • Endpoints from oauth_keys:read

  • DELETE /api/v2/tailnet/:tailnet/keys/:keyID (for OAuth credentials and OAuth keys)

federated_keys:readThe credential has access to read federated identities and keys generated by federated identities.
  • GET /api/v2/tailnet/:tailnet/keys/:keyID (only federated identities and keys generated by federated identities)

federated_keysThe credential has access to read or modify federated identities and keys generated by federated identities.
  • Endpoints from federated_keys:read

  • DELETE /api/v2/tailnet/:tailnet/keys/:keyID (only federated identities and keys generated by federated identities)

webhooks:readThe credential has access to read webhooks.
  • GET /api/v2/tailnet/:tailnet/webhooks
  • GET /api/v2/webhooks/:endpointID
webhooksThe credential has access to read, modify, and test webhooks and to rotate webhook secrets.
  • Endpoints from webhooks:read

  • POST /api/v2/tailnet/:tailnet/webhooks
  • PATCH, DELETE /api/v2/webhooks/:endpointID
  • POST /api/v2/webhooks/:endpointID/test
  • POST /api/v2/webhooks/:endpointID/rotate
log_streaming:readThe credential has access to read log streaming configurations and their status.
  • GET /api/v2/tailnet/:tailnet/logging/:logType/stream
  • GET /api/v2/tailnet/:tailnet/logging/:logType/status
log_streaming

The credential has access to read or modify log streaming configurations and check their status. device_invites and policy_file are required when configuring log streaming to a private endpoint.

  • Endpoints from logstreaming:read

  • PUT, DELETE /api/v2/tailnet/:tailnet/logging/:logType/stream
logs:configuration:readThe credential has access to read configuration audit logs.
  • GET /api/v2/tailnet/:tailnet/logging/configuration
logs:network:readThe credential has access to read network flow logs.
  • GET /api/v2/tailnet/:tailnet/logging/network
  • GET /api/v2/tailnet/:tailnet/settings
logs:networkThe credential has access to read network flow logs and modify their settings.
  • Endpoints from logs:network:read

  • PATCH /api/v2/tailnet/:tailnet/settings (for network logging only)

account_settings:readThe credential has access to read tailnet contacts.
  • GET /api/v2/tailnet/:tailnet/contacts
account_settingsThe credential has access to read or modify tailnet contacts, and to resend verification emails.
  • Endpoints from account_settings:read

  • PATCH /api/v2/tailnet/:tailnet/contacts/:contactType
  • POST /api/v2/tailnet/:tailnet/contacts/:contactType/resend-verification-email