Permissions

In Telegraf Controller, a permission string describes what a user or an API token may do. A permission string consists of a list of resources and the actions allowed on each. Every user role has a fixed permission string, and every API token stores its own.

You work with permission strings in the following places:

  • The Permissions card on the Create API Token page builds one from the boxes you check. See Create an API token.
  • The permissions field of POST /api/tokens accepts one, and the token endpoints return one for each token. See API.
  • The token detail page shows a token’s permissions as a read-only grid.
  • The OpenAPI document describes the same rules on the permissions field and publishes the resource and action vocabulary as the PermissionResource and PermissionAction schemas, so generated clients can check permission strings before sending them.

Syntax

A permission string is zero or more grants separated by semicolons. Each grant names one resource and one or more actions:

RESOURCE:ACTION[,ACTION...][;RESOURCE:ACTION[,ACTION...]...]
  • RESOURCE is one of the resources, or * for every resource.
  • ACTION is one of the actions, or * for every action.
  • A colon (:) separates a resource from its actions, a comma (,) separates actions, and a semicolon (;) separates grants.
  • Spaces around a grant or an action are trimmed, but the canonical form has none, and the pattern in the OpenAPI document rejects them. Write configs:read;agents:read, not configs:read; agents:read.
  • The order of grants doesn’t matter, and a resource can appear in more than one grant.
  • An empty string grants nothing. Omitting the permissions field in POST /api/tokens has the same effect.

For example, the following string lets a client read and update configurations, read configuration groups, and send heartbeats:

configs:read,write;config-groups:read;heartbeat:write

Wildcards

  • * in place of a resource applies the actions to every resource. For example, *:read grants read access to everything.
  • * in place of an action grants every action on the resource. For example, agents:* grants read, write, and delete on agents.
  • *:* grants everything. This is the Owner role’s permission string.

A wildcard in place of the resource also covers resources that a later release adds. A grant that names its resources covers only those, so a token with an explicit list has no access to a new resource until you create a new token.

Only an Owner can hold a wildcard on a token. For every other role, Telegraf Controller replaces a wildcard in a token request with the grants the role holds. See How requested permissions are restricted. Tokens created in the web interface never contain a wildcard. See Permission presets.

Invalid strings

Telegraf Controller rejects a permission string, and the API returns 400 Bad Request, when the string contains any of the following:

  • A resource or action that isn’t in the vocabulary, for example config:read instead of configs:read.
  • A grant without actions, for example configs.
  • A trailing semicolon or comma, for example configs:read; or configs:read,.

The validator accepts any action on any resource. An action that no endpoint requires, such as delete on heartbeat, is stored but has no effect. The Permissions grid in the web interface offers only the actions each resource supports.

Resources

ResourceLabel in the web interfaceActionsControls
configsConfigurationsread, write, deleteConfigurations, their versions and TOML, and configuration aliases.
config-groupsConfiguration Groupsread, write, deleteConfiguration groups and their members.
constantsConstantsread, write, deleteConstants.
agentsAgentsread, write, deleteAgents, their labels and reporting rule assignments, heartbeat data, status checks, and the fleet summary.
reporting-rulesReporting Rulesread, write, deleteReporting rules.
labelsLabelsread, write, deleteLabels.
heartbeatHeartbeatread, writewrite lets a Telegraf agent send heartbeats. read lets a client read the heartbeat service health.
tokensTokensread, write, deleteAPI tokens. A request authenticated with a token manages only the tokens of its own user. See Token visibility.
analyticsAnalyticsreadNo endpoint requires this permission in the current release.
usersUsersread, write, deleteUser accounts. Account self-service and ownership transfer accept only a signed-in session. See Session-only endpoints.
invitesInvitesread, write, deleteUser invitations.
password-resetsPassword Resetsread, write, deletePassword reset requests.
settingsSettingsread, writeAuthentication settings on the Settings page. Changing the LDAP and OIDC sections also requires the Owner role.
auth-configAuth Configread, writeAuthentication provider details and group-to-role mappings. Only the Owner role holds write.
licenseLicenseread, writeThe Telegraf Enterprise license. Only the Owner role holds write.
entitlementsEntitlementsreadCurrent entitlements and usage. Every role holds read.
security-advisoriesSecurity Advisoriesread, writeSecurity advisories (Telegraf Enterprise). read views advisories and fleet exposure. write checks for advisories, imports advisory files, and acknowledges notifications.
auditAudit LogreadThe audit log and its integrity check (Telegraf Enterprise).

