diff --git a/changelog/70198.added.md b/changelog/70198.added.md new file mode 100644 index 000000000000..7eda00d92cf3 --- /dev/null +++ b/changelog/70198.added.md @@ -0,0 +1 @@ +Isolate salt daemon writable state under per-daemon `/var/lib/salt//` directories so the `/opt/saltstack/salt` onedir tree stays `root:root 0755`. `SALT_ONEDIR_HARDEN=1` is now the default on 3009.0+; `SALT_ONEDIR_HARDEN=0` restores the legacy `chown -R salt /opt/saltstack/salt` behavior for one release and emits a deprecation warning. `salt-pip` and `_salt_onedir_extras.py` honor `SALT_EXTRAS_DIR` at runtime so the relocated extras tree stays importable by the daemon. diff --git a/doc/topics/releases/templates/3009.0.md.template b/doc/topics/releases/templates/3009.0.md.template index 9df09f0899e9..27799792fdeb 100644 --- a/doc/topics/releases/templates/3009.0.md.template +++ b/doc/topics/releases/templates/3009.0.md.template @@ -6,6 +6,36 @@ Add release specific details below --> +## Hardened onedir layout (`SALT_ONEDIR_HARDEN=1` by default) + +Starting with 3009.0, the Linux packaging isolates each salt daemon's +writable state under per-daemon directories: + +- `/var/lib/salt/minion/{home,extras-}` for `salt-minion` +- `/var/lib/salt/master/{home,extras-}` for `salt-master` +- `/var/lib/salt/syndic/{home,extras-}` for `salt-syndic` +- `/var/lib/salt/api/{home,extras-}` for `salt-api` +- `/var/lib/salt/cloud/{home,extras-}` for `salt-cloud` + +The `/opt/saltstack/salt` onedir tree now stays owned by +`root:root` at `0755` — the packaging postinst / posttrans scriptlets +no longer chown the tree to the salt user. On upgrade from a legacy +install, the existing `/opt/saltstack/salt/extras-` contents are +migrated into the per-daemon `/var/lib/salt//extras-` +directory automatically. + +`salt-pip install` and the runtime `_salt_onedir_extras` import hook +honor the `SALT_EXTRAS_DIR` environment variable so packages installed +via `salt-pip` continue to be importable by the daemon at runtime. + +### Opting out for one release + +Set `SALT_ONEDIR_HARDEN=0` in `/etc/default/salt-setup` (DEB) or +`/etc/sysconfig/salt-minion-setup` (RPM) to keep the legacy +`chown -R salt /opt/saltstack/salt` behavior. This opt-out is available +for the 3009 release cycle only; the legacy layout will be removed in a +future release. See {issue}`70198`. +