Skip to content
Workload and AI agent identity · Chapter 9 of 20 Day 8: Short lifetimes and rotation – new badges, a new stamp

Day 8: Short lifetimes and rotation – new badges, a new stamp

Goal: watch how SPIRE renews badges on its own, switch the trust domain’s CA by hand without dropping a connection, and see whom an outdated bundle locks out · Duration: about 90 min, 30 min of which is waiting · Prerequisite: Day 7 completed

Where we start

# on id1
kubectl exec -n laden einkauf -c shell -- curl -sS http://127.0.0.1:8080/

Expected:

Lagerbestand: 42 Kisten
# on id1
kubectl logs -n laden werkstatt --tail=7

Expected (your times will differ):

SPIFFE ID:      spiffe://gebaeude.test/laden/werkstatt
SVID Valid After:   2026-12-01 11:03:46 +0000 UTC
SVID Valid Until:   2026-12-01 12:03:56 +0000 UTC
CA #1 Valid After:  2026-12-01 10:56:49 +0000 UTC
CA #1 Valid Until:  2026-12-02 10:56:59 +0000 UTC

Note down the time after SVID Valid After.

Introduction

Short lifetimes are the most important safeguard in this course: a stolen badge is worthless after one hour. But short lifetimes come at a price. Someone has to renew the badges – constantly, for every service, without any service going down in the process. With static secrets, rotation is a dreaded project; Day 1 showed how easily something goes wrong.

Today you will see that with SPIFFE, rotation is not a project but routine. First you simply wait and watch. Then you switch the HR department’s stamp yourself – the CA – in four steps, while purchasing keeps querying stock. And finally you find the one place where a CA rotation does lock someone out.

Today you will learn:

  • when an agent renews workload SVIDs and its own SVID,
  • that ghostunnel picks up new certificates without dropping a connection,
  • the four steps of a CA rotation: prepare, activate, taint, revoke,
  • why time has to pass between prepare and activate,
  • why a bundle that sits somewhere as a file becomes a trap at every rotation.

Background

The picture for today: new badges and a new stamp

The HR department issues staff badges for one hour. The gatekeepers do not wait until a badge expires: after about half the time they fetch a new one for every employee and place it at the counter. Whoever asks gets the new one. The gatekeeper also wears a badge, and they swap it in good time too.

Less often, but more importantly: the HR department gets a new stamp. If it simply started using it, all doors would take the new badges for forgeries – they only know the specimen card of the old stamp. That is why it happens in four steps:

  1. Prepare: The new stamp is made and its specimen card is hung next to the old one. Stamping is still done with the old one.
  2. Switch over: From now on, stamping is done with the new one. Old badges remain valid.
  3. Recall old badges: The HR department declares the old stamp “used up”. All gatekeepers immediately swap every badge that still carries the old stamp.
  4. Take down the old specimen card: From now on, only the new stamp is valid.

And then there are the gatekeepers who are just starting: on their first day they are handed a specimen card so they can recognize the HR department. If it is still the old one, they take the real HR department for an impostor.

The terms

Term Meaning in the picture
Rotation replacing a badge or key before it expires swapping a badge
X.509 authority a CA the SPIRE server uses to sign X.509-SVIDs stamp
prepared new CA created and in the bundle, but not signing yet new stamp ready, specimen card hung up
active the CA that signs stamp in use
tainted old CA whose badges the agents should replace immediately “used up”
revoked old CA removed from the bundle specimen card taken down
Bootstrap bundle bundle an agent uses to recognize the server on its first start specimen card on the first working day

Remember: First hang up the specimen card, then stamp with the new stamp, then recall the old badges, and finally take down the old specimen card. Any other order locks someone out.

Drill 1: Watching badges renew themselves

Where you are: on id1.

What you have afterwards: measured times at which workload and agent SVIDs were renewed – and proof that mTLS keeps running meanwhile.

Step 1 – working folder, then wait.

# on id1
mkdir -p ~/kurs/08

