-
Notifications
You must be signed in to change notification settings - Fork 529
Server Version 0.74.3 is generating duplicate user accounts after upgrading #4271
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
Comments
What does "duplicated user accounts" mean exactly? |
@scudette Like this it is presented as the same user two times in the GUI. /app/index.html?org_id=root#/users Also when you examine the results from GetGlobalUsers API call, there are duplicate user accounts as well. The duplicate users have the same exact permissions and orgs assigned as each other. What may also help in terms of context is that we are using Azure SSO authenticator. |
@scudette Figured out the issue! It had everything to do with the backing datastore storage and maybe how the code handles storage of user account names to a file and how it is later retrieved. Specifically data in "root of velociraptor datastore directory/users/useraccountname.db" or "root of velociraptor datastore directory/orgs//users/useraccountname.db". Assume I create a user account named, "[email protected]":
I make a new user account from the GUI named, "[email protected]", of course I as a end user have assumed that if there is no user in the GUI, this account does not or never existed and I am okay to make another one:
What's odd is that when the actual user account name created via GUI is stored in the db file with the exact string. For example, I create a user "[email protected]", in the db file it is stored as "[email protected]". I was able to test my hypothesis by deleting ALL db or json.db files and directories related to the old user account name that were not deleted. After making the GetGlobalUsers API call again, the duplicates disappeared. In short:
|
We used to have case sensitive user names but this caused a lot of confusion with systems that were not case sensitive so now we actually treat case sensitivity as duplicates. This looks like an edge case where we don't actually handle this correctly. As for deleting the user account this is by design as the user account is essentially useless without any ACL permissions in the relevant orgs. So deleting a user just removes their permissions everywhere. Then when adding the same user again it should reuse the same record file. Maybe that's where the bug lies, we don't normalise the user names properly in the data store |
Previously there was a time based cache but we dont expect a lot of users so we can reasonable keep the user list in memory permanenetly. This helps to address potential problems in casing when saving user accounts with different cases. The new code deliberately catches these potential casing clashes and ignores user accounts and acls for users who differ only in case. This might help resolve #4271
Moving from a version of Velociraptor with the old version scheme 0.7.x to the new one 0.74.3.
There seems to be a strange issue where accounts made by SSO are duplicated after the user account logs into the upgraded server.
I've tried various things like completely wiping out the accounts including the backend files. But that does not stop this issue from happening again.
The text was updated successfully, but these errors were encountered: