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

LDAP Problematic since the update to V.4 (currently 4.0.15 installed - now updated to v4.1.3 build 94)

Open pvhkai opened this issue 9 years ago • 14 comments

Hi @snipe,

regarding some other issues I open a new ticket because I think the older issue is fixed but I am now facing another problematic. I think it is better for the overview than having all converations on one issue.

My old ticket (https://github.com/snipe/snipe-it/issues/4050) can be closed after this ticket has been opened.

Overview: After upgrading from SnipeIT 3 to SnipeIT 4 I am facing issues regarding the LDAP synchronization of users. First I had some problems to find the correct settings (the was has been changed in the meanwhile from V.3 - V.4) - has been fixed in ticket https://github.com/snipe/snipe-it/issues/4255 . Current Problematic (find attached).

My LDAP Settings

LDAP Integration: [x] LDAP enabled Active Directory: [x] This is an Active Directory server LDAP Password Sync: [x] Yes Active Directory domain: company.com LDAP Server : ldap://company.com Use TLS: [ ] LDAP SSL certificate validation: [x] Allow invalid SSL Certificate LDAP Bind Username : adminuser LDAP Bind Password: ******* Base Bind DN: OU=ABC,DC=company,DC=local LDAP Filter: &(cn=*) Username Field: samaccountname Last Name: sn LDAP First Name: givenname LDAP Authentication query: sAMAccountName= LDAP Version: 3 LDAP Active Flag: LDAP Employee Number:telephoneNumber LDAP Email: mail

Locations

I have installed 8 Locations with local LDAP Search OU - Example for ID 1 - Duesseldorf:

OU=User Accounts,OU=DUS01,OU=Europe,DC=CORP,DC=COM

Current Problematic

  • I created two new locations with unique LDAP Search OU connected with less than 12 Users in each of them
  • If I now start the sync of one of the new Locations (by ID), the script always starts with the newest location (the one with the highest ID) and syncronizes the first 12 users, if the location has less than 12 users, it adds more users from the location with the second highest ID - until it has 12...
  • It happens also if you starting sync with another ID (ID1 /ID2 for example) it still starts sync with the highest ID (and only the first 12 Users)
  • If you sync without location ID... yes it stays the same... starting from highest ID and 12 users in count...

String with location-ID php artisan snipeit:ldap-sync --location_id=9 --summary

String without location-ID php artisan snipeit:ldap-sync --summary

Funfact

The sync of those 12 users works well... :D But there are only 12 users and only the one from the highest ID.

  • So I can guarantee that the LDAP Settings in my Adminpage ist correct and also the Search OU is correct set...
  • If I use the old setup (Ver.3.4) my settings are running very well!

No Idea... Can you help?

pvhkai avatar Oct 24 '17 12:10 pvhkai

How many total locations do you have?

snipe avatar Oct 24 '17 16:10 snipe

Hey @snipe ,

as written I have currently 8 locations installed and 2 for my test purposes... :) Together +- 1.500 Users...

pvhkai avatar Oct 24 '17 16:10 pvhkai

@richardhofman6 do you have any thoughts here?

snipe avatar Oct 24 '17 17:10 snipe

Not sure just yet - having a busy week sorry! @pvhkai Something to consider is that the --location_id argument doesn't affect which Snipe-IT location is imported, rather it sets the default location for any user that doesn't match a configured LDAP OU. So you're doing a full import every time you run the command, and the --location_id=9 means that any users that don't match a configured location OU will be assigned to that location.

If I understand you correctly, the symptoms you're describing seem to imply that if there are less than 12 users in an OU, the script is incorrectly overriding the locations for a remaining 12 - X users, and 'stealing' them from their correct group.

At this point I'm not sure of the significance of 12, and I'm also not sure how it would be overriding a configured LDAP location. I'll do some testing and post back.

rho333 avatar Oct 26 '17 02:10 rho333

@richardhofman6

First of all thanks for your help!

-> Okay regarding the --location_id argument was a missunderstanding from my side.

