Skip to content

feat: Disable HaveIBeenPwned validation when HaveIBeenPwnedEnabled is set to false #1445

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

Merged
merged 15 commits into from
Jun 25, 2021
Merged

feat: Disable HaveIBeenPwned validation when HaveIBeenPwnedEnabled is set to false #1445

merged 15 commits into from
Jun 25, 2021

Conversation

jertel
Copy link
Contributor

@jertel jertel commented Jun 18, 2021

Related issue

Implements remaining request from #316 to support disabling the check for pwned passwords.

Proposed changes

Environments disconnected from the Internet, and environments that enforce strict outbound network access restrictions should not attempt to access a remote URL to determine if a password has appeared in a prior breech. While the current implementation allows for custom host definition, environments that do not have a custom pwned password host currently have no method to skip this check. This PR provides that feature.

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
    [email protected]) 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 or changed the documentation.

Further comments

None

@aeneasr
Copy link
Member

aeneasr commented Jun 18, 2021

You can already ignore network errors using passwordPolicyConfig.IgnoreNetworkErrors. Is there a particular reason for adding another control mechanism?

@jertel
Copy link
Contributor Author

jertel commented Jun 18, 2021

Yes, with network errors ignored, the client will attempt several retries using an exponential backoff algorithm (see https://github.com/hashicorp/go-retryablehttp). This removes 15 seconds of unnecessary waiting from the password process, when it's known in advance that the remote host is unavailable.

@aeneasr
Copy link
Member

aeneasr commented Jun 18, 2021

Right, that makes sense then! Would it be possible to introduce a new variable for this though? Something that makes it explicit that this is disabled.

@jertel
Copy link
Contributor Author

jertel commented Jun 18, 2021

Yes, take a look a the new changes and let me know if it needs adjustments.

Copy link
Member

@aeneasr aeneasr left a comment

Choose a reason for hiding this comment

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

Just one minor thing, then this is good to merge IMO!

@jertel jertel changed the title feat: Disable HaveIBeenPwned validation when HaveIBeenPwnedHost is set to empty string feat: Disable HaveIBeenPwned validation when HaveIBeenPwnedEnabled is set to false Jun 18, 2021
@aeneasr
Copy link
Member

aeneasr commented Jun 20, 2021

Thank you, this looks great! The CI is failing because some files are formatted incorrectly. To format them, run:

$ make format
$ git commit -a -m "styles: format code"
$ git push

Thank you!

@codecov
Copy link

codecov bot commented Jun 23, 2021

Codecov Report

Merging #1445 (5a2f0f0) into master (171206c) will increase coverage by 0.07%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1445      +/-   ##
==========================================
+ Coverage   71.29%   71.36%   +0.07%     
==========================================
  Files         250      250              
  Lines       10645    10648       +3     
==========================================
+ Hits         7589     7599      +10     
+ Misses       2436     2429       -7     
  Partials      620      620              
Impacted Files Coverage Δ
driver/config/config.go 75.15% <100.00%> (+0.07%) ⬆️
selfservice/strategy/password/validator.go 88.23% <100.00%> (+0.35%) ⬆️
cmd/courier/watch.go 68.00% <0.00%> (+14.00%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 171206c...5a2f0f0. Read the comment docs.

Copy link
Member

@aeneasr aeneasr left a comment

Choose a reason for hiding this comment

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

Awesome, thank you! 🎉 Your contribution makes Ory better :)

@aeneasr aeneasr merged commit 44002f4 into ory:master Jun 25, 2021
t-tomalak pushed a commit to Wikia/kratos that referenced this pull request Jul 16, 2021
About two months ago we released Ory Kratos v0.6. Today, we are excited to announce the next iteration of Ory Kratos v0.7! This release includes 215 commits from 24 contributors with over 770 files and more than 100.000 lines of code changed!

Ory Kratos v0.7 brings massive developer experience improvements:

- A reworked, tested, and standardized SDK based on OpenAPI 3.0.3 ([ory#1477](ory#1477), [ory#1424](ory#1424));
- Native support of Single-Page-Apps (ReactJS, AngularJS, ...) for all self-service flows ([ory#1367](ory#1367));
- Sign in with Yandex, VK, Auth0, Slack;
- An all-new, secure logout flow ([ory#1433](ory#1433));
- Important security updates to the self-service GET APIs ([ory#1458](ory#1458), [ory#1282](ory#1282));
- Built-in support for TLS ([ory#1466](ory#1466));
- Improved documentation and Go Module structure;
- Resolving a case-sensitivity bug in self-service recovery and verification flows;
- Improved performance for listing identities;
- Support for Instant tracing ([ory#1429](ory#1429));
- Improved control for SMTPS, supporting SSL and STARTTLS ([ory#1430](ory#1430));
- Ability to run Ory Kratos in networks without outbound requests ([ory#1445](ory#1445));
- Improved control over HTTP Cookie behavior ([ory#1531](ory#1531));
- Several smaller user experience improvements and bug fixes;
- Improved e2e test pipeline.

In the next iteration of Ory Kratos, we will focus on providing a NextJS example application for the SPA integration as well as the long-awaited MFA flows!

Please be aware that upgrading to Ory Kratos 0.7 requires you to apply SQL migrations. Make sure to back up your database before migration!

For more details on breaking changes and patch notes, see below.
jess-sheneberger pushed a commit to jess-sheneberger/kratos that referenced this pull request Jul 21, 2021
About two months ago we released Ory Kratos v0.6. Today, we are excited to announce the next iteration of Ory Kratos v0.7! This release includes 215 commits from 24 contributors with over 770 files and more than 100.000 lines of code changed!

Ory Kratos v0.7 brings massive developer experience improvements:

- A reworked, tested, and standardized SDK based on OpenAPI 3.0.3 ([ory#1477](ory#1477), [ory#1424](ory#1424));
- Native support of Single-Page-Apps (ReactJS, AngularJS, ...) for all self-service flows ([ory#1367](ory#1367));
- Sign in with Yandex, VK, Auth0, Slack;
- An all-new, secure logout flow ([ory#1433](ory#1433));
- Important security updates to the self-service GET APIs ([ory#1458](ory#1458), [ory#1282](ory#1282));
- Built-in support for TLS ([ory#1466](ory#1466));
- Improved documentation and Go Module structure;
- Resolving a case-sensitivity bug in self-service recovery and verification flows;
- Improved performance for listing identities;
- Support for Instant tracing ([ory#1429](ory#1429));
- Improved control for SMTPS, supporting SSL and STARTTLS ([ory#1430](ory#1430));
- Ability to run Ory Kratos in networks without outbound requests ([ory#1445](ory#1445));
- Improved control over HTTP Cookie behavior ([ory#1531](ory#1531));
- Several smaller user experience improvements and bug fixes;
- Improved e2e test pipeline.

In the next iteration of Ory Kratos, we will focus on providing a NextJS example application for the SPA integration as well as the long-awaited MFA flows!

Please be aware that upgrading to Ory Kratos 0.7 requires you to apply SQL migrations. Make sure to back up your database before migration!

For more details on breaking changes and patch notes, see below.
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.

3 participants