The workshop SVID is valid for one hour. Wait until at least 35 minutes have passed since SVID Valid After. Check the time with:

# on id1
date -u +%T

Step 2 – the workshop has kept a record. api watch prints every new SVID it receives:

# on id1
kubectl logs -n laden werkstatt --since=40m

Expected (excerpt – the last two blocks):

Received 1 svid after 5m25.649481968s

SPIFFE ID:      spiffe://gebaeude.test/laden/werkstatt
SVID Valid After:   2026-12-01 11:03:46 +0000 UTC
SVID Valid Until:   2026-12-01 12:03:56 +0000 UTC
CA #1 Valid After:  2026-12-01 10:56:49 +0000 UTC
CA #1 Valid Until:  2026-12-02 10:56:59 +0000 UTC

Received 1 svid after 28m15.259435426s

SPIFFE ID:      spiffe://gebaeude.test/laden/werkstatt
SVID Valid After:   2026-12-01 11:32:04 +0000 UTC
SVID Valid Until:   2026-12-01 12:32:14 +0000 UTC
CA #1 Valid After:  2026-12-01 10:56:49 +0000 UTC
CA #1 Valid Until:  2026-12-02 10:56:59 +0000 UTC

What you see: The first SVID was issued at 11:03:56 (Valid After is ten seconds earlier), the second at 11:32:14 – after a good 28 minutes, when the old one would still have been valid for half an hour. The workshop did nothing for this; the agent sent the new SVID over the open channel.

Step 3 – what the gatekeeper noted about it.

# on id1
kubectl logs -n spire daemonset/spire-agent --since=40m

Expected (excerpt – look for Renewing X509-SVID and Successfully reattested node):

time="2026-12-01T11:26:29Z" level=info msg="Successfully reattested node" spiffe_id="spiffe://gebaeude.test/spire/agent/k8s_psat/labor/4bee6d80-8467-4725-92f0-65fcf0151197" subsystem_name=manager
time="2026-12-01T11:31:35Z" level=info msg="Renewing X509-SVID" entry_id=f95f5c2a-2a3f-415b-ab78-8a117a57bd2e expires_at="2026-12-01T12:03:55Z" spiffe_id="spiffe://gebaeude.test/laden/werkstatt" subsystem_name=manager
time="2026-12-01T11:39:03Z" level=info msg="Renewing X509-SVID" entry_id=3e92c54b-6085-4438-b469-f8e19357636e expires_at="2026-12-01T12:11:47Z" spiffe_id="spiffe://gebaeude.test/laden/einkauf" subsystem_name=manager
time="2026-12-01T11:40:12Z" level=info msg="Renewing X509-SVID" entry_id=35bb4881-fd63-48f1-a636-f5b3a65fa626 expires_at="2026-12-01T12:11:47Z" spiffe_id="spiffe://gebaeude.test/laden/lager-api" subsystem_name=manager

With daemonset/, kubectl picks one of the two agent pods; here it was the one on id1.

Badge in the cache of the agent on id1 issued renewed after
the agent’s own SVID 10:59:15 11:26:29 27 min
entry laden/werkstatt 11:03:55 11:31:35 28 min
entry laden/einkauf 11:11:47 11:39:03 27 min
entry laden/lager-api 11:11:47 11:40:12 28 min

Every agent keeps badges ready for all entries of its alias, even for pods on the other node. That is why the workshop on id2 got its new SVID from the agent on id2, at 11:32:14.

What you see: Every badge is replaced after just under half of its lifetime – with a few minutes of randomness so that not everyone knocks on the server’s door at the same time. The agent itself also re-registers with its building badge (“reattested”).

Step 4 – and the connection?

# on id1
step certificate inspect --short --insecure https://10.42.1.16:8443

Take the pod IP of lager-api from kubectl get pod lager-api -n laden -o wide.

Expected:

X.509v3 TLS Certificate (ECDSA P-256) [Serial: 1451...1921]
  Subject:     spiffe://gebaeude.test/laden/lager-api
  Issuer:      
  Valid from:  2026-12-01T11:39:00Z
          to:  2026-12-01T12:39:10Z

On Day 7 the warehouse showed a card with serial number 3307…1442, valid until 12:11. Now it is a new one.

# on id1
kubectl exec -n laden einkauf -c shell -- curl -sS http://127.0.0.1:8080/

Expected:

Lagerbestand: 42 Kisten
# on id1
kubectl logs -n laden lager-api -c tunnel --since=40m

Expected (excerpt): only the connections from Day 7 and error messages such as error on TLS handshake from 10.42.0.0:38584: tls: client didn't provide a certificate – these come from your step certificate inspect, which shows no client certificate. There is no entry about the certificate change.

What you see: ghostunnel picked up the new card without restarting and without reporting it. The promise from Day 7 holds.

Remember: Rotation without lifting a finger: the agent renews every badge after about half its lifetime, and the programs receive it over the open connection to the Workload API. Nobody restarts anything.

Save your progress? Sign up for free

Drill 2: Preparing the new stamp

Where you are: on id1.

What you have afterwards: a second CA that is in the bundle but does not sign yet.

The server’s CA is valid for 24 hours (ca_ttl). SPIRE would switch it on its own in good time. You do it by hand now with the localauthority commands, step by step.

Step 1 – the current state.

# on id1
sudo -u spire /opt/spire/bin/spire-server localauthority x509 show -socketPath /run/spire-server/api.sock

Expected:

Active X.509 authority:
  Authority ID: 6be88c932045a0a8fa2e69c59f43b65125dff28f
  Expires at: 2026-12-02 10:56:59 +0000 UTC
  Upstream authority ID: No upstream authority

Prepared X.509 authority:
  No prepared X.509 authority found

Old X.509 authority:
  No old X.509 authority found

You know the Authority ID from the server log of Day 5 (local_authority_id=6be88c93…). Three slots: active, prepared, old.

Step 2 – prepare.

# on id1
sudo -u spire /opt/spire/bin/spire-server localauthority x509 prepare -socketPath /run/spire-server/api.sock

Expected:

Prepared X.509 authority:
  Authority ID: 292d521303bf62f21f1ba5e8f65ef2698e7efa37
  Expires at: 2026-12-02 11:41:40 +0000 UTC
  Upstream authority ID: No upstream authority

Note down both Authority IDs – you will need them shortly.

Step 3 – two specimen cards.

# on id1
sudo -u spire /opt/spire/bin/spire-server bundle show -socketPath /run/spire-server/api.sock > ~/kurs/08/bundle-zwei.crt
# on id1
grep -c "BEGIN CERTIFICATE" ~/kurs/08/bundle-zwei.crt

Expected:

2

Step 4 – has word got around?

# on id1
kubectl logs -n laden werkstatt --tail=8

Expected:

SPIFFE ID:      spiffe://gebaeude.test/laden/werkstatt
SVID Valid After:   2026-12-01 11:32:04 +0000 UTC
SVID Valid Until:   2026-12-01 12:32:14 +0000 UTC
CA #1 Valid After:  2026-12-01 10:56:49 +0000 UTC
CA #1 Valid Until:  2026-12-02 10:56:59 +0000 UTC
CA #2 Valid After:  2026-12-01 11:41:30 +0000 UTC
CA #2 Valid Until:  2026-12-02 11:41:40 +0000 UTC

What you see: The same SVID as before, but the bundle now has two CAs. From now on the workshop – and every other program on the Workload API – would accept badges with either stamp.

Remember: prepare only hangs up the specimen card. Between prepare and activate, time must pass until every verifier has the new card – seconds in the lab, minutes in large environments.

Save your progress? Sign up for free

Drill 3: Switching over and recalling old badges

Where you are: on id1.

What you have afterwards: an active new CA and workload SVIDs that all come from it.

Step 1 – stamp with the new stamp.

