Repository navigation
Description
What happens
When the auth server uses Redis storage, editing a SPIFFE client association and restarting fails startup:
client "<id>" is already registered as a different configured client
(SPIFFE-reserved clients must match exactly; delete the stored client key
immediately before the rollout)
In Kubernetes the new pod never becomes Ready and the rollout stays stuck. The workaround is to delete the stored placeholder row by hand, immediately before the rollout:
<keyPrefix>client:<clientID>
For an operator-managed server the prefix is thv:auth:{<namespace>:<name>}:. The braces are literal. While the row is gone, the client ID is open to dynamic client registration, so the delete has to happen right before the rollout.
What trips it: any edit to the association's scopes, audiences, resources, principal pattern, methods, or trust-domain reference. Renaming the trust-domain reference counts, because the reference is part of the identity hash. Edits the placeholder does not store, such as grant types or a trust domain's bundle source, do not trip it.
SPIFFE client authentication is not enforced in this build yet, so nobody can hit this today. It will matter once #6199 lands.
Why it works this way
The placeholder row is not used to authorize anything. SPIFFE clients are served from each replica's in-process overlay, built from that replica's config. The row only reserves the client ID, so DCR cannot take it.
The strict check is on purpose. The #6473 review asked for scopes, audiences and RFC 8707 resources in the placeholder fingerprint, because two replicas with different resource allowlists would otherwise look identical during a rolling policy change. Association identity was added to the same contract.
Delegate clients used to share this check by accident. They now replace their row on restart (#6906), and SPIFFE placeholders keep the strict check.
Expected
An operator can edit a SPIFFE association without deleting a Redis key by hand, and without opening a window where the client ID can be registered through DCR.
Options
- Keep the strict check and add tooling or an operator step that does the delete safely, for example a one-shot job that runs before the rollout.
- Let the row be replaced when the new association is a deliberate, validated edit, and keep refusing true collisions (another client's ID, or a different trust domain at the same ID). This needs a way to tell an edit from a collision without weakening what the Normalize canonical inbound grants #6473 review asked for.
- Version the row, so two replicas at different config versions can coexist during a rollout.
Notes
- Documented in
docs/arch/18-spiffe-association-declarations.md. - Related: Normalize canonical inbound grants #6473, Register and harden static SPIFFE clients #6474, Embedded auth server should accept SPIFFE SVIDs as client credentials #6199, Changing a delegate client's scopes or audiences on Redis storage fails startup #6906. The removal side of the same rows (a dropped association's placeholder is never deleted) is Stale operator-declared OAuth clients are never removed from durable storage #6477.
Activity