Resources / CredentialDelivery

CredentialDelivery

A credential the platform makes and puts where a platform component reads it, so nobody pastes it. The source is an API token for a service account, a generated random value, or a Secret; the target is a secret of a platform component. The operator never shows or stores the value: it goes from its origin to the target in one step, the old token is revoked after the new one is delivered and a grace period has passed, and the status shows only a fingerprint and times. Starts in plan mode. Only in the root cluster and in system projects.

Overview

APIsecrets.etorm.com/v1alpha1
Resourcecredentialdeliveries (cluster-scoped inside its cluster)
Short namesnone
Available inthe platform and project clusters
Statuswritten by a controller through /status

Minimal example

apiVersion: secrets.etorm.com/v1alpha1
kind: CredentialDelivery
metadata:
  name: example
spec:
  source: {}
  target:
    type: ComponentSecret
    component: "<component>"
    name: "<name>"

Spec

FieldTypeRequiredDefaultAllowedDescription
modestring (one of)"plan"plan, applyplan: say in the status what would be done and do nothing. apply: do it.
descriptionstringup to 200 charactersWhat the credential is for.
sourceobjectyesWhere the value comes from. Exactly one of serviceAccount, generate, secretRef, value, deployAccount.
source.serviceAccountreference to ServiceAccountAn API token for this service account in this cluster is made, delivered, and replaced on schedule. The requester must be able to make API tokens at the platform level.
source.generateobjectA random value is made and delivered. It is kept nowhere else.
source.generate.kindstring (one of)yestoken, password, bytesThe form of the value.
source.generate.lengthinteger16 to 128Characters or bytes. Default 32.
source.valueobjectA fixed, NOT secret text (it is readable in this object). For a variable target only.
source.value.textstringyeslength 1 to 1024The text.
source.deployAccountobjectThe id of the account the platform's components are deployed in, as the deploy credential sees it. Not secret. For a variable target only.
source.secretRefobjectOne key of a Secret in this cluster is delivered, again whenever the secret has a new version. The requester needs the use right on the secret.
source.secretRef.namestringyeslength 1 to 63Name of the Secret.
source.secretRef.keystringyeslength 1 to 63Which key of its data.
targetobjectyesWhere the value is put.
target.typestring (one of)yesComponentSecret, ComponentVarComponentSecret: a secret of a platform component (any source but value and deployAccount). ComponentVar: a plain, readable variable of it (only value or deployAccount).
target.componentstringyeslength 1 to 63The platform component that reads the value (its deployed name).
target.healthUrlstringup to 253 charactersA public https URL that answers 200 while the component works (its health check). After a delivery the operator reads it every pass and sets the condition ConsumerUnhealthy, which a remediation policy can answer by asking for a fresh value (the RotateNow action).
target.expectBindingslist of stringup to 32 itemsNames of bindings the component must still have after every delivery. If one is missing the delivery is reported as failed, naming it. A canary component uses this to prove that a way of delivering loses nothing.
target.namestringyeslength 1 to 64The name the component reads (capital letters, digits and underscores).
rotationobjectWhen the value is replaced.
rotation.intervalSecondsintegerat least 3600Replace this often. Without it a token lives until it expires or the delivery is deleted, and a Secret source is redelivered when it changes.
rotation.graceSecondsinteger3000 to 86400How long the old token stays valid after the new one is delivered.

Status

FieldTypeRequiredDefaultAllowedDescription
phasestring (one of)Planned, Pending, Ready, FailedPlanned: plan mode, nothing was done. Pending: nothing delivered yet. Ready: delivered. Failed: the last attempt failed (the previous value, if any, still works).
conditionslist of objectDetailed state: Delivered, Revoked, ConsumerUnhealthy.
conditions[].typestringAspect.
conditions[].statusstringTrue or False.
conditions[].reasonstringMachine-readable reason.
conditions[].messagestringHuman-readable detail
conditions[].lastTransitionTimestringWhen the status last changed (RFC 3339); remediation policies wait from it.
planstringWhat apply mode would do next (plan mode only).
fingerprintstringTwelve hex digits identifying the delivered value (for a Secret source
deliveredAtstringWhen the current value was delivered (RFC 3339).
expiresAtstringWhen the delivered token stops working (RFC 3339)
nextRotationAtstringWhen it will be replaced (RFC 3339)
sequenceintegerHow many values have been delivered.
currentTokenstringName of the APIToken that was delivered (service account source).
previousTokenstringName of the APIToken waiting to be revoked.
requestedForstringThe rotation request (annotation secrets.etorm.com/rotate-requested) this delivery last answered.
sourceVersionintegerThe Secret version that was delivered (secret source).

Columns in listings

ColumnFrom
Mode.spec.mode
Target.spec.target.component
Name.spec.target.name
Phase.status.phase
Delivered.status.deliveredAt

All resources