-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
[Feature Request]: Please add some configuration setting so that LDAP passwords are not kept in Snipe-IT DB #13336
Comments
If you turn off the "LDAP Password Sync" setting, does that do what you want? We are supposed to no longer sync passwords into the Snipe-IT User record when that setting is turned off. If not, then that's a bug. |
Hi, Thank you for your prompt reply. It turns out that the translation for the help text of this field is wrong in our language: it just says the contrary of what it should ;-). I'll try to help on this later this month. Yet, un-ticking the box did not change the behaviour. The passwords are still going to the password column :-/. Besides, those already present are not erased when we delete a user from the web UI. Hope this helps. |
@uberbrady we generate a completely random (very long) password to initially create the user, as password is required on all users. However the password does not get synced from LDAP if the "LDAP Password Sync" option is unchecked. There is a password, just not their password, and because we implement brute force prevention/login throttling, it would be statistically impossible to brute force using the generated password. |
OK, I just checked this and you are right @snipe , the value does not match the bcrypt-ed value of the passwords. |
Oh, just one more thing: it looks like once a (ldap) user has authenticated with the "sync" setting enabled, when the setting is disabled and the user re-authenticates, the user password in the DB is not reset to the arbitrary value you mention. |
The trick we do on SCIM is we put But that's a long-winded way of saying "I think if you uncheck that setting it should do what you want." :) |
Let me test this and see if I can reproduce. |
Since the arbitrary password value is, well, arbitrary, I'm not sure how we could reset it back to what it was, but we should at least be giving it a different arbitrary value. @uberbrady If you'd like to standardize using `NO PASSWORD as an unhashed password (stored in cleartext, since the hash comparison will never, ever match and therefore they cannot login using that value, we could probably do that, but I'd think we'd want it to be consistent across the boards. We just need to make sure we're NOT hashing it anywhere we're doing an LDAP import/sync/etc. It might speed things up a little (since hashing has a cost), but I'm on the fence since if we miss removing the hash, we've just made a standard password for LDAP users. 😱 That can also be part of a separate discussion though. For now, I can just fix this one bit. |
I did double-check an instance by doing a |
@uberbrady that's not what I meant. We specifically use bcrypt when we sync users, so md5 wouldn't matter. snipe-it/app/Console/Commands/LdapSync.php Lines 183 to 185 in 74a5bcd
I just mean that if we were going to insert Lemme get this small change out for now at least, we can chat more about the |
It also doesn't start with the |
Sorry, I'm not a native speaker. I must have be unclear. Please consider this sequence of actions:
Now, from what I saw earlier today, the bcrypted password is kept unchanged in the DB. I mean the hash is still the actual password hash generated at step 3 above. I'd suggest that on such occasions the actual password hash be replaced by the usual random generated password hash. I understand that since there is no way for the application to know if the current hash in the DB is from an actual or arbitrary password, then the hash should be replaced every time according to the current setting. I don't think this would be costly as problematic as long as bcrypt is used. This might become so if argon were used with a long ARGON_TIME setting, yet. |
I understood what you meant and was already working on a fix :) My internet connection was crappy so I couldn't push the branch yesterday. |
…ap_pw_sync_not_enabled Fixed #13336 - Save unhashed password if no password provided
Is your feature request related to a problem? Please describe.
I noticed that LDAP users passwords (once users have authenticated once) are copied over in Snipe-IT DB which:
Describe the solution you'd like
I understand (but did not test, to be honest) that this might be useful should the LDAP authentication be broken somehow, but I'd really prefer to be given the choice between:
Besides it looks to me that having those passwords copied into the application DB plainly defeats the whole purpose of a central authentication mechanism such as LDAP that let passwords being kept in one single place.
I think some configuration setting to let this password copy being en/disabled would be a great feature.
Thanks in advance
Describe alternatives you've considered
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: