Skip to content
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

PROXY: strip SUID bit off 'proxy_child' #7134

Closed
wants to merge 1 commit into from

Conversation

alexey-tikhonov
Copy link
Member

@alexey-tikhonov alexey-tikhonov commented Jan 17, 2024

'proxy' provider can be used to load arbitrary modules that might
(or might not) require specific capabilities.

Granting all capabilities unconditionally feels unjustified. One of
the widely used options is proxy around 'libnss_files' that doesn't
require any capabilities. Let administrator to set file capability
manually if required in esoteric use cases.

@alexey-tikhonov alexey-tikhonov added the no-backport This should go to target branch only. label Jan 17, 2024
@alexey-tikhonov alexey-tikhonov force-pushed the replace-suid branch 2 times, most recently from bd49ac8 to 6abe198 Compare January 17, 2024 18:42
@alexey-tikhonov alexey-tikhonov changed the title TODO PROXY: strip SUID bit off 'proxy_child' Jan 17, 2024
@alexey-tikhonov alexey-tikhonov marked this pull request as ready for review January 17, 2024 20:24
@alexey-tikhonov
Copy link
Member Author

alexey-tikhonov commented Jan 17, 2024

FWIW, a run --with-sssd-user=sssd and system tests using sssd.conf::user=sssd is available in #7135

Besides "hardening in general", this change (among other '*_child' related changes) is needed to allow to use "SecureBits=noroot noroot-locked" in 'sssd.service'
And this, in turn, is needed to avoid 'sssd_be' regaining capabilities even when user=root (without those security bits set, execv with uid/gid=0 regains capabilities from bounding to permitted set)

Copy link
Contributor

@justin-stephenson justin-stephenson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ack thank you. Should there be a release note?

@alexey-tikhonov
Copy link
Member Author

Ack thank you. Should there be a release note?

I think "support of running under non-privileged user" should have a huge, holistic release note.
Adding a bunch of assorted RNs doesn't make sense, imo.

@alexey-tikhonov
Copy link
Member Author

Take a note this makes 'proxy_child' binary readable/executable by anyone (the same as 'p11_child' or 'oidc_child', for example). But I don't think this is an issue.

@pbrezina
Copy link
Member

You also need to change it in makefile: https://github.com/SSSD/sssd/blob/master/Makefile.am#L5539

'proxy' provider can be used to load arbitrary modules that might
(or might not) require specific capabilities.

Granting all capabilities unconditionally feels unjustified. One of
the widely used options is proxy around 'libnss_files' that doesn't
require any capabilities. Let administrator to set file capability
manually if required in esoteric use cases.
@alexey-tikhonov
Copy link
Member Author

You also need to change it in makefile: https://github.com/SSSD/sssd/blob/master/Makefile.am#L5539

Thanks, done.

Copy link
Contributor

@sumit-bose sumit-bose left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi,

thanks for the patch, ACK.

bye,
Sumit

@alexey-tikhonov alexey-tikhonov added the Ready to push Ready to push label Jan 29, 2024
@alexey-tikhonov
Copy link
Member Author

Pushed PR: #7134

  • master
    • a785115 - PROXY: strip SUID bit off 'proxy_child'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-backport This should go to target branch only. non-privileged Pushed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants