-
Notifications
You must be signed in to change notification settings - Fork 22
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
AM-90: mfa verify brute force detection implemented #2220
Conversation
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.
Seems like quite a large PR that perhaps should have been broken down into smaller subtasks - the repo stuff could have been done separately, for example.
gravitee-am-service/src/main/java/io/gravitee/am/service/impl/VerifyAttemptServiceImpl.java
Show resolved
Hide resolved
...-am-gateway-standalone-distribution/src/main/resources/templates/i18n/messages_en.properties
Outdated
Show resolved
Hide resolved
...-am-gateway-standalone-distribution/src/main/resources/templates/i18n/messages_en.properties
Outdated
Show resolved
Hide resolved
...-am-gateway-standalone-distribution/src/main/resources/templates/i18n/messages_en.properties
Outdated
Show resolved
Hide resolved
...agement-api-standalone-distribution/src/main/resources/templates/i18n/messages_en.properties
Outdated
Show resolved
Hide resolved
gravitee-am-service/src/main/java/io/gravitee/am/service/impl/VerifyAttemptServiceImpl.java
Outdated
Show resolved
Hide resolved
...in/java/io/gravitee/am/gateway/handler/root/resources/endpoint/mfa/MFAChallengeEndpoint.java
Outdated
Show resolved
Hide resolved
...in/java/io/gravitee/am/gateway/handler/root/resources/endpoint/mfa/MFAChallengeEndpoint.java
Outdated
Show resolved
Hide resolved
() -> handler.handle(Future.succeededFuture()), | ||
error -> { | ||
logger.error("Could not delete verify attempt", error); | ||
routingContext.fail(401); |
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 have to reject the authentication/code validation if the delete action fails ?
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.
no, we do not as I understand. Delete performs after successful verification. That means in this stage everything is fine (challenge verified) and deletes if there is any existing verification attempts in the db. It shouldn't have any impact in verification process if the delete is failed for unexpected reason in my opinion.
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 in that case, we should not call routingContext.fail(401);
after the log error (maybe it becomes a warn 🤔 ?)
As we do not want to fail if the delete fails, we should call handler.handle(Future.succeededFuture())
instead of routingContext.fail(401);
wdyt?
Agree: changed log to warn and removed the fail 401
gravitee-am-service/src/main/java/io/gravitee/am/service/impl/VerifyAttemptServiceImpl.java
Show resolved
Hide resolved
gravitee-am-service/src/main/java/io/gravitee/am/service/impl/VerifyAttemptServiceImpl.java
Outdated
Show resolved
Hide resolved
...in/java/io/gravitee/am/gateway/handler/root/resources/endpoint/mfa/MFAChallengeEndpoint.java
Outdated
Show resolved
Hide resolved
...in/java/io/gravitee/am/gateway/handler/root/resources/endpoint/mfa/MFAChallengeEndpoint.java
Outdated
Show resolved
Hide resolved
...-am-gateway-standalone-distribution/src/main/resources/templates/i18n/messages_fr.properties
Outdated
Show resolved
Hide resolved
...agement-api-standalone-distribution/src/main/resources/templates/i18n/messages_fr.properties
Outdated
Show resolved
Hide resolved
8bb4ea8
to
6ed373d
Compare
() -> handler.handle(Future.succeededFuture()), | ||
error -> { | ||
logger.error("Could not delete verify attempt", error); | ||
routingContext.fail(401); |
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 in that case, we should not call routingContext.fail(401);
after the log error (maybe it becomes a warn 🤔 ?)
As we do not want to fail if the delete fails, we should call handler.handle(Future.succeededFuture())
instead of routingContext.fail(401);
wdyt?
Agree: changed log to warn and removed the fail 401
.../main/java/io/gravitee/am/service/reporter/builder/management/VerifyAttemptAuditBuilder.java
Outdated
Show resolved
Hide resolved
.../main/java/io/gravitee/am/service/reporter/builder/management/VerifyAttemptAuditBuilder.java
Outdated
Show resolved
Hide resolved
7d7103d
to
c05d754
Compare
c05d754
to
2f27ab0
Compare
SonarCloud Quality Gate failed. |
jira issue: https://graviteecommunity.atlassian.net/browse/AM-90
how to test the feature:
User Accounts
menu enable brute force detection from the newly addedMFA
section.invalid code
error as before, no behaviour change in this step.maximum attempts reached
error.