fix: keep secrets out of the service images
Each Java module's build context now holds only its jar, and local/image-check.sh fails an image that carries a key file, a private key under any name, or a secret setting with a built-in default. It found one: service-email defaulted SMSS360_APIKEY to a real-looking key, now removed (the key is in git history and must be rotated). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EFUzfj5akPxyikzGc2iAHM
This commit is contained in:
1 parent
3c093068a3
commit
7ba427ad44
11 files changed
+88
-3
No files matched your search
@@ -4,13 +4,14 @@ Design: `design.md`. All tasks run serially: each touches a build file, CI or SQ
|
||||
|
||||
## 1. Images and database package
|
||||
|
||||
- [ ] 1.1 Make the images production-safe (design decisions 4 and 5).
|
||||
- [x] 1.1 Make the images production-safe (design decisions 4 and 5).
|
||||
- Add a `.dockerignore` to each of the nine modules that lacks one.
|
||||
- Check each Dockerfile for baked-in config or secrets.
|
||||
- Write `local/image-check.sh <image>`. It fails when an image holds `appkeys.json`, `.env`, `*.pem`, `*.p12` or a Google service-account JSON.
|
||||
|
||||
Tests first: build one image with a planted `appkeys.json` in its module folder and show the check fails (red). Add the `.dockerignore` and show it passes (green). Then build all nine images locally, and run the check on each.
|
||||
- Scope: `solvway-*/Dockerfile`, `solvway-*/.dockerignore`, `local/image-check.sh`
|
||||
- The check also fails on a secret-named setting (KEY, SECRET, PASSWORD, PWD, TOKEN) that has a built-in default in the jar's config. It found one: `SMSS360_APIKEY` in service-email carried a real-looking key as its default, which is now removed. That key is in git history, so it must be rotated outside this change.
|
||||
- Scope: `solvway-*/Dockerfile`, `solvway-*/.dockerignore`, `local/image-check.sh`, `solvway-services-email/src/main/resources/application.yml` (the key default only)
|
||||
- Verify: all nine `docker build` commands succeed, and `local/image-check.sh` passes on each image.
|
||||
|
||||
- [ ] 1.2 Write the production database package (design decision 6): `sql/00` to `04` with source headers.
|
||||
|
||||
Reference in new issue
Block a user