-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
MDEV-36229: Remove CAP_DAC_OVERRIDE CAP_AUDIT_WRITE from AmbientCapabilities #3873
base: 10.5
Are you sure you want to change the base?
Conversation
…ilities In resolving MDEV-33301 (76a2715) we moved all the capabilities from CapabilityBoundingSet to AmbientCapabilities where only add/moving CAP_IPC_LOCK was intended. The effect of this is the defaulting running MariaDB HAS the capabiltiy CAP_DAC_OVERRIDE CAP_AUDIT_WRITE allowing it to access any file, even while running as a non-root user. Resolve this by making CAP_IPC_LOCK apply to AmbientCapabilities and leave the remaining CAP_DAC_OVERRIDE CAP_AUDIT_WRITE to CapabilityBoundingSet for the use by auth_pam_tool.
Waiting for this to be merged, I will push new Arch packages with this cherry-picked then. Is it considered important enough for another round of point releases? |
# CAP_DAC_OVERRIDE To allow auth_pam_tool (which is SUID root) to read /etc/shadow when it's chmod 0 | ||
# does nothing for non-root, not needed if /etc/shadow is u+r | ||
# CAP_AUDIT_WRITE auth_pam_tool needs it on Debian for whatever reason | ||
AmbientCapabilities=CAP_IPC_LOCK CAP_DAC_OVERRIDE CAP_AUDIT_WRITE | ||
CapabilityBoundingSet=CAP_DAC_OVERRIDE CAP_AUDIT_WRITE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't think you need this .. I changed mine to only have
AmbientCapabilities=CAP_IPC_LOCK
and this seems to work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
per above comments in file these are only for the pam integration of MariaDB.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
During an execve(2), the capability bounding set is ANDed with the file permitted capability set
what is the "file permitted capability set" for auth_pam_tool ?
Do you plan to revert/change the |
This is pending being included for the Ubuntu 24.10 upload at https://salsa.debian.org/mariadb-team/mariadb-server/-/merge_requests/109 |
This reverts commit 497fa1f. Upstream reverted this in ee2ed1a and the change is pending rework at MariaDB#3873
This reverts commit 3cdd8be. Upstream reverted this in ee2ed1a and the change is pending rework at MariaDB#3873
…ilities
Description
In resolving MDEV-33301 (76a2715) we moved all the capabilities from CapabilityBoundingSet to AmbientCapabilities where only add/moving CAP_IPC_LOCK was intended.
The effect of this is the defaulting running MariaDB HAS the capability CAP_DAC_OVERRIDE CAP_AUDIT_WRITE allowing it to access any file, even while running as a non-root user.
Resolve this by making CAP_IPC_LOCK apply to AmbientCapabilities and leave the remaining CAP_DAC_OVERRIDE CAP_AUDIT_WRITE to CapabilityBoundingSet for the use by auth_pam_tool.
Release Notes
SECURITY: Correct mistake in previous release where systemd MariaDB services had capabilities CAP_DAC_OVERRIDE CAP_AUDIT_WRITE by default allowing arbitrary file access .
How can this PR be tested?
And it should fail.
If the changes are not amenable to automated testing, please explain why not and carefully describe how to test manually.
Basing the PR against the correct MariaDB version
main
branch.PR quality check