Access control
How relationships between principals and resources decide who can do what.
Every action in Logship requires a permission on a resource. Roles, relationships and policies determine whether the caller has that permission. Access is denied unless one of these rules grants it.
A principal is connected to a resource by:
- A role. A role granted to a principal on a resource gives the role's permissions on that resource and on every resource it contains. Data reader on an account reads every table in it; on a table, only that table.
- A direct relationship. Some resources name the principals related to them, such as a
dashboard's
editoror an incident'sassignee. Others follow from the resource itself, such as an incident's owner. Each resource's page lists its relationships and what they allow. - A group. A relationship held by a group applies to every member of the group.
- A parent resource. Some permissions follow from the same permission on the containing resource, such as reading a column from reading its table.
A role grant or relationship can carry a condition, such as an expiry. A role can also deny some of its permissions while a condition holds. A condition that cannot be evaluated denies.
Policies can grant or deny access when their requirements and conditions are met. A forbid policy takes precedence over any role, relationship or permit policy that grants access. A forbid whose condition cannot be evaluated, or reads a value that is not set, denies as if it held.
See Roles for what each built-in role grants.
Principals
| Principal | Description |
|---|---|
| Agent | A machine that sends data to an account. |
| Service account | A non-human identity for automation, such as running evaluators or sending data. Service accounts cannot sign in. |
| User | A person who signs in to Logship. |
Resources
Each resource is contained by the one above it. Roles granted on a resource reach everything below it.
- System: The Logship deployment.
- Account: An isolated tenant with its own data and access.
- Account user: A user's or service account's membership in an account.
- Agent: A machine that sends data to an account.
- Agent registration: A machine's request to join an account as an agent.
- Dashboard: A saved collection of charts.
- Evaluator: A scheduled query that raises incidents and sends notifications.
- Group: A named set of users, service accounts and other groups of the same account that can be given access together.
- Incident: An issue that needs attention.
- Saved query: A named, saved query.
- Service account: A non-human identity for automation, such as running evaluators or sending data. Service accounts cannot sign in.
- Table: A table of data.
- Column: A column of a table.
- User: A person who signs in to Logship.
- Account: An isolated tenant with its own data and access.
Policies
Disabled users
Disabled users are denied everything.
Policy definition
- ID:
disabled_users - Effect: Forbid
- Permissions: All
- Principals: User
- Condition:
has(principal.IsDisabled) ? principal.IsDisabled : true
Disabled service accounts
Disabled service accounts are denied everything.
Policy definition
- ID:
disabled_service_accounts - Effect: Forbid
- Permissions: All
- Principals: Service account
- Condition:
has(principal.IsDisabled) ? principal.IsDisabled : true
Unapproved agents
Agents are denied everything until they are approved.
Policy definition
- ID:
unapproved_agents - Effect: Forbid
- Permissions: All
- Principals: Agent
- Condition:
has(principal.State) ? principal.State != "approved" : true
Account visible dashboards
Public dashboards (account visibility) can be viewed by all users and service accounts with access to the account. Private dashboards require access through a role or a viewer or editor relationship, either directly or through a group. Roles that grant dashboard access across the account also apply to private dashboards. Public sharing is limited to the account and does not allow anonymous access.
Policy definition
- ID:
account_visible_dashboards - Effect: Permit
- Permissions:
dashboard.view - Principals: User, Service account
- Requires:
account.viewon the containing account - Condition:
resource.Visibility == "account"
Conditions
Conditions are CEL expressions. A condition can read:
| Value | Type |
|---|---|
request.time | datetime |
request.ip | string Absent on system calls; guard with has(). |
request.authMethod | string One of interactive, oauth, api_token, inflow_token, agent_token, service_account_token, evaluator. Absent on system calls; guard with has(). |
request.tokenId | guid Absent on system calls; guard with has(). |
request.permission | string |
resource.<attribute> | The attributes listed on the resource's page. |
principal.<attribute> | The attributes listed on the principal's page. |
Custom roles, policies and binding denies cannot read a self-asserted attribute, which is set without verification:
agent.Environment: The environment the agent reports, such as production.agent.HostName: The host name the agent reports.service_account.Name: The service account's name, chosen by whoever creates or renames it.user.UserName: The user's login name.user.Email: The user's primary email address.
Conditions may read these attributes, but whoever holds the listed permission sets them, so a condition keyed on one, such as a name, can be evaded by anyone allowed to change it:
account.Name: set by holders ofaccount.update.dashboard.Name: set by holders ofdashboard.edit.dashboard.Visibility: set by holders ofdashboard.manage_access.evaluator.Name: set by holders ofevaluator.update.evaluator.IsEnabled: set by holders ofevaluator.update.evaluator.RunAsMode: set by holders ofevaluator.update.group.Name: set by holders ofgroup.update.incident.Title: set by holders ofincident.update.incident.State: set by holders ofincident.update.incident.Owner: set by holders ofincident.update.incident.AssigneeUserId: set by holders ofincident.update.saved_query.Name: set by holders ofsaved_query.update.
Grants can use these named conditions:
| Condition | Parameters | Description |
|---|---|---|
not_expired | expires_at: datetime | Holds until the expiry time. |
within_window | starts_at: datetime, ends_at: datetime | Holds from the start time until the end time. |