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

feat: add levenshtein distance check for password validation #231

Merged
merged 12 commits into from
Feb 6, 2020

Conversation

zepatrik
Copy link
Member

@zepatrik zepatrik commented Feb 5, 2020

Related issue

closes #184

Proposed changes

Checklist

  • I have read the contributing guidelines
  • I have read the security policy
  • I confirm that this pull request does not address a security vulnerability. If this pull request addresses a security
    vulnerability, I confirm that I got green light (please contact security@ory.sh) from the maintainers to push the changes.
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation within the code base (if appropriate)
  • I have documented my changes in the developer guide (if appropriate)

Further comments

maxBreachesThreshold: 0,
hashes: map[string]int64{},
ignoreNetworkErrors: true,
minIdentifierPasswordDist: 5,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make this configurable in the config file, and also document this in ? :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think, this thing has been implemented. Right?

func (s *DefaultPasswordValidator) Validate(ctx context.Context, identifier, password string) error { passwordPolicyConfig := s.reg.Config(ctx).PasswordPolicyConfig() if len(password) < int(passwordPolicyConfig.MinPasswordLength) {

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mean the configuration? Does not look like the values come from the config rn:

if dist < s.minIdentifierPasswordDist || lcs > s.maxIdentifierPasswordSubstrThreshold {

@zepatrik zepatrik requested a review from aeneasr February 6, 2020 11:23
@aeneasr aeneasr merged commit 256fad3 into master Feb 6, 2020
@aeneasr aeneasr deleted the password-lev-dist branch February 6, 2020 14:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Require Levenshtein distance between identifiers and password
3 participants