Skip to content

Restrict concurrent password hashes#5437

Merged
johanbrandhorst merged 5 commits intomainfrom
jbrandhorst-restrict-concurrent-hashes
Jan 22, 2025
Merged

Restrict concurrent password hashes#5437
johanbrandhorst merged 5 commits intomainfrom
jbrandhorst-restrict-concurrent-hashes

Conversation

@johanbrandhorst
Copy link
Copy Markdown
Contributor

@johanbrandhorst johanbrandhorst commented Jan 20, 2025

internal/auth/password: add resizable pool

The resizable pool wraps the permit pool with a mutex
to allow it to be resized at runtime.

internal/auth/password: add concurrency limit

The default concurrency limit is 1, and it can be
set using the SetHashingPermits function.

internal/cmd/config: allow configuring hashing limits

The new concurrent_password_hash_workers configuration
value can be used to loosen the constraints on the
password auth method hashing operation.

internal/cmd: set password hashing constraints

Sets the password hashing concurrency constraints on
startup and config reload.

CHANGELOG: add notice about password concurrency limit

Comment thread CHANGELOG.md
### Bug fixes

* Fix an issue where, when starting a session, the connection limit always displays 0.
([PR](https://github.com/hashicorp/boundary/pull/5396)).
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

There were two "Bug Fixes" sections in the changelog under "Next", so I moved this one up to the one above.

Comment thread go.mod Outdated
@johanbrandhorst johanbrandhorst force-pushed the jbrandhorst-restrict-concurrent-hashes branch from 23f6166 to 1bcd202 Compare January 20, 2025 21:33
@johanbrandhorst johanbrandhorst marked this pull request as ready for review January 20, 2025 21:33
@johanbrandhorst johanbrandhorst requested a review from a team as a code owner January 20, 2025 21:33
@johanbrandhorst johanbrandhorst added this to the 0.19.x milestone Jan 20, 2025
@johanbrandhorst johanbrandhorst force-pushed the jbrandhorst-restrict-concurrent-hashes branch 2 times, most recently from eba8590 to d202821 Compare January 21, 2025 01:15
Comment thread internal/auth/password/argon2.go Outdated
@johanbrandhorst johanbrandhorst force-pushed the jbrandhorst-restrict-concurrent-hashes branch 4 times, most recently from e5dc552 to 392fc52 Compare January 22, 2025 19:40
The resizable pool wraps the permit pool with a mutex
to allow it to be resized at runtime.
The default concurrency limit is 1, and it can be
set using the SetHashingPermits function.
The new concurrent_password_hash_workers configuration
value can be used to loosen the constraints on the
userpass auth method hashing operation.
Sets the password hashing concurrency constraints on
startup and config reload.
@johanbrandhorst johanbrandhorst force-pushed the jbrandhorst-restrict-concurrent-hashes branch from 392fc52 to 5e23cd3 Compare January 22, 2025 19:57
Copy link
Copy Markdown
Member

@tmessi tmessi left a comment

Choose a reason for hiding this comment

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

nice!

@johanbrandhorst johanbrandhorst merged commit 40cb9f5 into main Jan 22, 2025
@johanbrandhorst johanbrandhorst deleted the jbrandhorst-restrict-concurrent-hashes branch January 22, 2025 21:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants