Documentation · Administration · Secrets

Specs

Secrets → Specs: declare what credentials may exist. Each spec names a source, the exact scopes a credential must have, and how people should create it.

Add a spec

The Add a spec form filled in for a GitHub spec named Terraform state (read).
FieldWhat to put
NameWhat people see, for example GitHub packages (read)
KeyWhat applications ask for: /api/v1/credentials/<key>. Suggested from the name (github-packages-read); lowercase letters, digits, dashes and underscores. It cannot change later.
SourceWhere the credential comes from. It cannot change once credentials were checked by it.
ScopesFor GitHub, GitLab, Forgejo and Cloudflare: the scopes a credential must have, exactly. Other sources cannot report scopes, so the field is hidden.
DescriptionWhat it is used for, shown to people adding a credential
Instructions for engineersHow to create it: which token type, which expiry
Accept credentials the source cannot verifyAllow attested credentials: GitHub fine-grained tokens, older Forgejo, Cloudflare tokens that cannot read their own permissions. Always on for Gitea and API keys.
Revoke replaced values at the sourceWhen a new value passes, also revoke the old one at the service, not only delete it from Credvane. On by default.

Choosing scopes

A credential must have exactly the spec's scopes: nothing missing, nothing extra. A broader scope includes the ones under it, so list one or the other: repo already includes repo:status, and a spec with both can never be met.

PurposeSourceScopesAllow unverified
Pull packages and images in CIGitHubread:packagesOff
Publish packages from a release jobGitHubwrite:packagesOff
Pull from the GitLab registryGitLabread_registryOff
A repository-scoped GitHub tokenGitHubnone: use a fine-grained tokenOn
Send metrics to DatadogAPI key source apikey:datadog–Always

Keep one spec per job rather than one broad token for everything: a narrow spec makes a leak smaller and offboarding clearer. Applications then read exactly what they need:

curl -H "Authorization: Bearer $TOKEN" https://credvane.example.com/api/v1/credentials/github-packages

Change, archive and delete

  • Edit changes the name, scopes, description, instructions and switches. Existing credentials are checked against new scopes at their next check, and degrade if they no longer match.
  • Archive, once none of its credentials is live: it takes no new credentials, tokens or trust policies, but keeps its key and history. Show archived lists them.
  • Delete only a spec nothing uses.

Terraform

Specs are the credvane_spec resource, keyed by key. Deleting a spec that still has credentials fails; set archived = true instead.

resource "credvane_spec" "github_packages" {
  key          = "github-packages"
  name         = "GitHub packages (read)"
  source       = "github"
  scopes       = ["read:packages"]
  description  = "Pulls container images and packages in CI."
  instructions = "Create a classic token with only read:packages, expiring in 90 days."
}

resource "credvane_spec" "gitlab_registry" {
  key    = "gitlab-registry"
  name   = "GitLab registry (read)"
  source = "gitlab"
  scopes = ["read_registry"]
}

resource "credvane_spec" "datadog_api" {
  key              = "datadog-api"
  name             = "Datadog API key"
  source           = credvane_apikey_source.datadog.id   # apikey:datadog
  allow_unverified = true
}