With this I need to correct:

  • It synchronizes (starting from the highest location ID/ newest location ID) and only the first 12! :) The synchronization itself works perfectly, but only 12 users get this update!

Example:

  1. Start synchronize by typing in: php artisan snipeit:ldap-sync --summary
  2. The script is doing something in the background
  3. The following summary comes out:
D:\snipe>php artisan snipeit:ldap-sync --summary
User Olga Kochani (username:  Okocha was UPDATED.
User Piotr Dimitri (username:  PDimitri was UPDATED.
User Hans Meiser (username:  HMeise was UPDATED.
User Natalia Zalivka (username:  NZaliv was UPDATED.
User Maciej Backinski (username:  MBacki was UPDATED.
User Malgorzata Aralinevic (username:  MArali was UPDATED.
User Kristina Mai (username:  KriMai was UPDATED.
User Sara Woic (username:  SaWoic was UPDATED.
User Weter Priffin (username:  WPriff UPDATED.
User Momer Timson (username:  MTimso was UPDATED.
User Estefania Banek (username:  Ebanek was UPDATED.
User Anastasia Shakira (username: AShaki was UPDATED.

Users: 1-10 are in the location with ID number 10 (Location-Name: Poland II / Location OU: OU=User Accounts,OU=WAR01,OU=Europe,DC=CORP,DC=COM). The Last User in the list is from Location number 9 (Location-Name: Hamburg II / Location OU: OU=User Accounts,OU=HAM01,OU=Europe,DC=CORP,DC=COM).

Is will stay tuned an waiting for your tests! :) Thanks man!!!

Best regards, Kai

pvhkai avatar Oct 26 '17 06:10 pvhkai

in

LDAP Authentication query: sAMAccountName=

i had to put the "samaccountname=" in lowers, with capitals it didnt work fine for me.

Also on

LDAP Filter: &(cn=*)

Maybe its more useful for u to use

&(sAMAccountType=805306368)(objectClass=user)(!(userAccountControl:1.2.840.113556.1.4.803:=2))

So ldap only sync users that are not disabled.

korio77 avatar Oct 27 '17 07:10 korio77

@korio77

Thanks for your help but that didnt solve the issue! The sync of only 12 users persists... :(

Best regards, KAi

pvhkai avatar Oct 27 '17 10:10 pvhkai

@snipe, since now no solution on this problematic. Any possibility to get payed support?

pvhkai avatar Oct 30 '17 14:10 pvhkai

@snipe @korio77 @richardhofman6 Just for your update! I installed the update to Version v4.1.3 build 94 (gb6a14d2) and tried the sync again. The only change is, that the system now only synchronize 10 users (starting with the highest location ID) instead of synchronizing 12 users.

pvhkai avatar Nov 07 '17 07:11 pvhkai

@snipe @korio77 @richardhofman6

I am gonna think of switching away from snipeIT cause of the not working LDAP (in my installtion).

Is there no LDAP specialist who could have a look on that case?

pvhkai avatar Nov 16 '17 10:11 pvhkai

@pvhkai I mean, lots of people are using LDAP with Snipe-IT just fine. There's nothing in the code that limits it to 12.

Have you tried pulling the latest version?

snipe avatar Nov 22 '17 05:11 snipe

@snipe I understand but the problem is that we did not change anything at our domain but we changed from version 3 to 4 and it the issue came up. So on the first view it looked like a issue with snipe and not with the LDAP.

I will check now and keep you updated!

pvhkai avatar Nov 24 '17 09:11 pvhkai

Hi @snipe nope only 10 (not 12) users has been synchronized. That count changed after the update (I think) from 4.0.x to 4.1.x

pvhkai avatar Nov 24 '17 10:11 pvhkai

@snipe

I am very very very sorry! I found the issue - there was a problem with one policy of the accountuser which I used for the sync. I created a new service account and now it works perfectly.

Sorry for all the work I have cost.. :(

pvhkai avatar Nov 29 '17 14:11 pvhkai