Contraseñas (vaultwarden)
Contraseñas en una caja Self Host Wizard: la pieza vaultwarden, en vault.<dominio de apps>, ingreso oidc, límite de memoria 163 MB.
De un vistazo
| Dato | Valor |
|---|---|
| Dirección | https://vault.<dominio de apps> |
| Ingreso | oidc: OpenID Connect con Authelia: el ingreso de la oficina sirve también acá |
| Límite de memoria | 163 MB (ram_mb: pico medido × 1,3) |
| Base de datos | ninguna compartida: guarda sus datos en THX_DATA |
| Necesita | lldap, authelia |
| La necesitan | nada |
| Contenedores | vaultwarden |
Imagen: vaultwarden | vaultwarden/server:1.37.5-alpine@sha256:bbe684a02d6b0db54256ff88eac9754f4519284a7b26314afc241fd7d0918191 |
| Licencia (según el README) | AGPL-3.0 |
| Proyecto original (según el README) | https://github.com/dani-garcia/vaultwarden |
Cómo activarla
thx enable agrega vaultwarden y todo lo que necesita al estado de la caja; después thx apply la instala. Las apps se aplican recién cuando site_domain está definido.
sudo thx enable vaultwarden
sudo thx apply
Notas técnicas (pieces/vaultwarden/README.md)
Las notas técnicas de cada pieza están en inglés, tal como están en el repositorio.
Vaultwarden 1.37.5, AGPL-3.0: a Bitwarden-compatible
server in Rust. Every official Bitwarden app (browser extension, desktop, iOS/Android, bw CLI) and
the bundled web vault talk to it. Image vaultwarden/server:1.37.5-alpine, pinned by index digest
sha256:bbe684a0…8191; the index has linux/arm64 (docker buildx imagetools inspect, 2026-11-24).
We ship only compose + config and pull the upstream image unmodified.
How it is wired
- Storage: SQLite and attachments in
THX_DATA(/datain the container). - Sign-in: SSO through Authelia, and only SSO. Vaultwarden has OpenID Connect SSO since 1.35;
verified in the 1.37.5 sources (
src/sso.rs,src/api/identity.rs,.env.template).SSO_ONLY=truerefuses the password grant ("SSO sign-in is required");SIGNUPS_ALLOWED=falserefuses self-registration;SSO_SIGNUPS_ALLOWED=truelets any LLDAP person who passes Authelia get an account on first sign-in. Redirect URI:https://vault.<apps_domain>/identity/connect/oidc-signin; Vaultwarden usesclient_secret_basicand always sends a PKCE S256 challenge. - The master password stays. Bitwarden encrypts the vault on the device with a key derived from the master password; SSO replaces only "who are you". On the first SSO sign-in each person sets a master password in the app; after that they sign in with SSO and unlock with the master password. This is by design (PLAN §2.2 "own master password") and it is what keeps the box operator from reading anyone's passwords.
- Login is automatic (
[oidc] login_page = "/",login_start = "/#/sso?identifier=…", Caddy; docs/pieces.md section 4). Openinghttps://vault.<apps_domain>/from outside goes straight into the web vault's SSO step; with an Authelia session it comes back with no click, without one it goes through Authelia's form once. The person lands on the one screen only they can pass: setting their master password (first visit; the account is made then) or unlocking with it. The identifier is Vaultwarden'sFAKE_SSO_IDENTIFIER(00000000-01DC-01DC-01DC-000000000000,src/sso.rs): with any other value the set-password screen asks/organizations/<identifier>/policies/master-password, gets 401 and drops back to the login page. - The one extra password, explained on screen.
templates/scss/user.vaultwarden.scss.hbs(mounted read-only,TEMPLATES_FOLDER=/thx-templates; Vaultwarden appends it to its CSS) puts a line on the set-password and unlock screens: you are already signed in to the office; this password is only for the vault, locks it on this device so nobody else (server, administrator) can read it, and cannot be reset. It also hides upstream's "Join organization" heading on the set-password screen (that organization is the SSO placeholder; there is none). The vault stays zero-knowledge: the server never sees the master password or the keys. SSO_AUTH_ONLY_NOT_SESSION=true: Vaultwarden keeps its own session/refresh tokens. Otherwise every client would be signed out when Authelia's 1-hour access token expires.- Clients: in any Bitwarden app choose "self-hosted", server
https://vault.<apps_domain>, then "Enterprise single sign-on" (any identifier works). ThebwCLI and scripts use the personal API key (bw login --apikey), whichSSO_ONLYstill allows. - Live sync (WebSocket): since 1.29 notifications are served on the main port at
/notifications/hub; a plainreverse_proxyin Caddy carries the upgrade. No extra route needed. - Admin panel:
/admin, tokenTHX_SECRET_ADMIN_TOKEN(64 hex chars). Vaultwarden logs a notice that a plain token is weaker than an Argon2 PHC hash. See "Needs from other lanes". - Mail:
THX_SMTP_HOST:THX_SMTP_PORT,SMTP_SECURITY=off(the hop never leaves thethxnetwork), fromTHX_MAIL_FROM. Used for organization invitations and new-device notices.
One Bitwarden Organization per company: not automated, on purpose
An Organization's key is generated on a member's device and handed to each new member encrypted with that member's public key (the "confirm" step). The server never holds it. A job on the box could only create and fill organizations by running a bot account that holds every company's organization key, which means the box (and whoever has root on it) could decrypt every shared password of every company. That defeats the point of Vaultwarden. Nor does upstream map OIDC groups to organizations (the SSO code has no group handling in 1.37.5).
What works today, by hand, per company: the first person signs in, creates the Organization ("Acme") in the web vault and invites colleagues by email; they sign in with SSO, set their master password, and the inviter confirms them. Owner decision needed (recommendation: keep it manual, document it in the admin guide).
Test (./test.sh)
Throwaway LLDAP, Authelia (client generated from piece.toml), Caddy with its local CA (the
container trusts it through a mounted CA bundle, test-only), Mailpit as the relay. It checks:
the password grant and self-registration are refused; alice signs in through Authelia with the same
authorize → oidc-signin → token flow a Bitwarden client uses, and gets a fresh account without keys;
the test sets her master password the way a client does (PBKDF2-SHA256 600k master key, HKDF stretch,
AES-256-CBC + HMAC user key, RSA-2048 key pair) and creates her API key; the **official bw CLI
2026.10.1** (node:22-alpine, pinned) logs in with the API key, unlocks, creates a login item and
reads it back after a sync; a WebSocket opened through Caddy gets the SignalR handshake and a push
message when the CLI saves the item; the item fetched over the API decrypts with alice's key to the
same secret; in headless Chrome (test/sso.py), bob (Authelia session, no account yet) opens the
vault and lands on the set-master-password screen with no click, alice (master password set) lands
on the unlock screen, carol (no session) signs in at Authelia once and lands on the set-password
screen, each with the explanation on screen; the admin token opens /admin (a wrong one gets 401) and its SMTP test mail arrives in
Mailpit from THX_MAIL_FROM.
RAM
Measured 2026-11-24/25 on the amd64 dev PC (the box is arm64; same Rust binary, expect similar),
page cache excluded, while the bw CLI synced and a WebSocket stayed open: peaks of 78, 92, 78,
51 and 69 MiB over five runs (the first three by docker stats every 2 s, the last two from the
cgroup every 0.25 s; cgroup memory.peak 64–97 MiB incl. page cache). With the web vault's SSO
sign-ins in headless Chrome added (sso lane, 2026-11-25; three people, each through the full SSO
flow, two web-vault sessions syncing) the peaks were 91, 110 and 125 MiB (cgroup every 0.25 s).
ram_mb = 163 = 125 × 1.3, rounded up; mem_limit: 163m. The test asserts no OOM kill under that
limit. It has three users and one item; re-measure on the box under real use (many devices holding
WebSockets, attachments).
Needs from other lanes
- Caddy (core): gate
/admin*onvault.<apps_domain>to theadminsgroup (forward_auth to Authelia) on top of the token, and proxy the rest straight through (WebSocket upgrade included). - Secrets (core): store
admin_tokenas an Argon2id PHC string (vaultwarden hash) and hand the admin the plain value once; Vaultwarden accepts either form inADMIN_TOKEN. - Authelia (core): the client as generated from
piece.toml(client_secret_basic, PKCE S256,consent_mode: implicit); containers must resolve and reachhttps://auth.<apps_domain>.
Known gaps
- Organizations per company are manual (above).
- People removed from LLDAP keep their vault account until an admin disables it in
/admin; withSSO_ONLYthey can no longer sign in, but devices already signed in stay unlocked until their refresh token expires. - The emergency-access and Send features are upstream defaults (on); nothing here changes them.