webmail: secrets as mounted files, and check the read-only root #20

Merged
jcoffey-dev merged 1 commits from feat/webmail-secret-files into main 2026-11-19 00:40:09 +00:00
Owner

K-W4, chart side.

  • The webmail mounts its Secret at /etc/inbuxa-webmail (mode 0440, fsGroup: 1000) and reads app-secret and oauth-client-secret through APP_SECRET_FILE and OAUTH_CLIENT_SECRET_FILE, not from its environment. The read-secret-from-env-var and env-value-from lint exceptions are gone. An env-var-secret exception explains that the variables hold paths.
  • IMMUTABLE=1: the webmail refuses to start if its root turns out to be writable.
  • webmail.previousAppSecret (default false): while rotating, the webmail reads app-secret-previous from existingSecret. It replaces the old optional APP_SECRET_PREVIOUS variable. With the chart's own Secret it fails, since that Secret keeps only the two keys the chart makes.
  • Tests: 54 pass (new: files and mounts, rotation, the refusal). tools/check.sh passes.

Tested on kind with the webmail built from inbuxa-webmail's feat/secret-files: frontends-test.sh passes (sign-in across replicas, the console). The pod's environment has only the paths, and /app is read-only.

Hold: merge once the chart's webmail image is 27.1-rc.7 or later. An older webmail ignores *_FILE and would refuse to start without APP_SECRET. This touches the same values as #19 but not the same lines.

K-W4, chart side. - The webmail mounts its Secret at `/etc/inbuxa-webmail` (mode 0440, `fsGroup: 1000`) and reads `app-secret` and `oauth-client-secret` through `APP_SECRET_FILE` and `OAUTH_CLIENT_SECRET_FILE`, not from its environment. The `read-secret-from-env-var` and `env-value-from` lint exceptions are gone. An `env-var-secret` exception explains that the variables hold paths. - `IMMUTABLE=1`: the webmail refuses to start if its root turns out to be writable. - `webmail.previousAppSecret` (default false): while rotating, the webmail reads `app-secret-previous` from `existingSecret`. It replaces the old optional `APP_SECRET_PREVIOUS` variable. With the chart's own Secret it fails, since that Secret keeps only the two keys the chart makes. - Tests: 54 pass (new: files and mounts, rotation, the refusal). `tools/check.sh` passes. **Tested on kind** with the webmail built from inbuxa-webmail's `feat/secret-files`: `frontends-test.sh` passes (sign-in across replicas, the console). The pod's environment has only the paths, and `/app` is read-only. **Hold:** merge once the chart's webmail image is 27.1-rc.7 or later. An older webmail ignores `*_FILE` and would refuse to start without `APP_SECRET`. This touches the same values as #19 but not the same lines.
jcoffey-dev added 1 commit 2026-11-19 00:06:57 +00:00
The webmail reads app-secret and oauth-client-secret from the mounted
Secret (APP_SECRET_FILE, OAUTH_CLIENT_SECRET_FILE) instead of its
environment, with fsGroup 1000 so it can read them. IMMUTABLE=1 makes it
refuse to start on a writable root. webmail.previousAppSecret reads
app-secret-previous from existingSecret during a rotation.

Needs webmail 27.1-rc.7 or later.
jcoffey-dev merged commit ae9a650a5d into main 2026-11-19 00:40:09 +00:00
jcoffey-dev deleted branch feat/webmail-secret-files 2026-11-19 00:40:09 +00:00
Sign in to join this conversation.