-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[3006.x] Update 3006 packaging to reduce permissions given to salt user for running salt-master #64194
[3006.x] Update 3006 packaging to reduce permissions given to salt user for running salt-master #64194
Commits on Aug 16, 2023
-
Update packages for python modules owned by root
Updates Debian and RPM packages so that /opt/saltstack/salt and the python packages don't have to be owned by salt user. It shouldn't be necessary for salt user, used to run salt-master to be able to write/modify files in that directory hierarchy. Add postinst scripts to call the python compileall module to create byte-compiled python modules. This should preserve performance whilst not requiring write access for salt user. Also cleans up .pyc files and __pycache__ dirs on removal.
Configuration menu - View commit details
-
Copy full SHA for 8497c40 - Browse repository at this point
Copy the full SHA 8497c40View commit details -
Reduce perms for salt user on other salt dirs
Reduces the permissions granted to the salt user used to run the salt-master: * Under /etc/salt limit ownership to /etc/salt/pki/master and /etc/salt/master.d * Until saltstack#64219 is resolved also include /etc/salt/minion.d * Under /var/cache/salt and /var/run/salt only give ownership on master directories * Under /var/log/salt, ensure /var/log/salt/master exists and give ownership oof that. Also update logrotate config to create that with correct ownership and perms and install that on debian packages.
Configuration menu - View commit details
-
Copy full SHA for 14a9496 - Browse repository at this point
Copy the full SHA 14a9496View commit details -
Update files to verify in pkg tests
Updates lists of files to check in package tests when starting master. We now set the following as owned by salt:salt in master postinst * /etc/salt/pki/master * /etc/salt/master.d * /var/log/salt/master * /var/cache/salt/master * /var/run/salt/master
Configuration menu - View commit details
-
Copy full SHA for a3ac1f5 - Browse repository at this point
Copy the full SHA a3ac1f5View commit details -
Creates /var/run/salt/master directory - if we don't create that specifically the postinst script will fail
Configuration menu - View commit details
-
Copy full SHA for ff77232 - Browse repository at this point
Copy the full SHA ff77232View commit details -
Correct docstrings for salt user test_salt_user
Corrects docstrings for salt user tests - they were all the same.
Configuration menu - View commit details
-
Copy full SHA for 33e283a - Browse repository at this point
Copy the full SHA 33e283aView commit details -
Move log creation and chown to posttrans
Moves log creation for /var/log/salt/master and /var/log/salt/cloud and setting ownership to salt:salt to the %posttrans scriplets. Whilst using %post work fine for fresh installs, upgrading means that the previous package %postun removes those files. Using %posttrans ensures the logs are created at the end of the full install/upgrade transaction.
Configuration menu - View commit details
-
Copy full SHA for 2b0e04f - Browse repository at this point
Copy the full SHA 2b0e04fView commit details -
Creates empty log for salt-api owned by salt user in same way we do for the master and salt-cloud
Configuration menu - View commit details
-
Copy full SHA for 8f1ee1a - Browse repository at this point
Copy the full SHA 8f1ee1aView commit details -
Add tests for package directory and file ownership
Adds test that checks that files and directories created by the packages that should be owned by salt:salt are owned by that user and that the other files/directories created are owned by root:root.
Configuration menu - View commit details
-
Copy full SHA for 3d88f61 - Browse repository at this point
Copy the full SHA 3d88f61View commit details -
Removes group test for ownership on files by the salt user. Files that are created by the salt-master process can be owned by salt:root, rather than salt:salt and that's valid
Configuration menu - View commit details
-
Copy full SHA for d2fcd3d - Browse repository at this point
Copy the full SHA d2fcd3dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 0c0b3de - Browse repository at this point
Copy the full SHA 0c0b3deView commit details -
Handle pytest-salt-factories permission changes
Handles permission changes caused by test suite running as root and the creation of /var/cache/salt/master/.root_key. Running the test suite as root means that /etc/salt/pki/master subdirs get their ownership changed to root - clean that up in conftest.py. No longer need to fix /var/log/salt as we handle the files in there individually. Adds exclusion for /var/cache/salt/master/.root_key as that gets created by salt* cli tools running as root.
Configuration menu - View commit details
-
Copy full SHA for 51ccd20 - Browse repository at this point
Copy the full SHA 51ccd20View commit details -
Ensure salt-api service is enabled
Ensure salt-api service is enabled now we've added a postinst script
Configuration menu - View commit details
-
Copy full SHA for a9c142a - Browse repository at this point
Copy the full SHA a9c142aView commit details -
Removing check on /etc/salt/minion.d
Removes check on /etc/salt/minion.d - it's causing issues in CI that I can't reproduce locally and we'll deal with it in saltstack#64235 anyway.
Configuration menu - View commit details
-
Copy full SHA for 2c30824 - Browse repository at this point
Copy the full SHA 2c30824View commit details -
Remove some perms checks in conftest.py
Remove checks for perms on /var/log/salt/master and /var/run/salt/master in the salt_master fixture as they may not existing during an upgrade test and it's not critical to test them in the fixture.
Configuration menu - View commit details
-
Copy full SHA for d362fdc - Browse repository at this point
Copy the full SHA d362fdcView commit details -
Add support for fixing old pkg perms
Adds support for fixing old package (3006.0/3006.1) perms that used the salt user too widely. Without doing this, tests don't pass for upgrades.
Configuration menu - View commit details
-
Copy full SHA for 3630b28 - Browse repository at this point
Copy the full SHA 3630b28View commit details -
Configuration menu - View commit details
-
Copy full SHA for b5494f7 - Browse repository at this point
Copy the full SHA b5494f7View commit details -
Configuration menu - View commit details
-
Copy full SHA for d48afd9 - Browse repository at this point
Copy the full SHA d48afd9View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1dcf643 - Browse repository at this point
Copy the full SHA 1dcf643View commit details -
Configuration menu - View commit details
-
Copy full SHA for ed82030 - Browse repository at this point
Copy the full SHA ed82030View commit details -
Remove seperate salt-cloud path tests
Removes seperate salt-cloud path tests as they are now covered by test_pkg_paths
Configuration menu - View commit details
-
Copy full SHA for 1e659ea - Browse repository at this point
Copy the full SHA 1e659eaView commit details -
Configuration menu - View commit details
-
Copy full SHA for afdced0 - Browse repository at this point
Copy the full SHA afdced0View commit details -
Don't change ownership of /etc/salt/minion.d
No longer changes ownership of /etc/salt/minion.d to salt user for the salt-master. Requires saltstack#64219 to be resolved.
Configuration menu - View commit details
-
Copy full SHA for 607a4de - Browse repository at this point
Copy the full SHA 607a4deView commit details -
MKLeb committed
Aug 16, 2023 Configuration menu - View commit details
-
Copy full SHA for cdd4fec - Browse repository at this point
Copy the full SHA cdd4fecView commit details