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

| Field | What to put |
|---|---|
| Name | What people see, for example GitHub packages (read) |
| Key | What applications ask for: /api/v1/credentials/<key>. Suggested from the name (github-packages-read); lowercase letters, digits, dashes and underscores. It cannot change later. |
| Source | Where the credential comes from. It cannot change once credentials were checked by it. |
| Scopes | For GitHub, GitLab, Forgejo and Cloudflare: the scopes a credential must have, exactly. Other sources cannot report scopes, so the field is hidden. |
| Description | What it is used for, shown to people adding a credential |
| Instructions for engineers | How to create it: which token type, which expiry |
| Accept credentials the source cannot verify | Allow 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 source | When 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.
| Purpose | Source | Scopes | Allow unverified |
|---|---|---|---|
| Pull packages and images in CI | GitHub | read:packages | Off |
| Publish packages from a release job | GitHub | write:packages | Off |
| Pull from the GitLab registry | GitLab | read_registry | Off |
| A repository-scoped GitHub token | GitHub | none: use a fine-grained token | On |
| Send metrics to Datadog | API 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-packagesChange, 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
}