-
Notifications
You must be signed in to change notification settings - Fork 978
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
[security] This image creates two Admin accounts #161
Comments
Hello, Indeed we can add information how to change the admin password. Pull request welcomed. Maybe adapt your issue title to something less worrying and more accurate. |
Hi thanks for the response 👍 . I want to emphasize I like and appreciate the work you've done in creating and maintaining this image. Any suggestions for title? I will remove the exclamation mark at the end but it is security related and the image by default does create two admins. Adding documentation to change the admin password will not fix this vulnerability for existing users of your image. Also, your image should not create two admin accounts during bootstrap. Any current user of the image may be impacted. In that light, it might be an option to create a script which removes the I don't think there is any good fix for the current users of your image that works best for all your users, and they should be informed so they can decide the best action. What do you think? |
Oops sorry, Yes users should be informed, i'm going to add a warning on top of the readme linking to this issue, |
Hi thanks for the confirmation. It's a difficult issue. I think most people will use this image and just let it running, without looking here again. Waiting has an obvious risk, but rushing into a decision may cause a lot of damage. I suggest this fix for the next update: Create a shell script which executes automatically, which:
I think this script should create the situation which people expect. What do you think? |
not sure to understand this point: this leads to no admin account ? Except with the config password ? |
Correct. My reasoning is that, if the user removed the Of course it is a problem if the user wants to use the RootDN account. However the user could re-add the RootDN account easily. -- |
Sounds good to me :) Just maybe not do this automatically but ask for user consent by adding a boolean environment variable like FIX_SECURITY_ISSUE_161 So when the user start the container with next image version:
What do you think? |
Hi! I can definitely understand the sentiment of not wanting to break things or change things without permission. However considering how most people use Docker as a "start & forget" application I have serious doubts if that warning will reach everyone who is impacted. It's ultimately your decision, but I think mitigating the security issue should be the first priority. I think the shell-script as I described minimizes any negative consequences. One can always login locally and re-add a I would prefer that bit of manual labour over having (the risk of) an arbitrary person logging in as admin on my LDAP :). |
Hello, We will make a release candidate with that and see feedback :) |
Any progress on the fix? :) |
we have no time to work on this for now :( |
These are the same issue, no? https://www.openldap.org/lists/openldap-technical/201212/msg00225.html It seems there is an authentication identity for root access if you set olcRootDN and olcRootPW. It is not a user. This means you can still create a user with the same DN, which is why it appears there are two admins or one admin with two passwords when you do this. If olcRootPW is not set, they advise to create the admin user. Otherwise, it is not even necessary. So it's either one or the other then. |
This behavior occurs also on a regular debian install of slapd (debian strech, openldap 2.4.44) Does anyone have an idea how to fix this on fresh install ? |
Run in this issue. Is there any way to configure admin password in a secure way? Because |
You can set the admin password in a *.startup.yaml environment file, that is deleted right after startup scripts. Or if you use kubernetes run an init container with command line option |
Hi!
I noticed unexpected behavior while using your OpenLDAP image..
After changing the passwords of
cn=admin,dc=example,dc=org
you can still login using the old password with full rights. The reason is that this image definesRootDN
andRootPW
inDN: olcDatabase={1}hdb,cn=config
ascn=admin,dc=example,dc=org
. This is a separate login.steps to reproduce
Start the stuff
Login via PHPLDapAdmin
username:
cn=admin,dc=example,dc=org
password:
admin
Change the password of
cn=admin,dc=example,dc=org
toexample
Use hash
{SSHA}bbbIClpMGqvOpa5Yc9x+VS/9PN1czs1B
Or create a new SSHA hash here: http://projects.marsching.org/weave4j/util/genpassword.php (not for production)
Save.
Login again with
cn=admin,dc=example,dc=org
with the old passwordadmin
Expected behavior:
Login fails
Observed behavior
Login succeeds, given full root access.
(Note, you can also login with
cn=admin,dc=example,dc=org
using the new passwordexample
. You're now logged in as a user and the ACL as defined in 02-security.ldif will give you full access)Reason why
In
DN: olcDatabase={1}hdb,cn=config
database the RootDN is defined ascn=admin,dc=example,dc=org
with the initial password set inRootPW
. This is a real root-user with full access that bypasses all ACL. This password is not changed when you change the password ofcn=admin,dc=example,dc=org
.Note, to login to the
cn=config
database you need the config credentials. By default in this image:Username:
cn=admin,cn=config
Password:
config
Impact
If people start the image with the default password and change the password of
cn=admin,dc=example,dc=org
to something more secure later then they're gonna have a bad time.Suggested fix
I really think there's no need for the user
cn=admin,dc=example,dc=org
with the ACL giving all permissions. Just simply rely on theRootDN
inDN: olcDatabase={1}hdb,cn=config
and explain people howcn=config
works.The text was updated successfully, but these errors were encountered: