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

A couple of fixes for errors reported by rpmlint #7794

Closed
wants to merge 1 commit into from

Conversation

scabrero
Copy link
Contributor

rpmlint reports a couple of security related issues:

  • The krb5 child does not drop supplementary groups after setresuid() and setresgid()
  • <allow> directives in the infopipe service without send_destination

Reported in https://bugzilla.suse.com/show_bug.cgi?id=1235724

@@ -54,6 +55,11 @@ errno_t switch_to_user(void)
return errno;
}

ret = setgroups(0, NULL);
Copy link
Member

Choose a reason for hiding this comment

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

There are several reasons why this is not needed and, most probably, won't work.

First of all, those functions - 'switch_to_*()' - are exclusively used by 'krb5_child' only.
And the first thing 'krb5_child' does - it calls privileged_krb5_setup().
First thing privileged_krb5_setup() does - it calls setgroups(0, NULL) if appropriate.
So groups are either already dropped, or can't be dropped (see comment

} /* Otherwise keep supplementary groups to have access to DB_PATH to store FAST ccache */
)

Moreover, next thing 'krb5_child' does - sss_drop_all_caps().
Due to this setgroups() here will fail with EPERM

Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure if this would make 'rpmlint' happy, but maybe addition of else keep-SSSD-group-only in privileged_krb5_setup() would be better.

But imo it's not worth bothering.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi Alexey, thanks for the detailed explanation.

Adding the else part to privileged_krb5_setup() will not help because rpmlint just scans the shared library for function calls. In libsss_krb5_common.so it finds the the setresuid() inside switch_to_xxx() without a setgroups() call, and privileged_krb5_setup() is not part of this library.

I will just add an exemption for this error. What's about the other patch? I will update this PR if it makes sense.

Copy link
Member

Choose a reason for hiding this comment

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

What's about the other patch?

d-bus policy patch looks good to me (but will require a 2nd reviewer).

@alexey-tikhonov
Copy link
Member

@scabrero, FYI, we plan sssd-2.10.2 release soon.

Copy link
Contributor

@ikerexxe ikerexxe left a comment

Choose a reason for hiding this comment

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

The second patch looks good.

> sssd-dbus.x86_64: E: dbus-policy-allow-without-destination <allow send_interface="org.freedesktop.sssd.infopipe"/> /usr/share/dbus-1/system.d/org.freedesktop.sssd.infopipe.conf
> sssd-dbus.x86_64: E: dbus-policy-allow-without-destination <allow send_interface="org.freedesktop.sssd.infopipe.Domains"/> /usr/share/dbus-1/system.d/org.freedesktop.sssd.infopipe.conf
> sssd-dbus.x86_64: E: dbus-policy-allow-without-destination <allow send_interface="org.freedesktop.sssd.infopipe.Domains.Domain"/> /usr/share/dbus-1/system.d/org.freedesktop.sssd.infopipe.conf
> sssd-dbus.x86_64: E: dbus-policy-allow-without-destination <allow send_interface="org.freedesktop.sssd.infopipe.Users"/> /usr/share/dbus-1/system.d/org.freedesktop.sssd.infopipe.conf
> sssd-dbus.x86_64: E: dbus-policy-allow-without-destination <allow send_interface="org.freedesktop.sssd.infopipe.Users.User"/> /usr/share/dbus-1/system.d/org.freedesktop.sssd.infopipe.conf
> sssd-dbus.x86_64: E: dbus-policy-allow-without-destination <allow send_interface="org.freedesktop.sssd.infopipe.Groups"/> /usr/share/dbus-1/system.d/org.freedesktop.sssd.infopipe.conf
> sssd-dbus.x86_64: E: dbus-policy-allow-without-destination <allow send_interface="org.freedesktop.sssd.infopipe.Groups.Group"/> /usr/share/dbus-1/system.d/org.freedesktop.sssd.infopipe.conf
> sssd-dbus.x86_64: E: dbus-policy-allow-without-destination <allow send_interface="org.freedesktop.sssd.infopipe.Cache"/> /usr/share/dbus-1/system.d/org.freedesktop.sssd.infopipe.conf
> sssd-dbus.x86_64: E: dbus-policy-allow-without-destination <allow send_interface="org.freedesktop.sssd.infopipe.Cache.Object"/> /usr/share/dbus-1/system.d/org.freedesktop.sssd.infopipe.conf
> sssd-dbus.x86_64: E: dbus-policy-allow-without-destination <allow send_interface="org.freedesktop.sssd.infopipe.Components"/> /usr/share/dbus-1/system.d/org.freedesktop.sssd.infopipe.conf
> 'allow' directives must always specify a 'send_destination'.

Signed-off-by: Samuel Cabrero <[email protected]>
@scabrero
Copy link
Contributor Author

Thanks, I dropped the first patch and rebased. I hope it is on time for 2.10.2.

Copy link
Contributor

@ikerexxe ikerexxe left a comment

Choose a reason for hiding this comment

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

LGTM. Thank you for taking into account the feedback.

@alexey-tikhonov
Copy link
Member

Pushed PR: #7794

  • master
    • afc643d - IFP: Restrict destination
  • sssd-2-10
    • 961742c - IFP: Restrict destination

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants