-
Notifications
You must be signed in to change notification settings - Fork 12
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
implementation of the csrf signed double submit pattern #3409
Conversation
Signed-off-by: Max Thonagel <12283268+thoniTUB@users.noreply.github.com>
Todo:
|
public static final String CSRF_TOKEN_PROPERTY = "csrf_token"; | ||
public static final int TOKEN_LENGTH = 30; | ||
|
||
Random random = new SecureRandom(); |
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.
private final?
Signed-off-by: Max Thonagel <12283268+thoniTUB@users.noreply.github.com>
Signed-off-by: Max Thonagel <12283268+thoniTUB@users.noreply.github.com>
Signed-off-by: Max Thonagel <12283268+thoniTUB@users.noreply.github.com>
Signed-off-by: Max Thonagel <12283268+thoniTUB@users.noreply.github.com>
Signed-off-by: Max Thonagel <12283268+thoniTUB@users.noreply.github.com>
Signed-off-by: Max Thonagel <12283268+thoniTUB@users.noreply.github.com>
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.
Änderungen sind alles nits, kannst du gerade die admin-ui, bitte in einer staging instanz testen?
null, | ||
0, | ||
null, | ||
3600, |
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.
magic number auf der TTL?
final StopWatch stopwatch = new StopWatch("Generate csrf token"); | ||
|
||
stopwatch.start(); | ||
final Hash hash = Password.hash(csrfToken).addRandomSalt(32).with(HASH_FUNCTION); |
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.
magic number?
backend/src/main/java/com/bakdata/conquery/models/auth/web/csrf/CsrfTokenSetFilter.java
Outdated
Show resolved
Hide resolved
final StopWatch stopwatch = new StopWatch("Check csrf token"); | ||
stopwatch.start(); | ||
final boolean decision = Password.check(token, saltedHash).addSalt(salt).with(HASH_FUNCTION); | ||
stopwatch.stop(); | ||
|
||
log.trace("Checked token in {}", stopwatch); |
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.
s.o.
…f/CsrfTokenSetFilter.java Co-authored-by: awildturtok <1553491+awildturtok@users.noreply.github.com>
Signed-off-by: Max Thonagel <12283268+thoniTUB@users.noreply.github.com>
order filter priorities remove csrf-check property Signed-off-by: Max Thonagel <12283268+thoniTUB@users.noreply.github.com>
@awildturtok mir war noch ein Problem, mit der Redirection nach einer Authentifizierung aufgefallen, welches ich jetzt gefixt habe. Mergen werde ich aber erst nach dem heutigen release |
Signed-off-by: Max Thonagel <12283268+thoniTUB@users.noreply.github.com>
No description provided.