# on id1
sudo -u spire /opt/spire/bin/spire-server localauthority x509 activate -authorityID 292d521303bf62f21f1ba5e8f65ef2698e7efa37 -socketPath /run/spire-server/api.sock

Expected:

Activated X.509 authority:
  Authority ID: 292d521303bf62f21f1ba5e8f65ef2698e7efa37
  Expires at: 2026-12-02 11:41:40 +0000 UTC
  Upstream authority ID: No upstream authority
# on id1
sudo -u spire /opt/spire/bin/spire-server localauthority x509 show -socketPath /run/spire-server/api.sock

Expected:

Active X.509 authority:
  Authority ID: 292d521303bf62f21f1ba5e8f65ef2698e7efa37
  Expires at: 2026-12-02 11:41:40 +0000 UTC
  Upstream authority ID: No upstream authority

Prepared X.509 authority:
  No prepared X.509 authority found

Old X.509 authority:
  Authority ID: 6be88c932045a0a8fa2e69c59f43b65125dff28f
  Expires at: 2026-12-02 10:56:59 +0000 UTC
  Upstream authority ID: No upstream authority

What you see: The new CA is active, the old one is “old”. New badges get the new stamp; those already issued still carry the old one and would stay in use until their normal renewal.

Step 2 – recall old badges. Don’t wait – swap them immediately:

# on id1
sudo -u spire /opt/spire/bin/spire-server localauthority x509 taint -authorityID 6be88c932045a0a8fa2e69c59f43b65125dff28f -socketPath /run/spire-server/api.sock

Expected:

Tainted X.509 authority:
  Authority ID: 6be88c932045a0a8fa2e69c59f43b65125dff28f
  Expires at: 2026-12-02 10:56:59 +0000 UTC
  Upstream authority ID: No upstream authority

Take the name of the agent pod on id2 from kubectl get pods -n spire -o wide:

# on id1
kubectl logs -n spire spire-agent-jh8k9 --since=5m

Expected (excerpt):

time="2026-12-01T11:42:09Z" level=info msg="Agent SVID is tainted by a root authority, forcing rotation" subsystem_name=manager
time="2026-12-01T11:42:09Z" level=info msg="Tainted X.509 SVIDs" subsystem_name=cache_manager tainted_x509_svids=4
time="2026-12-01T11:42:09Z" level=info msg="Finished processing all tainted entries" subsystem_name=cache_manager
time="2026-12-01T11:42:09Z" level=info msg="Creating X509-SVID" entry_id=f95f5c2a-2a3f-415b-ab78-8a117a57bd2e spiffe_id="spiffe://gebaeude.test/laden/werkstatt" subsystem_name=manager
time="2026-12-01T11:42:09Z" level=info msg="Creating X509-SVID" entry_id=35bb4881-fd63-48f1-a636-f5b3a65fa626 spiffe_id="spiffe://gebaeude.test/laden/lager-api" subsystem_name=manager
time="2026-12-01T11:42:09Z" level=info msg="Creating X509-SVID" entry_id=5473a239-6422-4b43-904a-3ce32b26e550 spiffe_id="spiffe://gebaeude.test/laden/inventur" subsystem_name=manager
time="2026-12-01T11:42:09Z" level=info msg="Creating X509-SVID" entry_id=3e92c54b-6085-4438-b469-f8e19357636e spiffe_id="spiffe://gebaeude.test/laden/einkauf" subsystem_name=manager
time="2026-12-01T11:42:14Z" level=info msg="Successfully reattested node" spiffe_id="spiffe://gebaeude.test/spire/agent/k8s_psat/labor/52aba4e0-1660-4c14-a9a5-209b4671bd08" subsystem_name=manager

What you see: One second after taint, the agent marked all four badges in its cache as used up and issued new ones, and five seconds later it re-registered itself. No badge with the old stamp is in circulation any more.

Step 3 – which specimen card fits now? As on Day 6, you fetch the workshop’s SVID as a file:

