Documentation · Administration · Identities

Identities

Identities → Identities: service identities that own credentials for a team, an application or an agent, and the trust policies and exchange tokens that act as them.

The list

ColumnShows
NameThe identity, for example api-deploy
StatusActive, or deactivated
HoldsHow many credentials it owns
Can authenticateIts trust policies and active exchange tokens; none means nothing can read as it yet
Needs attentionWarnings, such as a policy that may read a spec the identity holds no value for

Create an identity

New identity walks through three steps:

  1. Identity: a name such as api-deploy, and under May read the specs a workload acting as it will read.
  2. Who may act as it: the issuer that mints the workload's token (GitHub Actions, GitLab CI, or one added on Issuers), the required claims, the audience (Credvane's address plus /w/<identity id> by default) and an optional maximum token age. Or choose Nothing yet to create the identity only.
  3. Done: a ready workflow snippet for the issuer, and the specs that still need a value.

Then open the identity and add a value for each spec on its Credentials tab. Until then, a read of that spec answers 404.

The identity's page

The platform-ci identity's trust policy for GitHub Actions, with its required claims and the specs it may read.
TabWhat you do there
CredentialsAdd, replace, reveal and revoke the identity's values, as on a person's Credentials page
Trust policiesAdd, edit, switch off and delete policies; Workflow snippet shows how a job uses one
Exchange tokensTokens for applications without a platform identity, as on the Exchange tokens page

Rename changes its name. Deactivate refuses every read by its policies and tokens at once; its credentials stay, so Reactivate brings it back. An identity is never deleted, so the audit trail always has it.

Trust policy examples

Who may readIssuerRequired claims
Jobs on main in one GitHub repositoryGitHub Actionsrepository=example-org/api, ref=refs/heads/main
Release tags onlyGitHub Actionsrepository=example-org/api, ref=refs/tags/v*
One GitLab project's protected branchesGitLab CI (gitlab.com)project_path=example-org/api, ref_protected=true
One Buildkite pipelinehttps://agent.buildkite.com, added on Issuers as another OIDC issuerorganization_slug=example, pipeline_slug=deploy
Pods of one service accountYour Kubernetes clustersub=system:serviceaccount:payments:api
  • Claims match exactly, or with * as a wildcard. On a shared issuer (GitHub Actions, gitlab.com, Buildkite) the policy must pin your account with no * in the owner part: repository=example-org/* is fine, repository=*/* is refused. On other issuers, at least one claim must have no *.
  • Names can be reused after an organization is renamed or deleted: prefer repository_owner_id on GitHub and namespace_id on GitLab where you can.
  • Set a maximum token age (for example 15 minutes) for issuers whose tokens live long; Keycloak's last an hour by default.
  • When two policies could match the same token, the list warns you. Such a read gets 409 unless it names the policy with ?policy=<name>.

A GitHub Actions job using the policy above, with the Credvane action:

permissions:
  id-token: write
  contents: read
jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: commitwisedev/credvane-action@v1
        with:
          url: https://credvane.example.com
          identity: 0f3b6c1e-...
          credentials: github-packages=NPM_TOKEN
      - run: npm publish

Terraform

Identities and trust policies are resources of the Terraform provider. Destroying an identity deactivates it.

resource "credvane_identity" "api_deploy" {
  name = "api-deploy"
}

data "credvane_issuer" "github" {
  name = "GitHub Actions"
}

resource "credvane_workload_trust" "api_deploy_main" {
  name     = "api-deploy-main"
  issuer   = data.credvane_issuer.github.url
  audience = "https://credvane.example.com/w/${credvane_identity.api_deploy.id}"
  identity = credvane_identity.api_deploy.name
  specs    = ["github-packages", "datadog-api"]
  claims = {
    repository = "example-org/api"
    ref        = "refs/heads/main"
  }
  max_token_age_minutes = 15
}

Credential values are never managed in Terraform: add them on the identity's Credentials tab.