Documentation · Administration · Secrets

Sources

Secrets → Sources: the services credentials come from and are checked with. Point the built-in ones at your own instances, and add an API key source for every other service.

What each source checks

SourceIdChecksRevokes at the service
GitHub, GitHub EnterprisegithubWorks, exact scopes (classic tokens), expiry, accountYes, requested
GitLab, self-managedgitlabWorks, exact scopes, expiry, accountYes
GiteagiteaWorks, account (attested)No
ForgejoforgejoWorks, account, exact scopes on a recent ForgejoNo
CloudflarecloudflareWorks, expiry, permission groups when the token may read themNo
API key sourcesapikey:<key>Works, with a probe request (attested)With a revokeUrl

Every credential is checked when it is added and every six hours after. How each answer becomes a state is on the Credentials page.

Configure a built-in source

Configure on a built-in source sets its Base URL:

SourceExampleEmpty means
GitHub Enterprisehttps://ghe.example.com/api/v3github.com
Self-managed GitLabhttps://gitlab.example.com/api/v4gitlab.com
Giteahttps://gitea.example.comgitea.com
Forgejohttps://forgejo.example.comcodeberg.org
Cloudflareleave emptyCloudflare's API

For Cloudflare account-owned tokens, add accountId=<32-character account id> under Settings.

Credvane only calls public https addresses. To reach a self-managed GitLab, Gitea or Forgejo on your own network, an operator lists its host name or network in CREDVANE_ALLOWED_PRIVATE_HOSTS (see the configuration reference). Link-local addresses and cloud metadata services are never called, and a name that starts resolving to a refused address after it was saved is refused when Credvane connects.

When the address changes

Each credential is pinned to the address its value was added under: the base URL, the …Url settings, and the headers that carry the value (authHeader, authScheme, header.*). Renaming a source or changing deadStatuses is not an address change. When an admin or an API key changes the address:

CredentialWhat happens
A person'sHeld: Credvane sends the value nowhere (no checks, no revocation calls) until the owner confirms the new address on their Credentials page. Applications still read it. Admins cannot confirm for a person.
An identity'sFollows the source, since admins can reveal an identity's values anyway
Added after the changePinned to the new address: whoever adds it agrees to it

Owners are emailed, admins get a notice with the number held, and the audit log records PROVIDER_CONFIG_SAVED with destinationChanged and each owner's CREDENTIAL_DESTINATION_CONFIRMED. So a legitimate move, such as a new GitHub Enterprise host, needs each person to confirm once: tell them before you change it.

To put address changes through your own change management, manage sources with Terraform and review them like any other infrastructure change. The pin is the backstop for a change that skips that review.

Add an API key source

  1. Add API key source, and Start from one of 25 presets (OpenAI, Anthropic, Datadog, npm, Vercel and more) or leave it blank.
  2. Key: a short id such as datadog or datadog-eu. Specs refer to the source as apikey:<key>; it cannot change.
  3. Name: what people see.
  4. Check the Settings, one key=value per line. A spec cannot use the source until it has a probeUrl.
SettingDefaultMeaning
probeUrlrequiredCredvane sends GET here with the key. Pick a cheap endpoint that needs authentication and changes nothing.
authHeaderAuthorizationThe header that carries the key
authSchemeBearerThe word before the key; none sends the key alone; Basic sends user:secret as Basic auth
header.<Name>–A fixed extra header
deadStatuses401,403Answers that mean the key is refused
revokeUrl, revokeMethod–, DELETEWhere a key revokes itself, called when a credential is revoked or replaced

A bearer token, the default:

probeUrl=https://api.example.com/v1/me

The key alone in its own header, plus a fixed version header:

probeUrl=https://api.anthropic.com/v1/models
authHeader=x-api-key
authScheme=none
header.anthropic-version=2023-06-01

A service whose keys can revoke themselves:

probeUrl=https://api.example.com/v1/keys/self
revokeUrl=https://api.example.com/v1/keys/self
revokeMethod=DELETE

A source can be deleted while no spec uses it.

Terraform

credvane_source configures a built-in source, credvane_apikey_source manages an API key source, and the credvane_source data source reads any of them.

# Point the built-in GitHub source at GitHub Enterprise.
# Destroying this resets the settings; the github source stays.
resource "credvane_source" "github" {
  id       = "github"
  base_url = "https://ghe.example.com/api/v3"
}

# An API key source per service.
resource "credvane_apikey_source" "datadog" {
  key  = "datadog"
  name = "Datadog"
  settings = {
    probeUrl   = "https://api.datadoghq.com/api/v1/validate"
    authHeader = "DD-API-KEY"
    authScheme = "none"
  }
}

data "credvane_source" "gitlab" {
  id = "gitlab"
}