# on id1
kubectl exec -n laden werkstatt -- /opt/spire/bin/spire-agent api fetch x509 -socketPath /run/spire/sockets/agent.sock -output json > ~/kurs/08/werkstatt.json
# on id1
jq -r '.svids[0].x509_svid' ~/kurs/08/werkstatt.json > ~/kurs/08/werkstatt.b64
# on id1
rm ~/kurs/08/werkstatt.json
# on id1
base64 -d ~/kurs/08/werkstatt.b64 > ~/kurs/08/werkstatt.der
# on id1
step certificate format ~/kurs/08/werkstatt.der > ~/kurs/08/werkstatt.crt

Against the bundle from Day 5, which only knows the old CA:

# on id1
step certificate verify ~/kurs/08/werkstatt.crt --roots ~/kurs/05/bundle.crt

Expected:

failed to verify certificate: x509: certificate signed by unknown authority

Against the bundle with both CAs:

# on id1
step certificate verify ~/kurs/08/werkstatt.crt --roots ~/kurs/08/bundle-zwei.crt

Expected: no output – valid.

Step 4 – and the connection?

# on id1
kubectl exec -n laden einkauf -c shell -- curl -sS http://127.0.0.1:8080/

Expected:

Lagerbestand: 42 Kisten

Remember: activate switches the stamp for new badges, taint recalls the old ones immediately. Anyone who verifies with a file containing the old bundle will from now on take genuine badges for forgeries.

Save your progress? Sign up for free

Drill 4: Taking down the old specimen card

Where you are: on id1.

What you have afterwards: a bundle with only the new CA.

# on id1
sudo -u spire /opt/spire/bin/spire-server localauthority x509 revoke -authorityID 6be88c932045a0a8fa2e69c59f43b65125dff28f -socketPath /run/spire-server/api.sock

Expected:

Revoked X.509 authority:
  Authority ID: 6be88c932045a0a8fa2e69c59f43b65125dff28f
  Expires at: 1970-01-01 00:00:00 +0000 UTC
  Upstream authority ID: No upstream authority
# on id1
sudo -u spire /opt/spire/bin/spire-server bundle show -socketPath /run/spire-server/api.sock > ~/kurs/08/bundle-neu.crt
# on id1
step certificate inspect --short ~/kurs/08/bundle-neu.crt

Expected:

X.509v3 Root CA Certificate (ECDSA P-256) [Serial: 1645...1714]
  Subject:     spiffe://gebaeude.test
  Issuer:      
  Valid from:  2026-12-01T11:41:30Z
          to:  2026-12-02T11:41:40Z
# on id1
kubectl exec -n laden einkauf -c shell -- curl -sS http://127.0.0.1:8080/

Expected:

Lagerbestand: 42 Kisten

What you see: One certificate in the bundle, valid from 11:41:30. The rotation is complete, and purchasing did not miss a single response at any moment.

Remember: After revoke the old stamp no longer exists – not even in files you have forgotten about. That is exactly where the next error lurks.

Save your progress? Sign up for free

Diagnosis task

After the rotation, the agent on id2 restarts – a node update, a pod that fell over, simulated here:

# on id1
kubectl delete pod -n spire spire-agent-jh8k9

The new agent pod is running, 1/1 Running. But it has not registered, and programs on id2 get no new badges from it. What is going on?

Solution path:

  1. As on Day 5: first the agent itself must have a badge. So check its logs (name from kubectl get pods -n spire -o wide):

    # on id1
    kubectl logs -n spire spire-agent-mnrkg --tail=6

    Expected (excerpt, wrapped):

    level=info msg="SVID is not found. Starting node attestation" …
    level=info msg="Trust Bundle and Server don't agree, bootstrapping again"
    level=warning msg="Failed to retrieve attestation result" error="could not open attestation stream
      to SPIRE server: rpc error: code = Unavailable desc = connection error: desc = \"transport:
      authentication handshake failed: x509svid: could not verify leaf certificate: x509: certificate
      signed by unknown authority\"" retry_interval=16.888382294s
  2. This time it is not the check of the building badge that fails but the connection itself: the agent does not recognize the server. The server shows a card with the new stamp, while the agent only has the specimen card from the ConfigMap spire-bundle – and that is from Day 5.

  3. Running agents were not bothered by this: they had a connection and received the new bundle over it. Only an agent that starts fresh reads the bootstrap bundle.

  4. Solution: Replace the ConfigMap with the current bundle:

    # on id1
    kubectl delete configmap spire-bundle -n spire
    # on id1
    kubectl create configmap spire-bundle -n spire --from-file=bundle.crt=$HOME/kurs/08/bundle-neu.crt

    The agent retries every few seconds anyway, and the kubelet updates the file in the pod on its own. In the lab it took two seconds:

    # on id1
    kubectl logs -n spire spire-agent-mnrkg --since=3m

    Expected (excerpt):

    time="2026-12-01T11:43:46Z" level=info msg="Node attestation was successful" reattestable=true spiffe_id="spiffe://gebaeude.test/spire/agent/k8s_psat/labor/52aba4e0-1660-4c14-a9a5-209b4671bd08" subsystem_name=attestor trust_domain_id="spiffe://gebaeude.test"
    time="2026-12-01T11:43:46Z" level=info msg="Starting agent APIs" address=/run/spire/agent-sockets/agent.sock apis="Workload and SDS APIs" network=unix subsystem_name=endpoints
  5. Test:

    # on id1
    kubectl exec -n laden werkstatt -- /opt/spire/bin/spire-agent api fetch x509 -socketPath /run/spire/sockets/agent.sock

    Expected (excerpt):

    Received 1 svid after 97.068362ms
    
    SPIFFE ID:       spiffe://gebaeude.test/laden/werkstatt
    CA #1 Valid After:   2026-12-01 11:41:30 +0000 UTC

The lesson: every copy of a bundle that is not updated automatically is a time bomb with the lifetime of the CA. In the lab it was a ConfigMap; in real life it is often a file on a server that nobody remembers any more.

Challenge

You switched the X.509 stamp. Is there a second stamp that was not affected by this? Find it and show that it has not changed. Write down the commands before you read the solution.

Solution: The server signs the JWT-SVIDs from Day 6 with a separate key. It has its own localauthority:

# on id1
sudo -u spire /opt/spire/bin/spire-server localauthority jwt show -socketPath /run/spire-server/api.sock

Expected:

Active JWT authority:
  Authority ID: cekS4loWO9C1NoD4PUhYoGmXFYxB0BW3
  Expires at: 2026-12-02 10:56:59 +0000 UTC

Prepared JWT authority:
  No prepared JWT authority found

Old JWT authority:
  No old JWT authority found
# on id1
sudo -u spire /opt/spire/bin/spire-server bundle show -format spiffe -socketPath /run/spire-server/api.sock > ~/kurs/08/bundle.jwks
# on id1
jq '.keys[] | {use, kid}' ~/kurs/08/bundle.jwks

Expected:

{
  "use": "x509-svid",
  "kid": null
}
{
  "use": "jwt-svid",
  "kid": "cekS4loWO9C1NoD4PUhYoGmXFYxB0BW3"
}

The same kid as on Day 6. JWT key and X.509 CA have separate lifecycles; you switch the JWT side the same way with localauthority jwt prepare/activate/taint/revoke.

Save your progress? Sign up for free

Checkpoint

# on id1
sudo -u spire /opt/spire/bin/spire-server localauthority x509 show -socketPath /run/spire-server/api.sock

Expected (excerpt): Active X.509 authority with Authority ID: 292d5213…. Under Old X.509 authority the old ID is still listed as an entry; it has been removed from the bundle.

# on id1
kubectl exec -n laden einkauf -c shell -- curl -sS http://127.0.0.1:8080/

Expected:

