Commit 516933d
fix(docker): drop the postgres image's Go privilege-drop binary
The upstream postgres image bakes in gosu, a static Go binary the entrypoints
run once as root to step down to the postgres user. apt cannot reach it, so its
Go stdlib CVEs — 22 HIGH/CRITICAL against Go 1.24.6, all of them fixable and
therefore all rejected by the release vulnerability policy — cannot be patched
out of the image. The current postgres:18-bookworm still carries gosu 1.19 built
against that toolchain, so waiting for a docker-library rebuild is not a fix.
setpriv (util-linux) performs the identical uid/gid/supplementary-group switch
and execs, and is an ordinary Debian package that OS updates keep patched. The
binary is deleted in its own layer, which writes a whiteout, before the stand-in
is copied over the same path: a scanner reads a merely-overwritten path as the
file the lower layer put there, so an overwrite alone leaves the findings.
Running the container as the postgres user instead was measured and rejected:
the local development stack bind-mounts server/postgres-data, which Docker
creates root-owned, so a non-root container cannot initialise it.
Closes #1713
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>1 parent 33f30c2 commit 516933d
3 files changed
Lines changed: 50 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
0 commit comments