-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[Enchancement](auth) Forbid to login doris from 127.0.0.1 without password #18816
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
Conversation
| List<UserIdentity> currentUser) throws AuthenticationException { | ||
| if ((remoteUser.equals(ROOT_USER) || remoteUser.equals(ADMIN_USER)) && remoteHost.equals("127.0.0.1")) { | ||
| // root and admin user is allowed to login from 127.0.0.1, in case user forget password. | ||
| if ((remoteUser.equals(ROOT_USER) || remoteUser.equals(ADMIN_USER)) && Config.skip_auth_check) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't looked at the calling process, but generally speaking, we recommend constant.equals to prevent NPE.
it's difficult for us to check whether the caller has done the corresponding null value detection.
eg: ROOT_USER.equals(remoteUser)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I will modify this.
| If you forget your password and cannot log in to Doris, you can add `skip_auth_check` in fe config so that logging to Doris without a password in localhost. | ||
|
|
||
| `mysql-client -h 127.0.0.1 -P query_port -uroot` | ||
| `skip_auth_check = true` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change to skip_localhost_auth_check
|
run buildall |
yiguolei
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
| 5. Forget passwords | ||
|
|
||
| If you forget your password and cannot log in to Doris, you can log in to Doris without a password using the following command on the machine where the Doris FE node is located: | ||
| If you forget your password and cannot log in to Doris, you can add `skip_localhost_auth_check` in fe config so that logging to Doris without a password in localhost. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to restart FE? If yes, please add it in doc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need restart FE
| * If true, auth check will be disabled. The default value is false. | ||
| * This is to solve the case that user forgot the password. | ||
| */ | ||
| @ConfField(mutable = true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The mutable should be false, otherwise user can set it via http api
|
#18996 to fix the problem |
…sword (apache#18816) * forbid to login from 127.0.0.1 without password * add localhost limit * rename
…sword (apache#18816) * forbid to login from 127.0.0.1 without password * add localhost limit * rename
Proposed changes
Issue Number: close #xxx
Problem summary
Handle the case that user forgot the password
Before
root and admin user is allowed to login from 127.0.0.1, in case user forget password
After
add a new FE config
skip_auth_check, the default is false.If true, the auth check will be skipped.so that login to Doris without a password.
Checklist(Required)
Further comments
If this is a relatively large or complex change, kick off the discussion at dev@doris.apache.org by explaining why you chose the solution you did and what alternatives you considered, etc...