web role: rotating a podman secret reports success but does not restart the container #274
Etiketter
Inga etiketter
area/backups
area/ci
area/control-panel
area/identity
area/infra
area/observability
area/payments
area/security
area/storage
area/web
blocked
needs-info
needs-triage
ready-for-implementation
type
bug
type
chore
type
docs
type
epic
type
feature
type
task
wontfix
Ingen milstolpe
Inget projekt
Inga tilldelade
1 deltagare
Notiser
Förfallodatum
Inget förfallodatum satt.
Beroenden
Inga beroenden satta
Referens
bitborg/bitborg-infra#274
Läser in…
Hänvisa till i nytt ärende
Ingen beskrivning angiven.
Ta bort grenen "%!s()"
Borttagning av en gren är permanent. Även om den borttagna grenen kan fortsätta existera en kort tid innan den faktiskt tas bort, kan det INTE ångras i de flesta fall. Vill du fortsätta?
Rotating any of the web role's podman secrets reports
changedand does not restart thecontainer, so the running service keeps using the old value while Ansible reports success.
Observed
During the Sweego API key rotation (#273) the apply produced:
PLAY RECAP … changed=1 failed=0— a clean, successful-looking apply. But podman injects secretsinto the container environment at container creation, so the process was still running with the
previous key. The rotation only took effect after an explicit
systemctl --user restart bitborg-web.Cause
roles/web/tasks/main.yml:295keys the restart on two conditions, neither of which a secretrotation satisfies:
startedis a no-op on a running service. The unit file is unchanged because the web secrets usestatic names, so rotating the secret's content leaves the unit byte-identical.
Why forgejo is not affected
The forgejo role embeds a content hash in the secret name, so a value change renames the secret,
which rewrites the unit, which trips
web_unit is changed:That is the pattern the web role is missing.
Scope
All seven web secrets are affected, not just the mail key:
DATABASE_URL· Kanidm provision token · Sweego API key · sign-up preview token · Cap captchasecret · OIDC client secret · session signing secret
The consequences differ in severity but share the failure mode — a rotation that appears to
succeed and silently does not apply. For a credential being rotated deliberately, "Ansible said
changed" is not evidence the old value is out of service. Any past web-secret rotation should be
re-verified rather than assumed effective.
Aggravating factor: check mode cannot see it
Create the web … podman secretreportsskippingunder--check, because podman commands do notrun in check mode. So a dry-run shows neither the rotation nor its absence — the pre-apply gate is
structurally blind here, which is worth a comment in the role even after the fix.
Options
changes → restart. Consistent with existing code, no new mechanism. Downside: orphaned old
secrets accumulate unless pruned.
name churn, but adds a second restart trigger alongside the inline
state:expression, so thetwo must be kept coherent.
all seven, so any rotation changes the unit exactly once.
Option 1 is the most consistent with the codebase; option 3 is tidier if orphan pruning is a
concern.
Done when
Rotating any web podman secret causes the container to be recreated in the same apply, and a test
proves the running process observes the new value.