snipe-it icon indicating copy to clipboard operation
snipe-it copied to clipboard

LDAP Filter doesn't work with memberOf attribute

Open marekbeckmann opened this issue 5 years ago • 8 comments

Debug mode

Describe the bug

Hello,

for our enterprise Snipeit server, we have enabled LDAP Login, but only want users of a specific group to be able to log in (e.g snipeitusers). However, it seems, like the memberOf attribute in the filter doesn't work, because every user can log in.

Here's the filter that we use:

&(memberof=CN=snipeitusers,OU=groups,OU=some,DC=ad,DC=org,DC=com)

I have also tried different variations of this filter, but no luck. Is this a genuine bug or am I making a mistake here?

Reproduction steps

  1. Enable LDAP
  2. Use a Filter with memberOf=... attribute

Expected behavior

Access is only granted to users within the "snipeitusers" group, but not to anyone else.

Snipe-IT Version

v5.2.0

Operating System

Debian 11

Web Server

Apache2

PHP Version

7.4

Operating System

Windows 10

Browser

Chrome

Version

94.04

Additional context

This is a fresh install on a Bullseye VM, using NGINX as reverse proxy to Apache2 as webserver. Everything works fine, except for the LDAP filter.

marekbeckmann avatar Oct 20 '21 08:10 marekbeckmann

👋 Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.

welcome[bot] avatar Oct 20 '21 08:10 welcome[bot]

Seems, like I'm not the first person, to stumble upon this issue... There is also a suggested solution in #6674

marekbeckmann avatar Oct 20 '21 08:10 marekbeckmann

My filter forking fine: (&(objectclass=person)(memberof=CN=grupname,OU=app,OU=Group,DC=example,DC=com))

bba-dvhk avatar Nov 26 '21 14:11 bba-dvhk

Похоже, я не первый, кто столкнулся с этой проблемой... В [#6674 также есть предлагаемое решение.]

I have exactly the same problem! I tried to edit the file /var/www/html/app/Models/Ldap.php as described in #6674, but unfortunately it didn't work :(

djooberlee avatar May 17 '22 09:05 djooberlee

@djooberlee this ticket is pretty old, and the OP is using Snipe-IT that is many versions behind. I'm not sure their issue is still valid in v6.

snipe avatar May 17 '22 09:05 snipe

@snipe the problem hasn't gone away. Because the filter and synchronization work as expected, but this filter does not work when logging in. Any ldap user can log in, not just a member of the group specified in the filter. Everything is exactly as described by OP.

djooberlee avatar May 17 '22 10:05 djooberlee

@djooberlee what version are you using?

snipe avatar May 17 '22 10:05 snipe

@snipe v5.4.4

UPD: My apologies! Version 6.0.1 does not have this problem!

djooberlee avatar May 17 '22 11:05 djooberlee