|
9 | 9 | <p align="center"> |
10 | 10 | <a href="https://docs.saltproject.io/en/latest/topics/releases/3007.14.html"><img alt="Salt Project" src="https://img.shields.io/badge/salt-3007.14%20sts-57BCAD.svg?logo=SaltProject"/></a> |
11 | 11 | <a href="https://docs.saltproject.io/en/3006/topics/releases/3006.25.html"><img alt="Salt Project" src="https://img.shields.io/badge/salt-3006.25%20lts-57BCAD.svg?logo=SaltProject"/></a> |
12 | | - <a href="https://gallery.ecr.aws/ubuntu/ubuntu"><img alt="Ubuntu Image" src="https://img.shields.io/badge/ubuntu-noble--20260113-E95420.svg?logo=Ubuntu"/></a> |
| 12 | + <a href="https://gallery.ecr.aws/ubuntu/ubuntu"><img alt="Ubuntu Image" src="https://img.shields.io/badge/ubuntu-resolute--20260413-E95420.svg?logo=Ubuntu"/></a> |
13 | 13 | <a href="https://hub.docker.com/repository/docker/cdalvaro/docker-salt-master/tags"><img alt="Docker Image Size" src="https://img.shields.io/docker/image-size/cdalvaro/docker-salt-master/latest?logo=docker&color=2496ED"/></a> |
14 | 14 | <a href="https://github.com/users/cdalvaro/packages/container/package/docker-salt-master"><img alt="Architecture AMD64" src="https://img.shields.io/badge/arch-amd64-inactive.svg"/></a> |
15 | 15 | <a href="https://github.com/users/cdalvaro/packages/container/package/docker-salt-master"><img alt="Architecture ARM64" src="https://img.shields.io/badge/arch-arm64-inactive.svg"/></a> |
@@ -250,6 +250,40 @@ Where `XXXXX` is a random code to avoid possible collisions with previous genera |
250 | 250 |
|
251 | 251 | #### Working with Secrets |
252 | 252 |
|
| 253 | +> [!IMPORTANT] |
| 254 | +> **Change introduced in 3008.0 — please read if you use secrets.** |
| 255 | +> |
| 256 | +> Up to Salt 3007, master keys provided via secrets were **symlinked** into the |
| 257 | +> keys directory, so the private material never left `/run/secrets` even if the |
| 258 | +> whole keys volume was bind-mounted. |
| 259 | +> |
| 260 | +> Salt 3008.0 changed how the master loads its keys: the new `localfs_key` |
| 261 | +> cache driver **rejects symlinked key files**. To remain compatible, secret |
| 262 | +> keys are now **copied** into the keys directory (`/home/salt/data/keys`) as |
| 263 | +> regular files. |
| 264 | +> |
| 265 | +> **Consequence:** if you both provide keys via secrets **and** bind-mount the |
| 266 | +> full keys volume (`/home/salt/data/keys`), the master private key will be |
| 267 | +> **copied onto that persisted volume** and is therefore more exposed than |
| 268 | +> before. To keep the private material off persistent storage, when using |
| 269 | +> secrets it is **recommended to NOT bind-mount the whole keys volume**. Mount |
| 270 | +> only the minion key sub-directories you actually need to persist — usually |
| 271 | +> just the accepted minions: |
| 272 | +> |
| 273 | +> - `/home/salt/data/keys/minions` — accepted minion keys (most common) |
| 274 | +> - `/home/salt/data/keys/minions_rejected` — rejected minion keys (optional) |
| 275 | +> - `/home/salt/data/keys/minions_pre`, `minions_denied`, `minions_autosign` — optional |
| 276 | +> |
| 277 | +> These are bind-mounted directories (not symlinks), so Salt 3008.0 accepts |
| 278 | +> them while the master keys stay on the container's ephemeral layer, recreated |
| 279 | +> from the secrets on every start. |
| 280 | +> |
| 281 | +> **Migration / safety net:** on upgrade, any pre-existing **symlinked** master |
| 282 | +> key is automatically replaced by a copy of the secret. If a master key is |
| 283 | +> already present as a **regular file** (e.g. you mounted the full keys volume), |
| 284 | +> it is **not** overwritten: it is validated against the secret and, on |
| 285 | +> mismatch, a `WARN` is logged — the on-disk key wins and the secret is ignored. |
| 286 | +
|
253 | 287 | Master keys can be provided via Docker secrets. To do that, you have to set the following environment variable: |
254 | 288 |
|
255 | 289 | - `SALT_MASTER_KEY_FILE`: The path to the master-key-pair {pem,pub} files without suffixes. |
@@ -315,6 +349,17 @@ secrets: |
315 | 349 | file: keys/master_pubkey_signature |
316 | 350 | ``` |
317 | 351 |
|
| 352 | +Note that the example above intentionally does **not** bind-mount the whole |
| 353 | +keys volume. To persist accepted minion keys across container recreation while |
| 354 | +keeping the master private key off persistent storage, mount only the minion |
| 355 | +sub-directory: |
| 356 | +
|
| 357 | +```yml |
| 358 | + volumes: |
| 359 | + - ./config:/home/salt/data/config |
| 360 | + - ./keys/minions:/home/salt/data/keys/minions |
| 361 | +``` |
| 362 | +
|
318 | 363 | ### Salt API |
319 | 364 |
|
320 | 365 | You can enable `salt-api` service by setting env variable `SALT_API_ENABLED` to `True`. |
|
0 commit comments