snipe / snipe-it

A free open source IT asset/license management system
https://snipeitapp.com
GNU Affero General Public License v3.0
11.02k stars 3.18k forks source link

Issue with LDAP filtering #7538

Closed Raumbaren closed 5 years ago

Raumbaren commented 5 years ago

Expected Behavior (or desired behavior if a feature request)

LDAP sync filters the users based on the specified CN and syncs only users in that group.


Actual Behavior

When using a wildcard filter such as &(cn=*) it will successfully pull down all users in Jumpcloud including service accounts, admin accounts, and other misc crap we have in there so we've confirmed that LDAP Sync works. However, when we specify a target container with &(cn=SnipeUsers,ou=Users,o=org-id,dc=jumpcloud,dc=com) or &(cn=SnipeUsers) the sync completes successfully but does not pull down any users. Additionally, when we use the filter provided by Jumpcloud's ldap sync documentation for syncing a target group (&(objectClass=groupOfNames)(cn=SnipeUsers)) or (&(objectClass=groupOfNames)(cn=SnipeUsers,ou=Users,o=org-id,dc=jumpcloud,dc=com)) we get the following error:

Error: ldap_search(): Search: Bad search filter


Please confirm you have done the following before posting your bug report:


Provide answers to these questions:

Please do not post an issue without answering the related questions above. If you have opened a different issue and already answered these questions, answer them again, once for every ticket. It will be next to impossible for us to help you.

https://snipe-it.readme.io/docs/getting-help

Scintillator commented 5 years ago

It doesn't seem like you are using the Base Bind DN, just the LDAP Filter.

Try this: Base Bind DN: OU=Users,DC=jumpcloud,DC=com LDAP Filter: &(cn=*)(o=org-id)

Raumbaren commented 5 years ago

To clarify, LDAP sync is working so my Base Bind DN and wildcard filter are both fine as is. The problem is we want to target a specific group for ldap sync rather than pulling the entire directory down as it includes a bunch of accounts that are unnecessary for snipe. That is where I'm running into a problem and I included several examples in the Actual Behavior section above.