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
permissionsfield ofPOST /api/tokensaccepts 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
permissionsfield and publishes the resource and action vocabulary as thePermissionResourceandPermissionActionschemas, 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...]...]RESOURCEis one of the resources, or*for every resource.ACTIONis 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
patternin the OpenAPI document rejects them. Writeconfigs:read;agents:read, notconfigs: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
permissionsfield inPOST /api/tokenshas 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:writeWildcards
*in place of a resource applies the actions to every resource. For example,*:readgrants read access to everything.*in place of an action grants every action on the resource. For example,agents:*grantsread,write, anddeleteon 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:readinstead ofconfigs:read. - A grant without actions, for example
configs. - A trailing semicolon or comma, for example
configs:read;orconfigs: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
| Resource | Label in the web interface | Actions | Controls |
|---|---|---|---|
configs | Configurations | read, write, delete | Configurations, their versions and TOML, and configuration aliases. |
config-groups | Configuration Groups | read, write, delete | Configuration groups and their members. |
constants | Constants | read, write, delete | Constants. |
agents | Agents | read, write, delete | Agents, their labels and reporting rule assignments, heartbeat data, status checks, and the fleet summary. |
reporting-rules | Reporting Rules | read, write, delete | Reporting rules. |
labels | Labels | read, write, delete | Labels. |
heartbeat | Heartbeat | read, write | write lets a Telegraf agent send heartbeats. read lets a client read the heartbeat service health. |
tokens | Tokens | read, write, delete | API tokens. A request authenticated with a token manages only the tokens of its own user. See Token visibility. |
analytics | Analytics | read | No endpoint requires this permission in the current release. |
users | Users | read, write, delete | User accounts. Account self-service and ownership transfer accept only a signed-in session. See Session-only endpoints. |
invites | Invites | read, write, delete | User invitations. |
password-resets | Password Resets | read, write, delete | Password reset requests. |
settings | Settings | read, write | Authentication settings on the Settings page. Changing the LDAP and OIDC sections also requires the Owner role. |
auth-config | Auth Config | read, write | Authentication provider details and group-to-role mappings. Only the Owner role holds write. |
license | License | read, write | The Telegraf Enterprise license. Only the Owner role holds write. |
entitlements | Entitlements | read | Current entitlements and usage. Every role holds read. |
security-advisories | Security Advisories | read, write | Security advisories (Telegraf Enterprise). read views advisories and fleet exposure. write checks for advisories, imports advisory files, and acknowledges notifications. |
audit | Audit Log | read | The 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 alsowriteoperations.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.
| Resource | Owner | Administrator | Manager | Viewer |
|---|---|---|---|---|
configs | All | All | All | Read |
config-groups | All | All | All | Read |
constants | All | All | All | Read |
agents | All | All | All | Read |
reporting-rules | All | All | All | Read |
labels | All | All | All | Read |
heartbeat | All | All | All | None |
tokens | All | All | All | None |
analytics | All | All | None | None |
users | All | All | None | None |
invites | All | All | None | None |
password-resets | All | All | None | None |
settings | All | All | None | None |
auth-config | All | Read | None | None |
license | All | Read | None | None |
entitlements | All | Read | Read | Read |
security-advisories | All | All | Read | Read |
audit | All | Read | None | None |
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, andlicense:*becomeslicense:read. - A grant your role doesn’t hold is dropped without an error.
For example, a Manager who requests
users:readreceives a token with nousersgrant. Check thepermissionsfield 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.
| Preset | Permission string | Available to |
|---|---|---|
| Custom | Starts empty. Check the actions you want. | Owner, Administrator, Manager |
| Telegraf Agent | configs:read;config-groups:read;heartbeat:write | Owner, Administrator, Manager |
| Read-Only | read on every resource | Owner, Administrator, Manager |
| Full Access | Every action on every resource | Owner, 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!
Support and feedback
Thank you for being part of our community! We welcome and encourage your feedback and bug reports for Telegraf Controller and this documentation. To find support, use the following resources:
Customers with an annual or support contract can contact InfluxData Support.