Actions

  • read: list and view the resource.
  • write: create and update the resource, and perform actions on it, such as checking agent statuses. Operations that change a resource without deleting it, such as removing a label from an agent, are also write operations.
  • delete: delete the resource.
  • *: every action on the resource.

How permissions are checked

Each API endpoint requires one or more permissions. The interactive API reference lists them for every endpoint.

A request satisfies a required permission when at least one grant in the caller’s permission string covers it: the grant’s resource is the required resource or *, and one of the grant’s actions is the required action or *. When an endpoint requires more than one permission, the request must cover all of them.

Which permission string applies depends on how the request is authenticated:

  • A signed-in session uses the permissions of the user’s role.
  • An API token uses the permissions stored on the token, which never exceed the role of the user it belongs to.

Telegraf agents send heartbeats to the heartbeat service on its own port. The heartbeat service accepts an active token that holds heartbeat:write. See Use API tokens.

Endpoint groups with authentication disabled skip the permission check. See Endpoint authentication.

Role permissions

Each user role holds the following permissions. All means every action listed for the resource under Resources.

ResourceOwnerAdministratorManagerViewer
configsAllAllAllRead
config-groupsAllAllAllRead
constantsAllAllAllRead
agentsAllAllAllRead
reporting-rulesAllAllAllRead
labelsAllAllAllRead
heartbeatAllAllAllNone
tokensAllAllAllNone
analyticsAllAllNoneNone
usersAllAllNoneNone
invitesAllAllNoneNone
password-resetsAllAllNoneNone
settingsAllAllNoneNone
auth-configAllReadNoneNone
licenseAllReadNoneNone
entitlementsAllReadReadRead
security-advisoriesAllAllReadRead
auditAllReadNoneNone

Role permission strings

How requested permissions are restricted

When you create a token, Telegraf Controller compares each requested grant with the permissions of your role and keeps only what the role holds:

  • A grant your role holds is kept as written.
  • A wildcard is replaced by the grants your role holds that it covers. For an Administrator, *:* becomes the Administrator permission string, and license:* becomes license:read.
  • A grant your role doesn’t hold is dropped without an error. For example, a Manager who requests users:read receives a token with no users grant. Check the permissions field in the response, or the token’s detail page, to see what the token received.

A request authenticated with an API token is also restricted to the permissions of that token, so a token can’t create a token broader than itself.

The same restriction applies again when a token is reassigned to another user, using the target user’s role, when a user’s role changes, and after an ownership transfer, when the former owner’s tokens are restricted to the Administrator role. See API tokens.

Permission presets

The Create API Token page offers presets that fill the Permissions grid for you.

PresetPermission stringAvailable to
CustomStarts empty. Check the actions you want.Owner, Administrator, Manager
Telegraf Agentconfigs:read;config-groups:read;heartbeat:writeOwner, Administrator, Manager
Read-Onlyread on every resourceOwner, Administrator, Manager
Full AccessEvery action on every resourceOwner, Administrator

A preset is restricted to your role like any other request, so Read-Only for a Manager grants read on the resources a Manager can access, and Full Access for an Administrator grants the Administrator permission string. Changing any box after selecting a preset switches the preset back to Custom.

A preset fills the grid, and the page submits the grid’s explicit list of resources and actions, never a wildcard. A token created in the web interface, including one created with Full Access, doesn’t gain access to resources that a later release adds. To create a token that does, an Owner can send *:* in a POST /api/tokens request. A bootstrap owner token also holds *:*.


Was this page helpful?

Thank you for your feedback!