vault: move openbao plugin sockets off /tmp onto /run #509
Reference in New Issue
Block a user
Delete Branch "benvin/vault-plugin-tmpdir"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
The litellm secrets engine on the OpenBao cluster died with
rpc Unavailable / dial unix /tmp/pluginNNN: no such file(terraform-vault#112), fixed only by a manualsys/plugins/reload/backend.Root cause (post-incident log audit): go-plugin puts each plugin's control socket under the process TMPDIR —
/tmp/pluginNNN— andvault.serviceruns without PrivateTmp. The dailysystemd-tmpfiles-cleanreaps aged/tmpfiles; bao ran a single systemd invocation for 3+ weeks, so the socket long outlived the/tmpcleanup age and got deleted out from under the still-running plugin process (no panic/OOM/signal/exit in the bao journal — the process was healthy, just unreachable). The risk is shared by every OpenBao plugin (gpg, rancher, gitea, ...), not just litellm.Supersedes the earlier tmpfiles-exclude approach (#508, closed) with the permanent fix: move the sockets off
/tmpentirely.Change
vault.servicedrop-in (systemd::manage_dropin) that setsEnvironment=TMPDIR=/run/vault-pluginsandRuntimeDirectory=vault-plugins(mode 0700)./run(tmpfs, no age-based cleanup);RuntimeDirectorycreates/owns the dir per service start./run.Heads-up
Puppet rolls a bao restart per node when this lands (the drop-in notifies
Service['vault']). With auto-unseal (this cluster runsprofiles::vault::unseal) it is a rolling non-event; if any node relies on manual unseal it will come back sealed and need unsealing. Merge consciously / stagger if needed.https://claude.ai/code/session_01JUoARVdmhxKQHyyyp1pxeT