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

Restrict concurrent password hashes #5437

Merged
merged 5 commits into from
Jan 22, 2025

Conversation

johanbrandhorst
Copy link
Collaborator

@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

### 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
Collaborator 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.

go.mod Outdated Show resolved Hide resolved
@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
@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
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
61 of 63 checks passed
@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