Skip to content
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

Support password validation #9741

Closed
morgo opened this issue Mar 14, 2019 · 5 comments
Closed

Support password validation #9741

morgo opened this issue Mar 14, 2019 · 5 comments
Labels
feature/accepted This feature request is accepted by product managers help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. security Everything related with security type/compatibility type/feature-request Categorizes issue or PR as related to a new feature.

Comments

@morgo
Copy link
Contributor

morgo commented Mar 14, 2019

Feature Request

Is your feature request related to a problem? Please describe:

MySQL supports the ability to validate a password (for strength complexity, and against a dictionary file). I would like to see similar in TiDB.

Describe the feature you'd like:

The following sysvars should be implemented:

./sessionctx/variable/sysvar.go:        {ScopeGlobal, "validate_password_check_user_name", "OFF"},
./sessionctx/variable/sysvar.go:        {ScopeGlobal, "validate_password_number_count", "1"},
./sessionctx/variable/sysvar.go:        {ScopeGlobal, "validate_password_dictionary_file", ""},
./sessionctx/variable/sysvar.go:        {ScopeGlobal, "validate_password_special_char_count", "1"},
./sessionctx/variable/sysvar.go:        {ScopeGlobal, "validate_password_length", "8"},

The function VALIDATE_PASSWORD_STRENGTH should be implimented.

Describe alternatives you've considered:

N/A

Teachability, Documentation, Adoption, Migration Strategy:

MySQL compatible behavior.

@wjhuang2016
Copy link
Member

I'm working on this feature, and I have a question that whether we need to consider utf-8 in password?

@morgo
Copy link
Contributor Author

morgo commented Mar 18, 2019

@wjhuang2016 great question! We should check how MySQL 8.0 behaves, and if rules like validate_password_length are based on byte or character count.

@morgo morgo added the help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. label Mar 18, 2019
@wjhuang2016
Copy link
Member

I tested with Mysql 8.0 and found that we need to consider utf-8.

  1. validate_password_length bases on character count. The length of 你好 would be 2.
  2. I'm not sure how upper、 lower or special is count.
    In select VALIDATE_PASSWORD_STRENGTH("你好13579A_"); the result is 100.
    It means that the password contains a lower character.

@gregwebs gregwebs added the security Everything related with security label Mar 9, 2020
@zz-jason zz-jason added type/feature-request Categorizes issue or PR as related to a new feature. and removed type/new-feature labels Apr 3, 2020
@zz-jason zz-jason added the feature/accepted This feature request is accepted by product managers label Jul 29, 2020
@dveeden
Copy link
Contributor

dveeden commented Nov 8, 2022

@CbcWestwolf @lastincisor I think this is related to the other tickets about password validation isn't it?

@CbcWestwolf
Copy link
Member

Yes, it's a requirement from our customer. I track it in another issue #38923

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature/accepted This feature request is accepted by product managers help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. security Everything related with security type/compatibility type/feature-request Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

No branches or pull requests

7 participants