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

Authentication rule condition basedn matching does not work #6402

Closed
alarsing opened this issue Jun 22, 2021 · 2 comments · Fixed by #6414
Closed

Authentication rule condition basedn matching does not work #6402

alarsing opened this issue Jun 22, 2021 · 2 comments · Fixed by #6414
Assignees

Comments

@alarsing
Copy link

Describe the bug
Authentication rule with condition basedn match does not work. The problem is in file lib/pf/Authentication/Source/LDAPSource.pm the function ldap_filter_for_conditions. It will return string "basedn" not the actual value of the basedn that was specified in Authentication rule.

To Reproduce

  1. Create new LDAP/AD Authentication Source and add Authentication Rule.
  2. Set Conditions basedn is "ou=Computers,dc=your,dc=domain"
  3. Monitor logs and see error: [AD-Source] Unable to execute search (&(|(servicePrincipalName=host/COMPUTER.your.domain)(sAMAccountName=host/COMPUTER.your.domain)(UserPrincipalName=host/COMPUTER.your.domain))) from basedn on adsrv.your.domain:389, we skip the rule. (pf::Authentication::Source::LDAPSource::_match_in_subclass)
@nqb
Copy link
Contributor

nqb commented Jun 22, 2021

Hello,

Could you provide more details about "It will return string "basedn" not the actual value of the basedn" ?
I'm not sure to understand what you mean here.

Thanks

@alarsing
Copy link
Author

Log is generated from subclass _match_in_subclass

on line 448 $logger->error("[$self->{'id'}] Unable to execute search $filter from $basedn on $LDAPServer:$LDAPServerPort, we skip the rule.");

$basedn is equal to "basedn" but should be "ou=Computers,dc=your,dc=domain"

in file lib/pf/Authentication/Source/LDAPSource.pm
line 591 sub ldap_filter_for_conditions {
line 615 if ($attribute eq "basedn") {
line 616 $basedn = $attribute;
line 617 next;
line 618 }

Line 616 should be $basedn = $value not $attribute

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

Successfully merging a pull request may close this issue.

4 participants