mirror of
https://github.com/lldap/lldap.git
synced 2026-04-25 08:15:52 +03:00
[GH-ISSUE #539] [FEATURE REQUEST]: LDAP migration tool automation/save progress #197
Labels
No labels
backend
blocked
bug
cleanup
dependencies
docker
documentation
duplicate
enhancement
enhancement
frontend
github_actions
good first issue
help wanted
help wanted
integration
invalid
ldap
pull-request
question
rust
rust
tests
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/lldap-lldap#197
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @stefandesu on GitHub (Apr 10, 2023).
Original GitHub issue: https://github.com/lldap/lldap/issues/539
Hi,
First of all, I would like to say that I really appreciate this tool and everybody working on it! I'm not using it in production yet (as I'm still struggling with user migration, hence this issue), but it's almost exactly what I've been looking for to manage my LDAP users.
I don't want to attack anyone who worked on this, so I hope you won't take this the wrong way... The LDAP migration tool is absolutely infuriating to use. It feels like it was only ever used in optimal case scenarios.
First of all, there seems to be no documentation on this. I only found it through the issue tracker and eventually figured out how to call it (
docker compose exec lldap ./migration-tool).It only seems to work in about 1 in 20 cases. In the other 19 cases, I get the following message:
Literally nothing was different between the calls where it worked and those where it don't.
Why do I know this? I've had to use it several times because whenever something is not exactly right (i.e. a user is missing a certain field), it quits. This also means that I needed to input all the configuration several times throughout this journey of using the tool.
Eventually, after adding
uids to all users and adding missing email addresses, it worked and, supposedly, migrated all my users. Horray!But... the login doesn't work. It seems like the passwords were not migrated correctly. I tried two different users (my personal user account and a test account) and it always shows "Invalid username or password". I'm assuming it's because I'm using "crypt" for password hashes (I don't remember why exactly, but that's what I researched back then).
I'm using both openldap and lldap via Docker (Compose) and for lldap I'm using the
latesttag (only due to a fix for Safari that isn't released yet).As I don't want this to be only a rant, I'll leave some ideas for improvements on the tool:
cnfor user names, and it would have been great to use that for the ID in lldap as well. Also the tool usescnbeforedisplayNamefor the display name of users and for the last name as well, so after the import, the ID, display name, and last name of all users are simply thecn(oruidwhich I added to make the tool work).I'm actually not sure if I can use lldap if no. 5 is not fixed because I don't want to force all my users to reset their passwords. I also don't know any Rust, otherwise I'd totally try to fix these issues myself.
I hope this was helpful in any way, even if it was a bit of a rant. If you have any idea how to fix the password issue, I'd be very grateful!
@nitnelave commented on GitHub (Apr 10, 2023):
Hi! Sorry that the migration tool didn't work well for you :/
First of all, I've got some bad news for you: due to the security protocols used by LLDAP, it's not possible to import/export passwords (you can migrate them to another instance of LLDAP, but that's about it). This is due to the use of the OPAQUE protocol, so rather than a hash of the password, we store just enough information that we can negotiate a zero-knowledge proof with the user that they hold the same password as at registration time. Just to restate it:
It's not possible to migrate the passwords from another LDAP server to LLDAP.
It might be worth a warning at the beginning of the tool.
Now that we got that out of the way, let's have a look at what else we got wrong.
-it(interactive, tty):docker compose exec -it lldap ./migration-tool. A more straight-forward way to call it would be just:docker run --rm -it --entrypoint ./migration-tool lldap/lldap. That should fix the invalid terminal size.uids can be invalid, the emails can be malformatted and so on, it's very much up to the admin to double-check that everything went well. It could use some more error-recovery mechanisms and being generally more flexible. However, I also don't want to make the tool a kitchen-sink of LDAP utilities, so some judgement will be necessary for what can make the cut.That is probably true :D It's more of a proof-of-concept that I made for my own needs than a well-polished universal tool.
I haven't had much demand for this tool so far, so I haven't invested a lot of time in it, but contributions are welcome!
@stefandesu commented on GitHub (Apr 10, 2023):
Thanks @nitnelave for the quick reply!
That's good to know! As I really want to move away from OpenLDAP/phpLDAPadmin, I will need to ask my users to reset their passwords, it seems. But that does mean that the migration tool (kinda) worked for me, because I have at least all the users in there now. 😁
Ooooh I see. I wonder why it still worked some of the time though. Very strange. 😅
Yeah for sure! I guess with a little bit of documentation (especially about its caveats) and maybe a remapping feature, the migration tool would totally be fine. 👍 I have to admit that manually recreating the accounts would probably have been faster for me, but at least I created this issue because of it. 😅
@nitnelave commented on GitHub (Apr 11, 2023):
Note for future implementation: there may be a way forward to, at some point, be able to import passwords from other servers. In the context of this LLDAP RFC, calling attention to this specific paragraph: LLDAP RFC - OPAQUE Migration
Basically, have the general hash check available, and on first login convert to OPAQUE format for safety. Note that it does prevent you from re-exporting the passwords.
@dvv commented on GitHub (Jan 31, 2024):
I gave up trying to automate the migration tool and drafted envvar-driven version here https://github.com/lldap/lldap/compare/filters...dvv:lldap:filters
@nitnelave commented on GitHub (Jan 31, 2024):
Yeah, it's not made to be automated, but rather to guide you through a one-time migration.
I'm curious, why do you need to automate the migration?
@dvv commented on GitHub (Jan 31, 2024):
@nitnelave I'm considering using it as a cron task to pull external (source, but badly maintained) ldap data into my (shiny)) lldap instance.