You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Non-breaking hardening + reliability for the Vaultwarden deployment:
Pin the image to a specific release instead of :latest (shown as vaultwarden/server:1.32.7 — set it to whichever release you run), so a pod
restart can't silently change versions.
Add resource requests/limits (CPU, memory, ephemeral-storage) — the pod
currently has none.
Add liveness and readiness probes (liveness: TCP :80; readiness: HTTP /alive on :80, Vaultwarden's documented unauthenticated health endpoint).
Add a container securityContext: allowPrivilegeEscalation: false,
all capabilities dropped with only NET_BIND_SERVICE added back (Vaultwarden
binds :80), and seccomp RuntimeDefault.
Why
This stores credentials, so defense-in-depth matters: no privilege escalation
and a near-empty capability set cost nothing here. Probes let Kubernetes
restart a hung pod and hold traffic until the app is serving, and pinning the
image removes the "what version is actually running" ambiguity.
Scope
Deliberately minimal and non-breaking. The Service, data volume, and port are
unchanged, and NET_BIND_SERVICE is kept so the container can still bind :80.
I left readOnlyRootFilesystem, a non-root UID, and a NetworkPolicy out — those
depend on the image and your cluster's networking and are better as separate
changes. The image is pinned, so imagePullPolicy is IfNotPresent rather
than Always. Verified the manifest still parses.
Appreciate the hardening here. I tested the securityContext and limits against the image, and Vaultwarden runs without trouble under them. /alive is a good choice for the readiness probe.
I'd like to drop the version pin, though, and keep :latest with imagePullPolicy: Always. Nothing in this repo bumps pinned tags, and people tend to copy these manifests once and leave them alone. A pin that's current today becomes an outdated password manager a year from now, and nothing tells the user. 1.32.7 already shows this: it's from December 2024 and misses fixes such as GHSA-j4h8-vch3-f797 (1.33.0) and the CVE fixes in 1.33.2 and 1.34.0. Vaultwarden has no major-version tags and migrates its database forward on its own, so following latest is the safer default for this app. A comment suggesting that readers pin a release and update it deliberately, if they want reproducible deploys, would be a welcome addition.
With the image line back to latest and Always, this is good to go.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Non-breaking hardening + reliability for the Vaultwarden deployment:
:latest(shown asvaultwarden/server:1.32.7— set it to whichever release you run), so a podrestart can't silently change versions.
currently has none.
/aliveon :80, Vaultwarden's documented unauthenticated health endpoint).securityContext:allowPrivilegeEscalation: false,all capabilities dropped with only
NET_BIND_SERVICEadded back (Vaultwardenbinds :80), and seccomp
RuntimeDefault.Why
This stores credentials, so defense-in-depth matters: no privilege escalation
and a near-empty capability set cost nothing here. Probes let Kubernetes
restart a hung pod and hold traffic until the app is serving, and pinning the
image removes the "what version is actually running" ambiguity.
Scope
Deliberately minimal and non-breaking. The Service, data volume, and port are
unchanged, and
NET_BIND_SERVICEis kept so the container can still bind :80.I left
readOnlyRootFilesystem, a non-root UID, and a NetworkPolicy out — thosedepend on the image and your cluster's networking and are better as separate
changes. The image is pinned, so
imagePullPolicyisIfNotPresentratherthan
Always. Verified the manifest still parses.