Open alexpevzner opened 3 days ago
I tried deleting these lines and recompiling. Everything immediately started working in the domain.
I am not sure that removing this stripping will not break kerberos-related stuff, but I did not investigate.
I happen to still have a copy of the SVN repository; this is where the stripping originated:
------------------------------------------------------------------------
r6714 | mike | 2007-07-24 18:27:57 +0000 (Tue, 24 Jul 2007) | 4 lines
Fix Kerberos authentication - comment out the client SPNEGO code and strip
the @KDC portion of the Kerberos username since we can't really do group
lookups with it.
------------------------------------------------------------------------
More than likely the Kerberos PAM support code back then didn't properly handle domain accounts. I'm thinking maybe we just add a configuration directive for this ("StripUserDomain yes/no" or something like that). But longer term you'll need to transition to OAuth (supported in recent Windows Server/Azure AD), which will be supported in CUPS 2.5 and later (Kerberos won't be supported beyond CUPS 2.5.x...)
NSS modules should return a correct username that does not require stripping or other changes, I think. "StripUserDomain yes/no" sounds like a good idea, maybe someone with something not common nowadays like pam_krb5 may need it, but the default should be "no", I think.
What about kerberos depreceation, there are no good and maintainable free, open source OAuth servers, at least I do not know such. Keycloack is Java, it is not maintainable as a distro package. FreeIPA is kerberos.
My colleagues and I checked the work with kerberos patched cups, where the domain cut-off code was deleted. Everything is working normally.
but the default should be "no", I think.
I support that the default should be the full name without cutting it off.
but the default should be "no", I think.
I support that the default should be the full name without cutting it off.
I also meant that
@mikhailnov WRT free and open source OAuth servers, there is my mOAuth project at least, which I am updating now to full OpenID conformance. And of course Microsoft is all-in on OAuth/OpenID which is the 99% requirement for SSO on Linux desktops.
Introducing an option to disable domain name stripping appears to be a viable solution to address our current challenges. Especially if stripping is disabled by default, so it will streamline the process for our administrators, eliminating the need for widespread configuration file modifications.
Nevertheless, the security implications stemming from the current stripping mechanism remain some concern for me. If domain name occasionalлy clashes with some privileged local name, it opens interesting possibilities...
@michaelrsweet Thanks for pointing to mOAuth. What do you think about removing or disabling this stripping of username, will it break anything?
@mikhailnov Like I said earlier, I have no problems adding a configuration directive to control the stripping, with the default setting of "do not strip".
Ok, thanks!
We are trying to use CUPS on Linux machine connected to the MS AD domain.
When user logs into the system, it receives
uid=1136733317
or similar and this UID is properly resolved by thesss
plugin to/etc/nsswitch.conf
astestovmt@example.com
with all appropriate groups membership, including thelpadmin
group.However, when user attempts to do some administrative tasks with printing system, the attempt is rejected as unauthorized and we see the following lines in log.
Looking to the
scheduler/auth.c
source file, at around line 2205, I see the following code fragment:So after successfully verifying that the supplied information via
HTTP PeerCred
corresponds to theSO_PEERCRED
UID
, CUPS proceeds to strip the domain part of the user name. Subsequently, only the local part of the user name is checked for group membership, mirroring the behavior observed in the logs.This process leads to two significant issues:
I suspect that there is a valid reason behind the decision to strip the domain part of the user name before group membership checks. Despite my efforts to trace this logic through the git history, it appears to originate from Apple's old SVN, which is inaccessible to the public.
Therefore, the key question is whether we should eliminate the domain name stripping process. If not, what would be the appropriate logic to implement in its place?
P.S.
There is a similar issue at the Red Hat Customer portal: https://access.redhat.com/discussions/6678951