Skip to content

Commit dbb058f

Browse files
authored
Merge pull request #394 from cdalvaro/upgrade/sts/3008.0
3008.0 STS
2 parents 617cc00 + 3e2596b commit dbb058f

22 files changed

Lines changed: 808 additions & 106 deletions

File tree

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,21 @@ This file only reflects the changes that are made in this image.
44
Please refer to the [Salt 3007.14 Release Notes](https://docs.saltstack.com/en/latest/topics/releases/3007.14.html)
55
for the list of changes in SaltStack.
66

7+
**3008.0**
8+
9+
- Update `salt-master` to `3008.0` _Chlorine_.
10+
11+
**3008.0rc4**
12+
13+
- Update `salt-master` to `3008.0rc4` _Chlorine_.
14+
15+
**3008.0rc3**
16+
17+
- Update `salt-master` to `3008.0rc3` _Chlorine_.
18+
- Change Docker base image to `ubuntu:resolute-20260413`.
19+
- Install `libgit2-dev 1.9.1` from apt as a build dependency to support `pygit2 1.19.2`.
20+
- Dearmor Salt GPG key for APT compatibility.
21+
722
**3006.25**
823

924
- Update `salt-master` to `3006.25` _Sulfur_.

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM public.ecr.aws/docker/library/ubuntu:noble-20260113
1+
FROM public.ecr.aws/docker/library/ubuntu:resolute-20260413
22

33
ARG SALT_VERSION
44
ARG BUILD_DATE
@@ -32,7 +32,7 @@ WORKDIR ${SALT_BUILD_DIR}
3232
# hadolint ignore=DL3008
3333
RUN apt-get update \
3434
&& DEBIAN_FRONTEND=noninteractive apt-get install --yes --quiet --no-install-recommends \
35-
sudo ca-certificates apt-transport-https wget locales openssh-client gpg gpg-agent \
35+
sudo ca-certificates apt-transport-https wget locales openssh-client gpg gpg-agent openssl \
3636
supervisor logrotate git gettext-base tzdata inotify-tools psmisc \
3737
&& DEBIAN_FRONTEND=noninteractive update-locale LANG=C.UTF-8 LC_MESSAGES=POSIX \
3838
locale-gen en_US.UTF-8 \
@@ -74,7 +74,7 @@ LABEL org.opencontainers.image.vendor="cdalvaro"
7474
LABEL org.opencontainers.image.created="${BUILD_DATE}"
7575
LABEL org.opencontainers.image.version="${IMAGE_VERSION}"
7676
LABEL org.opencontainers.image.revision="${VCS_REF}"
77-
LABEL org.opencontainers.image.base.name="public.ecr.aws/docker/library/ubuntu:noble-20260113"
77+
LABEL org.opencontainers.image.base.name="public.ecr.aws/docker/library/ubuntu:resolute-20260413"
7878
LABEL org.opencontainers.image.licenses="MIT"
7979

8080
ENTRYPOINT [ "/sbin/entrypoint.sh" ]

README.md

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<p align="center">
1010
<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>
1111
<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>
1313
<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>
1414
<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>
1515
<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
250250

251251
#### Working with Secrets
252252

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+
253287
Master keys can be provided via Docker secrets. To do that, you have to set the following environment variable:
254288

255289
- `SALT_MASTER_KEY_FILE`: The path to the master-key-pair {pem,pub} files without suffixes.
@@ -315,6 +349,17 @@ secrets:
315349
file: keys/master_pubkey_signature
316350
```
317351
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+
318363
### Salt API
319364
320365
You can enable `salt-api` service by setting env variable `SALT_API_ENABLED` to `True`.

VERSION_STS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3007.14
1+
3008.0

assets/build/functions.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,10 +136,15 @@ function add_salt_repository() {
136136
local arch=amd64
137137
is_arm64 && arch=arm64
138138

139-
# Download public key
140-
local keyring_file="/etc/apt/keyrings/salt-archive-keyring-2023.pgp"
139+
# Download public key and dearmor it so APT can use it as a binary keyring
140+
local keyring_file="/etc/apt/keyrings/salt-archive-keyring.gpg"
141141
local key_url="https://packages.broadcom.com/artifactory/api/security/keypair/SaltProjectKey/public"
142-
download "${key_url}" "${keyring_file}"
142+
local tmp_key
143+
tmp_key=$(mktemp)
144+
download "${key_url}" "${tmp_key}"
145+
gpg --dearmor < "${tmp_key}" > "${keyring_file}"
146+
rm -f "${tmp_key}"
147+
chmod 644 "${keyring_file}"
143148

144149
# Create apt repo target configuration
145150
local target_url="https://packages.broadcom.com/artifactory/saltproject-deb/"

assets/build/install.sh

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ source "${FUNCTIONS_FILE}"
1212

1313
log_info "Installing required packages and build dependencies ..."
1414
REQUIRED_PACKAGES=(
15-
binutils patchelf libldap-common
15+
binutils patchelf libldap-common libgit2-1.9
1616
)
1717

1818
BUILD_DEPENDENCIES=(
19-
gcc libsasl2-dev libldap2-dev
19+
gcc libssl-dev libsasl2-dev libldap2-dev libgit2-dev
2020
)
2121

2222
log_info "Adding salt repository..."
@@ -51,16 +51,14 @@ EOF
5151
# Install salt packages
5252
log_info "Installing salt packages ..."
5353
install_pkgs \
54-
salt-common="${SALT_VERSION}" \
55-
salt-master="${SALT_VERSION}" \
56-
salt-minion="${SALT_VERSION}" \
57-
salt-api="${SALT_VERSION}"
54+
salt-common="${SALT_VERSION/rc/~rc}" \
55+
salt-master="${SALT_VERSION/rc/~rc}" \
56+
salt-minion="${SALT_VERSION/rc/~rc}" \
57+
salt-api="${SALT_VERSION/rc/~rc}"
5858

5959
# Install python packages
6060
log_info "Installing python packages ..."
61-
# FIXME: Downgrade to pip 22.3.1 for bug: https://github.com/saltstack/salt/issues/65025
62-
salt-pip install pip==22.3.1
63-
salt-pip install pygit2==1.18.2
61+
salt-pip install pygit2==1.19.2
6462
salt-pip install python-ldap
6563

6664
# Configure ssh

assets/runtime/config/master.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
# after the comment then the value is presented as an example and is not the
77
# default.
88

9+
# Explicitly declare the id for this master to ensure key files are always
10+
# named master.pem/master.pub regardless of the container hostname.
11+
id: master
12+
913
# The master will automatically include all config files from:
1014
default_include: {{SALT_CONFS_DIR}}/*.conf
1115

assets/runtime/config/minion.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ default_include: {{SALT_MINION_CONFS_DIR}}/*.conf
1313

1414
# Set the location of the salt master server. If the master server cannot be
1515
# resolved, then the minion will fail to start.
16-
master: 0.0.0.0
16+
master: localhost
1717

1818
# Set the port used by the master reply and authentication server.
1919
master_port: 4506

assets/runtime/env-defaults.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export DEBUG=${DEBUG:-False}
77
export TIMEZONE=${TIMEZONE:-${TZ:-UTC}}
88

99
##### Salt API #####
10-
export SALT_API_ENABLED=${SALT_API_ENABLED:False}
10+
export SALT_API_ENABLED=${SALT_API_ENABLED:-False}
1111
if [[ -z ${SALT_API_USER+x} ]]; then
1212
export SALT_API_USER=salt_api
1313
fi

0 commit comments

Comments
 (0)