Disabled LDAP accounts can still login into Rocket Chat
Your Rocket.Chat version: (0.41.0)
Two issues in one:
- Disabling an user account in Active Directory does not prevent that user from being able to login to Rocket Chat;
- Disabling an user account in Active Directory does not terminate any existing Rocket Chat session for that user. Each authenticated session should perform periodic re-authentication, or the server should have an ldap listener and terminate the session(s) for any account which is no longer valid in the directory.
Would like to request that high priority be given to this issue, since it is a serious security issue.
Thanks in advance.
@doctorwho92 Why did you close this? As you said, it's a pretty big problem for people using LDAP auth.
I didn't close it, or certainly not deliberately.
Have anybody tried to disable LDAP > Login Fallback to prevent this security issue?
Tested using latest develop branch, still happening. Login Fallback will prevent disabled users from logging on, but it will not allow local users (such as admin) to login (as designed).
We're using this filter for LDAP logins, this allows subtree search and logins with username or email, for enabled users only: {"filter": "(&(objectClass=person)(|(userAccountControl=512)(userAccountControl=66048))(|(mail=#{username})(sAMAccountName=#{username})))", "scope": "sub", "userDN": "[email protected]", "password": "HIDDEN"}
Details about userAccountControl values here: https://support.microsoft.com/en-us/kb/305144 and here: http://jackstromberg.com/2013/01/useraccountcontrol-attributeflag-values/
Perhaps this could be set as a default filter for a clean Rocket.Chat install? It will speed up adoption and ease the process of integrating with LDAP.
I can confirm the problem: a removed user from AD is still able to login as long as "LDAP/Login Fallback" is set to "True". If it's set to "False" the user can't login, but this disables the initial, local admin user too and one has to put another AD user to admin group the get admin access again:
db.users.update({username:'otheruser'}, {$set: {'roles' : [ "admin" ]}});
But what happens if one changes the LDAP configuration to something wrong and the LDAP connection is not working any more? In that case your are blocked completely.
LDAP_Login_Fallback workaround? db.rocketchat_settings.update({'_id':'LDAP_Login_Fallback'}, {$set: { 'value':true }})
If the LDAP/AD connection is fine and "Domain Search User" can log in, an user object that does not exist any more, to my mind this is not a case of LDAP_Login_Fallback.
Ciao!
I think doing what's suggested in #7235 should work for LDAP auth. Basically you would disable RC users that are disabled or missing in LDAP directory. This would be during regular LDAP database sync. I don't think regular re-auth is a good idea in the case of an unstable LDAP connection locking out users. Sync on the other hand, is more definitive--- If the user is disabled in the LDAP/AD database, it gets disabled in RC.
If your LDAP servers connectivity is unstable, you have bigger things to worry about than access to RocketChat. This is why people run multiple directory servers. We have two in every office, and additional ones in offsite datacenters.
If the RocketChat server's connectivity is down, the link to an LDAP server is kinda moot.
Live queries to an LDAP server is the way to go, in my opinion. We have no other services that cache authentication credentials except RocketChat. Clients frequently cache credentials, but that's a different story.
Alan.
On Jun 13, 2017, at 12:43 PM, gregs007 [email protected] wrote:
I think doing what's suggested in #7235 should work for LDAP auth. Basically you would disable RC users that are disabled or missing in LDAP directory. This would be during regular LDAP database sync. I don't think regular re-auth is a good idea in the case of an unstable LDAP connection locking out users. Sync on the other hand, is more definitive--- If the user is disabled in the LDAP/AD database, it gets disabled in RC.
— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or mute the thread.
Hi. As I see it, the fallback option is too overloaded. First, when LDAP is configured, the option allows to login using both LDAP and local accounts (that could have been created manually outside the LDAP user scope) but if disabled, login with a local account is no longer possible. Secondly, it automatically mirrors the LDAP accounts to the local account system upon login, hence creating the "fallback", including credentials.
In our case we really do not want rocket to mirror accounts from LDAP (and hence we do not want any sync). The LDAP remains the main authority for checking credentials and account status.The fact that rocket automatically creates the local account is highly undesirable and creates all kind of unwanted side effects. To name a few: it imposes an extra security risk as it is "secretly" storing credentials as well. It is also confusing users on their username, if the LDAP user is an email, rocket will allow to login the 2nd time by only using the email user (without the @) as this is the username that rocket used on the local account system. This way it appears that the user can either login with their email (which would authenticate against LDAP) but also by just typing the user (which would fail against LDAP but then succeed when falling back to the local account system).
As for the argument of "unstable LDAP connections" , like @doctorwho92 said, in that case you have other problems, but if you still need a user to login (to adjust the LDAP settings or whatever in case of problems) one can simply create a local account manually outside LDAP scope (by registration or by admin console) and grant it admin rights.
So besides an LDAP sync, we really need to split the fallback option into two; one for allowing local accounts to login (when an external source such as LDAP is specified) and one for disallowing account mirroring all together
see #6144 too
The bug or notgood feature still here 073 version of RC i disable user on ldap, user do not disconnect on client and i do not delete that user on RC users-table. if user no logout User-session in mobile client still exist and user can chat and enter to conversations
UPD1: If user account was disable, but in RC user do not deleted - user can login!
that option on filter search do not help.... (objectClass=person)(|(userAccountControl=512)(userAccountControl=66048))(|(mail=#{username})(sAMAccountName=#{username})))", "scope": "sub", "userDN": "rocket_svc@domain", "***": "HIDDEN" of couse maybe i use it on mistaken plase
UPD2: if user removed from RC users-table in admin panel, but user do not disable in ldap, user cant login.
+1... Also this is mentioned and discussed, but not quite the same issue in issue #9900
If you will change option Login Fallback to False Users will not able to login anymore if LDAP auth was failed in any reason.
Yes, however, then you cannot authenticate users using the local database, so you MUST have ALL users (including the administrator) assigned LDAP accounts. I think ideally you should allow external and internal authentication with some sort of "hybrid" system.
agree with the previous speaker.. is more than one software that use two backend auth, and have that option will be nice
Hi all!
+1 with @iesit. Is it possible to know if someone is going to try to solve this?
Thanks!
is here something new? im using latest version but im scared to run off local admin acc and use only ldap admin accounts
any issues?
Issues?;) you mean progress?
-- Gerasim Shaverdov | Deputy CTO | Altarix Mobile: +7 937 070 66 84 | Skype/email: [email protected] Lenina av.25, Samara, Russia, 443068
22 янв. 2020 г., в 16:58, rnqlover [email protected] написал(а):
any issues?
— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.