Roles and grants

Read the permission list, make a custom role, and grant it to a person, group or team on the place where it should apply.

A role is a named set of permissions. A grant (the API calls it a role binding) gives a role to a person, a group, a team or an agent on one place: the whole organization, a team, an environment, a cluster, an app, a pipeline or a deployment. A grant on a place reaches what the place contains, so a role granted on an environment reaches its clusters, including ones added later. Grants only add: there is no "deny", so access from different sources never conflicts. The model, with the rules behind it, is in Access model.

You will mostly use roles for two things: giving someone a duty they would not otherwise hold, such as approving or bypassing, and giving a team or contractor read access to a place that is not theirs.

Managing is not doing

Wardn keeps two powers apart:

  • Managing a thing: creating it, editing it, deciding who may act on it. The owners of a place manage it.
  • Duties on a thing: approving a release, signing off a snapshot, bypassing a guardrail, adding a guardrail exception, opening a terminal. These belong to the people designated for them, and not to seniority. An Admin who is not designated cannot do them. The organization Owner holds every duty, except opening a terminal, which only a grant that names it gives.

Designate a duty by granting a role that holds it, on the place where it should apply, to a person, a group or a team. Give it an end date for cover, such as "until Friday". The person who designates does not need to hold the duty: the Admin who owns a pipeline sets up who signs off without signing off. The exception is release:bypass, which only someone who holds it can give away.

Built-in roles

Built-in roles cannot be edited or deleted. Only one is granted by hand; the others come from membership and ownership, which is why the grants API refuses them.

RolePlaceComes fromHolds
Organization readerOrganizationGranted by an OwnerReads everything in the organization, the full Activity feed included.
Team memberTeamMembership of the teamReads the team, its apps, deployments and pipelines; syncs, rolls back and raises releases.
Team leadTeamSet on the teamTeam member, plus approving for the team and adding or removing plain members.
Team ownerTeamSet on the teamRuns the team, its people, leads and groups.
Cluster owner, Environment owner, App owner, Deployment ownerThat placeWhoever creates the thingReads it and what it holds, manages it, decides who may act on it, and operates its deployments (sync, roll back, drift).
Pipeline ownerPipelineWhoever creates itReads and edits the pipeline and decides who may act on it.

An organization's role (Owner, Admin, Contributor, Viewer) is also a source of permissions; see Members and teams.

Permissions

GET /permissions returns the catalog, grouped as the role editor shows it. A role's permissions are keys of the form resource:action, plus three patterns: * (everything), *:read (every read) and resource:* (every action on one resource). A wildcard never grants pod:exec.

GroupPermissions (a mark means a duty)
Releasesrelease:read, release:raise, release:approve (duty), release:bypass (duty)
Remediationsremediation:read, remediation:approve (duty), remediation:rules (duty)
Deploymentsdeployment:read, deployment:manage, deployment:sync, deployment:rollback, pod:exec (duty, designated only: for people named for terminals, since anyone who manages a deployment may open one unless its environment allows named people only)
Snapshotssnapshot:read, snapshot:signoff (duty)
Driftdrift:adopt, drift:revert, drift:ignore
Restoresrestore:bypass (duty)
Guardrailsguardrail:read, guardrail:manage, exception:manage (duty)
Pipelinespipeline:read, pipeline:create, pipeline:manage
Infrastructurecluster:read, cluster:register, cluster:manage, cluster:exec, environment:read, environment:create, environment:manage
Appsapp:read, app:create, app:approve, app:manage
Incidentsincident:read, incident:manage
Integrationsintegration:manage, agent:read, agent:manage
Accessorg:read, org:manage, team:read, team:create, team:manage, team:members, role:read, role:manage, role:create, audit:read, token:manage

The full list with what each allows, and the operations that check it, is on API permissions. Some permissions guard features that are still being finished; the page for each feature says which parts are stored but not acted on yet.

Make a custom role

Open Access › Roles. The list shows each role, its Key permissions and whether it is Org-wide or On a scope, with filters for Custom. Choose New role.

Under Details, name it after what people do with it ("For example: Release approver") and describe it. Under Start from, copy an existing role or start Blank.

Under Where it is granted, choose Organization (given org-wide) or On a scope (given on a pipeline, stage, environment, cluster, app or deployment).

Under Permissions, tick what the role allows. The grey names beside each are the keys Wardn checks. Always applies lists the rules no role can change.

Choose Create role.

A role can never hold more than its creator does. Reads are always allowed; anything else must be held by you somewhere, except duties other than bypass. The answer to going beyond that is 403 role.beyond_you, naming the permissions. A role also has a lowest organization role it counts for: a person below it cannot use it, and the role is paused for them until they are raised. A Viewer holds only reads, whatever they are granted.

Grant a role

Open the role under Access › Roles and choose Grant this role (a team's page, under Access, opens the same dialog for that team).

Pick the Role, then Who gets it: a team, a group or one or more people. Search people by name, email or team. The dialog checks each person and tells you if someone cannot hold the role there.

Choose Where: the Organization, or a kind of place (An environment, A cluster and so on) and the place. "A grant on an environment reaches its clusters, ones added later too."

Optionally set Expires. A grant must end in the future, and lapses on its own.

Choose Grant role.

Revoke a grant from the list of holders on the role's page or on the team's page ("Grant revoked").

The rules for giving access

  • You can only give away what you hold, except duties (other than bypass), which an owner can designate without holding them.
  • A role fits some places. A role made for a scope cannot be granted at the wrong kind of place (binding.place).
  • Built-in roles come from elsewhere. Owners and leads are set on the team or the thing itself, and the last owner stays (binding.use_owners).
  • People below the role's organization role cannot hold it (binding.below_org_role); the dialog's check says so before you try.
  • Nothing denies. Where someone should have less, do not grant it there. A grant never carries an exception ("approver everywhere except web"); grant on each place instead.
  • Reads are least privilege. A grant is also how a person sees a place that is not theirs. See Who sees what.

Who has access here

api "$WARDN_API_URL/api/v1/access?kind=environment&id=$ENVIRONMENT_ID"      # everyone with access to a place, and why
api "$WARDN_API_URL/api/v1/owners/environment/$ENVIRONMENT_ID"              # its owners

GET /access needs role:read on the place. Owners of a team, cluster, environment, pipeline or app are listed and changed with /owners/{kind}/{id}; any owner can add or remove the others.

Permissions needed here

ActionPermission
See roles, bindings and the permission catalogrole:read (owners of a place, and anyone who can create roles)
Define, change or delete a custom rolerole:create (or you made it)
Grant, revoke, add or remove an ownerrole:manage on the place

Next

Related: Access model, API permissions.

On this page