Missing channel binding prevents authentication to ActiveDirectory
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cyrus-sasl2 (Ubuntu) |
Fix Released
|
Undecided
|
Andreas Hasenack | ||
Jammy |
Fix Released
|
Undecided
|
Lena Voytek | ||
openldap (Ubuntu) |
Fix Released
|
Undecided
|
Sergio Durigan Junior | ||
Jammy |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
[Impact]
When attempting to authenticate against a Windows Active Directory server configured to require SASL channel binding over SSL/TLS ldap connections (ldaps), authentication will fail stating invalid credentials as the cause.
This is due to cyrus-sasl2 missing the sasl channel binding feature of GSSAPI/GSS-SPNEGO.
Furthermore, for interoperability with Windows Active Directory Server, it's necessary to be able to set the SASL SSF (security strength factor) to 0 (zero) when it's used over an already encrypted connection like ldaps.
To fix these issues, these items are added as patches from a set of upstream commits.
[Test Plan]
To reproduce this issue, a machine running Windows with Active Directory must be available over the network. As an example, for Windows Server 2019 Evaluation:
The ISO can be downloaded from https:/
Install Windows Server, Active Directory, and Certificate Services, then add the following registry changes from https:/
[HKEY_LOCAL_
"ldapserverinte
"LdapEnforceCha
Also enable LDAP logging for Active Directory:
Reg Add HKEY_LOCAL_
With the Windows machine available, set up an Ubuntu system on a network that can reach the Windows server. This works best and with less configuration needed if the Windows server is acting as DNS and DHCP server for that network.
Install packages with:
$ sudo apt install ldap-utils libsasl2-
When the Configuring Kerberos Authentication prompt shows up, use the realm of the Windows Server. If prompted, use the windows server IP for the Kerberos KDC and admin servers.
Save the Windows Server AD CA certificate file as /usr/local/
$ sudo update-
In /etc/ldap/ldap.conf set
BASE dc={REALM NAME} # split the domain components like dc=example,dc=com
URI ldaps://{WINDOWS SERVER MACHINE NAME}.{REALM NAME}
With Ubuntu set up, the actual test can be run:
$ kinit
Enter Password
$ ldapwhoami -Y GSSAPI -O maxssf=0 -o SASL_CBINDING=
Prior to the fix, this would display the following:
SASL/GSSAPI authentication started
ldap_sasl_
additional info: 80090346: LdapErr: DSID-..., comment: AcceptSecurityC
With the fix, the authentication will display the user information.
The same happens with
$ ldapwhoami -Y GSS-SPNEGO -O maxssf=0 -o SASL_CBINDING=
SASL/GSS-SPNEGO authentication started
ldap_sasl_
additional info: 80090346: LdapErr: DSID-..., comment: AcceptSecurityC
[Where problems could occur]
Based on the patches added, any problems that show up would likely occour either in the gssapi plugin or the SASL2 macros. The two files changed are plugins/gssapi.c and m4/sasl2.m4, along with some tests.
There are various situations apart from this one in which GSS-API can be used, and this change may affect the way some of these interactions over the network are handled.
In parallel with this SRU, we tested, in jammy, cyrus-imapd server and gssapi authentication over tls, with and without this updated sasl package. Using as a client thunderbird, imtest (from cyrus-imapd-
[Other Info]
This issue was fixed in kinetic in version 2.1.28+
This SRU is also pulling in the new DEP8 tests in the kinetic package for cyrus-sasl2. The only changes made to those tests are the list of mechanisms to test, which is slightly smaller in jammy, and an extra package to install for one of the tests due to packaging differences in jammy wrt kinetic.
[Original Description]
> Are you uncertain if your issue is really a bug?
Effect is an authentication error. Root case is a "missing feature" (see below) and requires updating dependencies, downporting.
> If you are certain this is a bug please include the source package the bug is in.
It's in the interaction between three libraries: openldap, cyrus-sasl, krb5
> 1) The release of Ubuntu you are using, via 'lsb_release -rd' or System -> About Ubuntu
Broken in 18.04 and also in 20.10 (I guess it's also broken in anything inbetween)
> 2) The version of the package you are using, via 'apt-cache policy pkgname' or by checking in Software Center
libsasl2-
ldap-utils: 2.4.53+
libgssapi-krb5-2: 1.17-10ubuntu0.1
> 3) What you expected to happen
# kinit
$ export LDAPSASL_
$ ldapwhoami -O minssf=0,maxssf=0 -N -Y GSSAPI -H ldaps://<DC-fqdn>
SASL/GSSAPI authentication started
SASL username: <some-username>
SASL SSF: 0
u:<some-username>
> 4) What happened instead
SASL/GSSAPI authentication started
ldap_sasl_
additional info: 80090346: LdapErr: DSID-0C090597, comment: AcceptSecurityC
---------------
Microsoft ActiveDirectory has "LDAP Channel Binding" and recommends activating this as a required feature. See https:/
Authentication to any AD DC which has mandatory channel binding fails.
Channel binding requires at least an update to cyrus-sasl, which is not in any release as far as I can see:
https:/
It also needs this commit in openldap:
https:/
Which as far as I can tell is v2.5 (branch OPENLDAP_
RH also mentions it needs up-to-date krb5 libraries, but I can't tell what minimum version this needs.
I can build all libraries from source, current master (except for krb5 where I've used 1.18.3) and can confirm that channel binding works when using those libraries.
I'm not sure if Samba is affected, but at least adcli, ldap-utils, and I would guess by extension also SSSD and realmd.
Related branches
- git-ubuntu bot: Approve
- Andreas Hasenack (community): Approve
- Canonical Server: Pending requested
- Canonical Server Reporter: Pending requested
-
Diff: 761 lines (+697/-0)10 files modifieddebian/changelog (+18/-0)
debian/patches/0034-channel-binding-gssapi-gss-spnego.patch (+122/-0)
debian/patches/0035-Add-support-for-setting-max-ssf-0-to-GSS-SPNEGO-1.patch (+93/-0)
debian/patches/0035-Add-support-for-setting-max-ssf-0-to-GSS-SPNEGO-2.patch (+59/-0)
debian/patches/series (+3/-0)
debian/tests/control (+16/-0)
debian/tests/gssapi (+151/-0)
debian/tests/pluginviewer (+14/-0)
debian/tests/saslauthd (+151/-0)
debian/tests/shared-secret-mechs (+70/-0)
- git-ubuntu bot: Approve
- Lucas Kanashiro (community): Approve
- Canonical Server Reporter: Pending requested
-
Diff: 330 lines (+296/-0)5 files modifieddebian/changelog (+13/-0)
debian/patches/0034-channel-binding-gssapi-gss-spnego.patch (+124/-0)
debian/patches/0035-Add-support-for-setting-max-ssf-0-to-GSS-SPNEGO-1.patch (+95/-0)
debian/patches/0035-Add-support-for-setting-max-ssf-0-to-GSS-SPNEGO-2.patch (+61/-0)
debian/patches/series (+3/-0)
Changed in cyrus-sasl2 (Ubuntu): | |
assignee: | nobody → Sergio Durigan Junior (sergiodj) |
assignee: | Sergio Durigan Junior (sergiodj) → Andreas Hasenack (ahasenack) |
Changed in cyrus-sasl2 (Ubuntu): | |
status: | Confirmed → In Progress |
Changed in cyrus-sasl2 (Ubuntu Jammy): | |
assignee: | nobody → Andreas Hasenack (ahasenack) |
status: | New → Triaged |
Changed in cyrus-sasl2 (Ubuntu Jammy): | |
assignee: | Andreas Hasenack (ahasenack) → nobody |
Changed in cyrus-sasl2 (Ubuntu Jammy): | |
assignee: | nobody → Lena Voytek (lvoytek) |
status: | Triaged → In Progress |
description: | updated |
description: | updated |
description: | updated |
description: | updated |
description: | updated |
tags: | removed: server-todo |
description: | updated |
Might have been confusing to write
# kinit CBINDING= tls-endpoint
$ export LDAPSASL_
Both are supposed to be called from the same user. I meant to imply that an existing, valid ticket in the current user's credential cache is required for krb5 authentication via SASL in the ldapwhoami step.