Snapshot signing

Wardn signs every snapshot it makes, and each deployment's lifecycle jobs and health rules, and each cluster's operator checks the signatures before it applies or runs anything. How it works, how to turn it on for an existing install, and how to rotate the key.

A snapshot is the exact set of rendered manifests a deployment runs. Wardn signs each one when it makes it, and the operator in each cluster checks the signature against the bytes it was sent before it applies a single object. A snapshot whose content was changed after Wardn signed it, in the database, in the object store, or anywhere on the way to the cluster, is refused, and the refusal shows on the deployment. The same holds for the deployment's lifecycle jobs and health rules, which run code and read health beside the snapshot and are signed on their own.

What is signed

When Wardn makes a snapshot (a sync, a promotion, a release, a rollback or a restore), it signs an in-toto statement that lists every resource of the snapshot by the SHA-256 of its canonical JSON, and names the snapshot and its deployment. The statement is wrapped in a DSSE envelope and signed with an ECDSA P-256 key, with sigstore's signature library. This is the format cosign writes for a blob attestation, so cosign verify-blob-attestation checks a snapshot's resources with the same public key (see Check a snapshot with cosign).

What the signature covers, and what it does not:

CoveredNot covered
Every resource of the snapshot, byte for byte, and how many there areSnapshots made before the install began signing (see Existing installs)
Which snapshot of which deployment it is, so a signed snapshot cannot be replayed into another deploymentWhat the server decides about an apply beyond what is described under The context of an apply. Nothing the server sends with an apply is left out of it any more, except the resources themselves, which the snapshot's signature covers
The deployment's lifecycle jobs and health rules, in order, field for field, and a version that only grows (see below)
The namespace and service account an apply acts as, prune and its share, cluster-scoped kinds, the rollback and remove-all flags, a preview's namespace setup and the inventory a prune works from, the cluster the command is for, the wave timeout, the secret references and drift ignore rules, and which wave each resource is in, for each command (see The context of an apply)

A promotion, release or rollback copies another snapshot's content into a new snapshot, which is signed afresh. Before it copies, Wardn checks the source snapshot's signature, so content changed at rest is refused there too rather than signed over.

Lifecycle jobs and health rules

A deployment's lifecycle jobs are Kubernetes Jobs the operator runs before the first wave and after the last, as the deployment's service account, and its health rules are the CEL expressions that read the health of its custom resources. Both are saved with the deployment's settings, not in a snapshot, and travel beside every apply, so a signature over the snapshot alone would leave them open: a compromised server could add a job that runs anything the deployment's service account may do.

