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 editor or an incident's assignee. 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

PrincipalDescription
AgentA machine that sends data to an account.
Service accountA non-human identity for automation, such as running evaluators or sending data. Service accounts cannot sign in.
UserA 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.
    • User: A person who signs in to Logship.

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.view on the containing account
  • Condition: resource.Visibility == "account"

Conditions

Conditions are CEL expressions. A condition can read:

ValueType
request.timedatetime
request.ipstring Absent on system calls; guard with has().
request.authMethodstring One of interactive, oauth, api_token, inflow_token, agent_token, service_account_token, evaluator. Absent on system calls; guard with has().
request.tokenIdguid Absent on system calls; guard with has().
request.permissionstring
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 of account.update.
  • dashboard.Name: set by holders of dashboard.edit.
  • dashboard.Visibility: set by holders of dashboard.manage_access.
  • evaluator.Name: set by holders of evaluator.update.
  • evaluator.IsEnabled: set by holders of evaluator.update.
  • evaluator.RunAsMode: set by holders of evaluator.update.
  • group.Name: set by holders of group.update.
  • incident.Title: set by holders of incident.update.
  • incident.State: set by holders of incident.update.
  • incident.Owner: set by holders of incident.update.
  • incident.AssigneeUserId: set by holders of incident.update.
  • saved_query.Name: set by holders of saved_query.update.

Grants can use these named conditions:

ConditionParametersDescription
not_expiredexpires_at: datetimeHolds until the expiry time.
within_windowstarts_at: datetime, ends_at: datetimeHolds from the start time until the end time.