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

Top-level config entry of PAM PTA plugin is ignored when multiple instances are configured #492

Closed
389-ds-bot opened this issue Sep 12, 2020 · 5 comments
Labels
closed: not a bug Migration flag - Issue

Comments

@389-ds-bot
Copy link

Cloned from Pagure issue: https://pagure.io/389-ds-base/issue/492


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

  1. 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

  2. restart server
    service dirsrv restart

  3. 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."

@389-ds-bot 389-ds-bot added the closed: not a bug Migration flag - Issue label Sep 12, 2020
@389-ds-bot
Copy link
Author

Comment from nkinder (@nkinder) at 2012-10-30 00:44:27

Linked to Bugzilla bug: https://bugzilla.redhat.com/show_bug.cgi?id=868167 (''Red Hat Enterprise Linux 6'')

@389-ds-bot
Copy link
Author

Comment from nkinder (@nkinder) at 2012-11-06 22:32:59

This problem could be related to the fact that you are using the DN of "user D" as a suffix in the PAM config. This is not correct. The include/exclude suffixes are supposed to be top-level suffixes, not any arbitrary DN within your tree.

This needs to be tested using valid suffixes in the config.

@389-ds-bot
Copy link
Author

Comment from nkinder (@nkinder) at 2012-11-06 22:58:52

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.

@389-ds-bot
Copy link
Author

Comment from nkinder (@nkinder) at 2012-11-06 23:22:37

The behavior described in comment3 is 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 INVALID.

@389-ds-bot
Copy link
Author

Comment from nkinder (@nkinder) at 2017-02-11 23:09:31

Metadata Update from @nkinder:

  • Issue assigned to richm
  • Issue set to the milestone: N/A

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed: not a bug Migration flag - Issue
Projects
None yet
Development

No branches or pull requests

1 participant