Lagerbestand: 42 Kisten

Test yourself

  1. After how much time does the agent renew an SVID with a one-hour lifetime, and why not just before it expires?
  2. Why does prepare add the new CA to the bundle without signing with it?
  3. What happens if you run activate and taint right after prepare, and a verifier does not have the new bundle yet?
  4. Why taint, if the old badges would be renewed within an hour at the latest anyway?
  5. Running agents survived the rotation, a freshly started one did not. Why?
  6. Which copies of a bundle exist in your lab, and which of them are updated automatically?

Answers:

  1. After about half, measured at 27 to 28 minutes. If the server fails, there is still half an hour left during which all badges are valid – enough time to bring it back up.
  2. So that every verifier has the new specimen card before the first badge with the new stamp appears. Otherwise it would take genuine new badges for forgeries.
  3. The verifier rejects the new badges with “certificate signed by unknown authority” until it has the new bundle. For programs on the Workload API that is seconds; for copies in files it lasts until someone replaces them.
  4. For the case where the old CA is compromised. Then no badge with its stamp should live on for another hour, and only after that can revoke remove it from the bundle.
  5. Running agents receive the new bundle over their existing connection to the server. A new agent has none and must trust the server using the bootstrap bundle from the ConfigMap – which was outdated.
  6. Automatically: the bundle in every agent and in every program on the Workload API (workshop, ghostunnel). Not automatically: the ConfigMap spire-bundle, ~/kurs/05/bundle.crt and everything you copied by hand.

Interview note

“How do you rotate the CA of a SPIFFE trust domain without downtime?” – Good answer: in four phases. Prepare the new CA and add it to the bundle, wait until all verifiers have it, then activate it, mark the old one as tainted so that agents immediately replace all SVIDs it signed, and finally revoke it, which removes it from the bundle. SPIRE does this without intervention at every CA change; you need the manual way in an emergency. The trap is static bundle copies: the agents’ bootstrap bundle, bundles in files at verifiers without the Workload API, and federation partners. So distribute bootstrap bundles automatically or fetch them via trust_bundle_url.

Enterprise note

In production you do not rotate the CA by hand; you let SPIRE do it: the next CA is prepared after part of the lifetime and activated in good time. If SPIRE sits under a corporate PKI (UpstreamAuthority), the root stays stable and only the intermediate CA changes – then the bundle changes much less often.

taint and revoke by hand are for emergencies: a compromised CA key. Practice the procedure before you need it – and write down everywhere bundle copies live. For the agents’ bootstrap bundle there are two clean ways: the k8sbundle notifier, which updates the ConfigMap on every change, or trust_bundle_url with a bundle endpoint that the agent trusts via web PKI.

Summary

  • Agents renew workload SVIDs and their own SVID after about half the lifetime; programs on the Workload API receive the new SVID without a restart.
  • ghostunnel swaps its certificate silently; mTLS keeps running.
  • CA rotation by hand: prepare (new CA into the bundle), activate (new CA signs), taint (replace old SVIDs immediately), revoke (old CA out of the bundle).
  • After taint, the agent reissued all workload SVIDs within one second.
  • An agent that restarts after the rotation fails because of an outdated bootstrap bundle in the ConfigMap; replacing the ConfigMap fixes it in seconds.
  • JWT key and X.509 CA have separate lifecycles.

Commands at a glance

Command What for
kubectl logs <pod> --since=40m output of the last 40 minutes
spire-server localauthority x509 show active, prepared and old CA
spire-server localauthority x509 prepare create a new CA and add it to the bundle
spire-server localauthority x509 activate -authorityID <id> sign with the new CA
spire-server localauthority x509 taint -authorityID <id> have all SVIDs of the old CA replaced immediately
spire-server localauthority x509 revoke -authorityID <id> remove the old CA from the bundle
spire-server localauthority jwt show state of the JWT keys
kubectl create configmap <name> --from-file=<key>=<datei> ConfigMap from a file

Contents

More