Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Description of problem:
One of new added functionalities of PAM PTA is support for multiple configuration entries. To be backward compatible, top-level configuration entry cn=PAM Pass Through Auth,cn=plugins,cn=config is still valid configuration entry. In addition to that, each child is also expected to be PAM PTA config entry. However, top-level config entry is being ignored when a child entry is present, and only child entries configure plugins behavior.
Version-Release number of selected component (if applicable):
tested on 389-ds-base-1.2.11.15-2.el6.x86_64
How reproducible:
always
Steps to Reproduce:
One way to reproduce is to setup top-level config entry to include ldap user and set child config entry to exclude user. Both instances have fallback set to false. When user tries to bind, top-level entry is ignored, and user binds. If however child config entry is set to include user entry, then user bind fails on 32 - user does no exist in PAM.
USERD="uid=tuserD, ..."
1) Add user $USERD
ldapmodify -h $IP -p $PORT -D "cn=directory manager" -w Secret123 <<EOF
dn: $USERD
changetype: add
...
userPassword: password
EOF
2) configure top-level entry to include $USERD and deny fallback
ldapmodify -h $IP -p $PORT -D "cn=directory manager" -w Secret123 <<EOF
dn: cn=PAM Pass Through Auth,cn=plugins,cn=config
changetype: modify
replace: nsslapd-pluginEnabled
nsslapd-pluginEnabled: on
-
replace: pamFallback
pamFallback: FALSE
-
replace: pamIncludeSuffix
pamIncludeSuffix: $USERD
EOF
3) configure child entry to exclude $USERD and deny fallback
ldapmodify -h $IP -p $PORT -D "cn=directory manager" -w Secret123 <<EOF
dn: cn=inst2,cn=PAM Pass Through Auth,cn=plugins,cn=config
changetype: add
cn: test1
objectClass: pamConfig
objectClass: top
pamIDMapMethod: RDN DN ENTRY
pamFallback: FALSE
pamSecure: FALSE
pamService: ldapserver
pamExcludeSuffix: $USERD
pamMissingSuffix: ALLOW
pamIDAttr: uid
EOF
4) restart server
service dirsrv restart
5) try to bind as $USERD
ldapsearch -h $IP -p $PORT -D "$USERD" -w password -b "$USERD"
Actual results:
echo $?
0
Expected results:
ldap_bind: No such object (32)
additional info: User id [tuserD] for bind DN [uid=tuserD,dc=suf1,dc=example,dc=com] does not exist in PAM
Additional info:
https://fedorahosted.org/389/attachment/ticket/181/0001-ticket-181-Allow-PAM-passthru-plug-in-to-have-multip.patch: "When the normal area in cn=config is used, both the top-level PAM passthru plug-in config entry and it's children are considered to be config entries."
Comments from the upstream ticket:
The problem here is that you have 2 overlapping config entries. The logic isn't designed to have the PAM passthru plug-in fall through when a configuration entry fails to work for authenticating a user. When a bind attempt comes in, the logic is as follows:
Loop through the PAM passthru config entries to see if the include/exclude suffix and filter settings apply to the bind target.
Use the first matching config entry with PAM to authenticate user.
Return BIND result to client.
There is no fallback logic. In your test scenario, the child config entry (cn=inst2,...) is checked first when we are looping through the config entries. When you exclude $USERD in the child entry, that config doesn't apply, so the top-level config entry is used. When you change the child to include $USERD, the child entry does apply, and that config entry is used instead of the top-level config.
The behavior described by design. The intention of allowing multiple PAM passthru configuration settings is to have separate configuration for separate entries (via suffix, filter, or a combination of the two). Having multiple configuration entries that apply to the same set of bind target entries is beyond the scope of the current design. This also matches up with the way most of the other DS plug-ins work that support multiple config entries.
I'm closing this as NOTABUG.
Description of problem: One of new added functionalities of PAM PTA is support for multiple configuration entries. To be backward compatible, top-level configuration entry cn=PAM Pass Through Auth,cn=plugins,cn=config is still valid configuration entry. In addition to that, each child is also expected to be PAM PTA config entry. However, top-level config entry is being ignored when a child entry is present, and only child entries configure plugins behavior. Version-Release number of selected component (if applicable): tested on 389-ds-base-1.2.11.15-2.el6.x86_64 How reproducible: always Steps to Reproduce: One way to reproduce is to setup top-level config entry to include ldap user and set child config entry to exclude user. Both instances have fallback set to false. When user tries to bind, top-level entry is ignored, and user binds. If however child config entry is set to include user entry, then user bind fails on 32 - user does no exist in PAM. USERD="uid=tuserD, ..." 1) Add user $USERD ldapmodify -h $IP -p $PORT -D "cn=directory manager" -w Secret123 <<EOF dn: $USERD changetype: add ... userPassword: password EOF 2) configure top-level entry to include $USERD and deny fallback ldapmodify -h $IP -p $PORT -D "cn=directory manager" -w Secret123 <<EOF dn: cn=PAM Pass Through Auth,cn=plugins,cn=config changetype: modify replace: nsslapd-pluginEnabled nsslapd-pluginEnabled: on - replace: pamFallback pamFallback: FALSE - replace: pamIncludeSuffix pamIncludeSuffix: $USERD EOF 3) configure child entry to exclude $USERD and deny fallback ldapmodify -h $IP -p $PORT -D "cn=directory manager" -w Secret123 <<EOF dn: cn=inst2,cn=PAM Pass Through Auth,cn=plugins,cn=config changetype: add cn: test1 objectClass: pamConfig objectClass: top pamIDMapMethod: RDN DN ENTRY pamFallback: FALSE pamSecure: FALSE pamService: ldapserver pamExcludeSuffix: $USERD pamMissingSuffix: ALLOW pamIDAttr: uid EOF 4) restart server service dirsrv restart 5) try to bind as $USERD ldapsearch -h $IP -p $PORT -D "$USERD" -w password -b "$USERD" Actual results: echo $? 0 Expected results: ldap_bind: No such object (32) additional info: User id [tuserD] for bind DN [uid=tuserD,dc=suf1,dc=example,dc=com] does not exist in PAM Additional info: https://fedorahosted.org/389/attachment/ticket/181/0001-ticket-181-Allow-PAM-passthru-plug-in-to-have-multip.patch: "When the normal area in cn=config is used, both the top-level PAM passthru plug-in config entry and it's children are considered to be config entries."