They are signed with the same keys, as a second kind of in-toto statement (https://wardn.dev/attestations/delivery-settings/v1), when they are saved, not when they are sent: a change to the rows in the database does not carry a signature. The statement has one subject, the SHA-256 of a canonical document that holds, in order, every before-job and after-job (its name, its Job and undo Job, its failure policy and its timeout) and every health rule (its group, kind and all three expressions). Job JSON is canonicalized first (keys sorted, numbers and strings written one way, a repeated key refused), so a database that stores JSON as a value and reorders it does not break a signature, and two readers can never read one signed document two ways. The statement's predicate holds the deployment's id and a sequence.

The operator checks the same way it checks a snapshot, with the same mode and the same keys, before anything of the apply starts:

ModeSigned and matchesSigned but changed, signed by an unknown key, or older than the last acceptedUnsigned
enforceRunRefusedRefused, unless there is nothing to run or read (no job and no rule) and signing never began for the deployment
permissiveRunRefusedRun, with a warning, unless signing began for the deployment
offRunRunRun

A pinned operator is always enforce, with the pinned keys alone.

Two rules keep a signature from being undone:

  • A version never goes down. The operator remembers the highest sequence it accepted for each deployment, in the cluster with the deployment's other state, and refuses a set with a lower one. A snapshot may be rolled back to, because an earlier snapshot is still something a deployment may want to run. Jobs and rules are not history: they are the deployment's current configuration, and a rollback runs the current jobs (their undo jobs, in place of the jobs) and never an earlier set. So an old signed set, from before a dangerous job was removed or a rule tightened, is a replay even though every signature on it is genuine. The same version is accepted again, since every apply of unchanged settings sends it. The sequence is the larger of the previous one plus one and the time in microseconds, so a database restored from a backup still signs above what operators have seen once its settings are saved again.
  • A signature is not taken off. Once an operator has accepted a signed set for a deployment, an unsigned one is refused in permissive too, so removing the signature is no way back. For the same reason, running a release of the server that does not sign settings against operators that already accepted a signed set makes them refuse that deployment's applies until the release that signs is back.

The health rules a server sends in its own settings (not a deployment's) carry no signature, so an operator that enforces ignores them.

Settings saved before the install began signing have no signature, and so do their jobs and rules. Signing them is a decision of whoever runs the install, taken once, and not something Wardn does on its own: a signature says that someone who could be trusted looked at the job, and a timer cannot say that. After upgrading to a release that signs, run

kubectl exec -it -n wardn deploy/wardn-wardn-standard-server -- wardn snapshot-keys sign-existing

It lists every deployment, in every organization, whose jobs or health rules are saved without a signature, one block each: for every before and after job, and every undo job, the container images, commands and arguments, the service account and the namespace, for every health rule its kind and expressions, and a digest of exactly what a signature would cover. Read it: the signature says the content was reviewed, and this listing is where that happens. It asks before it signs. --yes signs without asking, for a script, and prints a warning that it signs whatever the database holds right now. Each one is signed with the key that signs snapshots now, at the next version, as Wardn, with an entry in Activity (deployment.delivery_settings_signed). A set is signed only while it is still the set that was listed and still unsigned: a person's save in between keeps its own signature, and a set changed after the listing is left for the next run. A deployment with no jobs and no rules needs nothing and is left alone.

Signing the settings that are already saved trusts what the database holds at that moment. Anyone who could write to the database before then could have put a job there, and it is signed like the rest. Run it right after upgrading, read the list, and do not run it on a database you have reason to doubt. Until it has been run, a deployment whose settings are not signed is refused under enforce with a message that says so.

The context of an apply

Beside the snapshot and the deployment's jobs and rules, the server decides how each apply is carried out: the namespace and the service account the operator acts as, whether it prunes and how large a share of the previous objects a prune may remove, whether cluster-scoped kinds are allowed, whether the apply is a rollback (which runs undo jobs in place of jobs) or removes everything, the namespace it sets up for a pull request's preview, and the inventory of objects a prune works from. It also sends which cluster the command is for, how long a wave may take, the secrets the operator checks, the fields it does not report as drift, and which sync wave each resource is in. A signed job cannot be changed, but without more a compromised server could ask for it to be run as another account in the same cluster, for a rollback's undo jobs to run in a forward apply, for a resource to be applied in an earlier wave than the one Wardn chose, or for drift on a field to be hidden.

These are signed in a third statement (https://wardn.dev/attestations/apply-context/v1), made when the apply is sent, and bound to the deployment, the snapshot, the cluster and the command's own id, which the command's signature covers too. A signed context is good for one command on one cluster: it cannot be put beside another command, and a command cannot be sent with another context. The secret references and drift ignore rules are signed as sets (their order does not matter, a repeat counts once); the waves as their numbers in order, with the SHA-256 of each resource that is in each (what is in a wave is a set); the previous inventory as a set. The operator rebuilds the context from the command it received and refuses one that differs in any field, with the same mode and keys as for the snapshot.

Why a statement of its own, and not a field of the snapshot's or of the jobs'. The snapshot is signed once and used by many applies on many clusters, and it is rolled back to; the rollback flag, a held prune that a person lifted and the inventory differ for every command. The jobs and rules are saved on their own and never carry the namespace, which belongs to the deployment. So only something made as the command is made can cover them all, and it is made by the process that sends the command, with the snapshot key, not by the gateway's transport.

What it protects, and what not. It protects the apply between that process and the operator: a command queue, a relay, a gateway that is not the one that signs, and a replayed context. It does not protect against the values themselves being changed in the database before they are read, as the namespace and the prune share are read from the deployment's own rows when the apply is built: someone who can write those rows and not the secret store still changes what is signed. Keep the service account's permissions narrow, as they are what limit the damage.

How an operator upgrade goes, so that nothing is stopped and nothing is taken back:

Signed contextUnsigned context
Never accepted a signed one for the deploymentVerified; remembered from then onRun with a warning, since the server may be a release that does not sign yet. Refused by an operator that pins its keys.
Accepted a signed one beforeVerifiedRefused, in every mode: a signature taken off is not a server that has not learned to sign

The operator keeps that memory in the cluster with the deployment's other state, as it does the version of the jobs and rules. A deployment's jobs and rules keep their own statement and version rules; an operator that accepted a set of them before keeps accepting the same sets, and the two checks pass or refuse an apply together, remembering nothing unless both pass.

Where the key lives

The signing key is in Wardn's secret store, beside the key commands to operators are signed with. The database holds only its ciphertext, encrypted with WARDN_SECRET_MASTER_KEY, so someone who can change snapshot rows or blobs still cannot sign what they changed. The first process that needs the key makes it; there is nothing to set up.

The gateway sends each operator the public keys and the verification mode in its settings, when it connects and again whenever they change. Operators keep nothing on disk.

What the operator does

The mode is set for the whole install by WARDN_SNAPSHOT_VERIFICATION (the chart value snapshots.verification):

ModeSigned and matchesSigned but changed, or signed by an unknown keyUnsigned
enforceAppliedRefusedRefused
permissiveAppliedRefusedApplied, with a warning in the operator's log
offAppliedAppliedApplied

Left empty, a new install enforces. An install that already had snapshots when it was upgraded to a release that signs starts permissive, so its older snapshots still apply; see below.

A refused snapshot is never partly applied: the operator checks before it touches the cluster. The deployment's sync turns failed, and the deployment's card and page show the reason in the failure alert, for example:

Refused by the cluster's operator: the snapshot's content is not what Wardn signed (resources sent that
Wardn did not sign: 1 of 1; signed resources not sent: 1). Nothing was applied.

The same message is the deployment's syncMessage in GET /api/v1/deployments/{id}/state.

Existing installs

An install upgraded from a release before snapshot signing has snapshots with no signature. Wardn records, the first time it starts on the new release, whether any snapshots existed, and starts that install in permissive mode: every new snapshot is signed and checked, a tampered signed snapshot is refused, and an unsigned old snapshot still applies, with a warning.

Upgrade

Upgrade as usual. Leave snapshots.verification empty. Check the mode in force:

kubectl exec -n wardn deploy/wardn-wardn-standard-server -- wardn snapshot-keys list
Verification: permissive

KEY               CREATED               STATE
3f9a6c0e1b2d4a57  2026-11-15T10:02:11Z  signing

Wait for signed snapshots everywhere

Each deployment gets a signed snapshot the next time it syncs, is promoted or is released. Snapshots made before the upgrade stay unsigned. Under enforce, rolling back or restoring to one of them is refused. A deployment's lifecycle jobs and health rules are signed when its settings are saved, and the controller signs those saved before the upgrade within a minute of it starting, so there is nothing to save by hand (see Lifecycle jobs and health rules).

Turn enforcement on

Once no deployment needs to go back to a snapshot older than the upgrade, set the value and upgrade the release:

snapshots:
  verification: enforce

Operators are told as soon as they reconnect to the restarted server.

permissive cannot tell a snapshot made before the upgrade from one whose signature was removed. Run it only for the transition.

Rotate the key

wardn snapshot-keys manages the keys. It runs where the server runs, with the same configuration, for example through kubectl exec into a server pod. The examples use a wardn-standard release named wardn; with the scale chart, exec into deploy/wardn-wardn-scale-api.

Add a new key

kubectl exec -n wardn deploy/wardn-wardn-standard-server -- wardn snapshot-keys rotate
Added key 81c0d4e7a9f2b365. Operators trust it now; it signs from 2026-11-20T09:05:00Z.

The new key is trusted at once and starts signing five minutes later. In those five minutes every gateway notices it (they look every 30 seconds) and tells its operators, so no operator sees a snapshot signed by a key it has not heard of. Until then the old key keeps signing.

Retire the old key

The old key keeps verifying the snapshots it signed. Retire it when no deployment needs to go back to one of them:

kubectl exec -n wardn deploy/wardn-wardn-standard-server -- wardn snapshot-keys retire 3f9a6c0e1b2d4a57

Retiring forgets the key's private half and stops operators trusting it within a minute. A snapshot only it signed is refused from then on. The key that signs now cannot be retired; rotate first.

Upgrade order

Upgrade the server before you re-install or upgrade operators that pin their command keys. Each command is now signed for the cluster it is sent to, and a pinned operator of this release refuses a command without that signature, so a pinned operator talking to an older server runs nothing. Operators that do not pin are unaffected: they accept a command signed either way.

Pin the key in the operator

By default an operator trusts the keys and the mode its gateway sends. That protects a snapshot from being changed at rest or on the way, but a server that is compromised can send a key of its own and the mode off. To take that decision out of the server's hands, pin the keys in the operator:

kubectl exec -n wardn deploy/wardn-wardn-standard-server -- wardn snapshot-keys public > wardn-snapshots.pub
wardn cluster connect --snapshot-keys-file wardn-snapshots.pub ...

The file becomes the ConfigMap wardn-snapshot-keys in wardn-system, mounted into the operator, which starts with --snapshot-pinned-keys-file (environment WARDN_SNAPSHOT_PINNED_KEYS_FILE). A pinned operator:

  • trusts the keys in the file and no others. Keys the gateway sends are ignored, so a key the server adds does not become trusted;
  • always enforces, from the moment it starts and whatever the gateway says: an unsigned snapshot is refused, and so is one signed by a key that is not pinned;
  • refuses every snapshot, rather than falling back to the server's keys, when the file is missing, empty, holds anything other than ECDSA P-256 public keys, or cannot be read. At start it refuses to run with such a file;
  • refuses an apply whose context (namespace, service account, prune, rollback) is not signed, see The context of an apply.

Commands under the pin

Exec, logs, restarts, test runs, scales and the apply command itself are signed by the server's command key, an Ed25519 key kept in the secret store, and the operator learns its public half from the gateway. Each command is signed for the cluster it is sent to, so a command made for one cluster is refused by another, even one that pins the same key. The file wardn snapshot-keys public writes holds the key too, after the snapshot keys (--snapshot-only leaves it out, for cosign). wardn cluster connect puts the snapshot keys in keys.pem and the command keys in command-keys.pem of the same ConfigMap, so an operator of an earlier release, which reads the first only, is not confused by the second. An operator whose pin file holds a command key (--command-pinned-keys-file, environment WARDN_COMMAND_PINNED_KEYS_FILE):

  • verifies every command under the pinned command keys alone. The key the gateway announces in Welcome is ignored, so a server that is not to be trusted cannot introduce a key of its own, or one that is the snapshot key in another form (a command key is Ed25519, a snapshot key ECDSA, and a file that holds the wrong kind is refused as a whole);
  • refuses every command, with no fallback to the announced key, when the command-key file is missing, empty, damaged or holds another kind of key;
  • refuses a command that is not signed for its cluster, that has no expiry or one more than an hour ahead, and runs each command once: a command that was signed and sent before is refused when it is sent again, though its signature and expiry are good. The operator keeps each id until the command has expired by its own clock and by one that only runs forward, so setting the clock back does not let a command run twice. A restart forgets them, which leaves a replay good for the command's own short expiry. A command that began (a shell that was opening, logs that were being read) is remembered when the connection ends; one the operator received and had not started may be sent again.

A file with snapshot keys and no command key would pin snapshots only and leave commands (exec, restarts, scales) to the key the server announces, so wardn cluster connect refuses it unless --allow-unpinned-commands says that is meant, and an operator started with the snapshot pin and no command pin says so in its log, loudly, each time it starts. Check that wardn snapshot-keys public printed the command key you meant to pin.

Server-sent capabilities cannot widen what the operator offered: the server may enable only what the operator listed in its hello, and --disable-capabilities (wardn cluster connect --disable-capabilities exec,run-tests) takes capabilities off that list for good. The ones to name are apply, detect-drift, run-tests, exec and logs. Restarts and scales ride on apply: leave apply out to stop them. A pinned install that does not want the server to open a terminal in a pod, even one signed by a key it pinned, disables exec there; one that does not want logs read disables logs.

To rotate a command key, stage the new one, put it in every pin file, and then promote it:

kubectl exec -n wardn deploy/wardn-wardn-standard-server -- wardn snapshot-keys stage-command-key
kubectl exec -n wardn deploy/wardn-wardn-standard-server -- wardn snapshot-keys public > wardn-snapshots.pub   # lists both command keys
wardn cluster connect --snapshot-keys-file wardn-snapshots.pub ...   # or edit the ConfigMap
kubectl exec -n wardn deploy/wardn-wardn-standard-server -- wardn snapshot-keys promote-command-key

Gateways read the command key when they start, so restart them after promoting. Take the old key out of the pin files when the commands it signed have expired: an apply command lives fifteen minutes, the others up to an hour, so after an hour.

To rotate a pinned key, add the new key to the file before the server starts signing with it, and remove the old one when no deployment needs a snapshot it signed (wardn snapshot-keys public prints every trusted key; put the lines you want to keep in the file). Edit the ConfigMap, or run wardn cluster connect again with the new file. The operator re-reads the file every few seconds, and the kubelet refreshes a mounted ConfigMap within a minute or so, so nothing restarts. A key removed from the file stops being trusted at once, and that cannot be reversed by the server.

Pinning stops a server from changing who may sign. It does not stop a compromised server that can read the signing keys from signing with them: they live in the server's secret store, protected by WARDN_SECRET_MASTER_KEY. The signatures cover a snapshot's resources, a deployment's jobs and health rules, and the context of each apply as it is sent; they do not cover the values of that context being changed in the database before they are read. Treat the pin as one layer; it does not replace limiting what the server can reach. A signed snapshot that is older than the current one also still verifies, as a rollback must, and so does a snapshot made before the install signed the context of applies, with whatever namespace the server then asks for; rotate the signing key and retire the old one to cut those off. An older set of jobs and rules does not verify. A pin file with no command key leaves commands to the key the server announces.

Check a snapshot with cosign

wardn snapshot-keys public --snapshot-only prints the trusted snapshot keys as PEM. With a snapshot's signature envelope and one of its resources, as stored, cosign checks that the resource is part of what Wardn signed:

kubectl exec -n wardn deploy/wardn-wardn-standard-server -- wardn snapshot-keys public --snapshot-only > wardn-snapshots.pub
cosign verify-blob-attestation --key wardn-snapshots.pub --insecure-ignore-tlog=true \
  --type https://wardn.dev/attestations/snapshot/v1 --signature envelope.json resource.json

--insecure-ignore-tlog is needed because the signature is checked against your install's own key, not a public transparency log. A changed resource fails with no matching subject digest found.

Settings

SettingChart valueDefault
WARDN_SNAPSHOT_VERIFICATIONsnapshots.verificationEmpty: enforce on a new install, permissive on one that had snapshots before signing

The secret store must be on (WARDN_SECRET_MASTER_KEY), as it already must be for the gateway.

On this page