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

Improve log messages related to OIDC session cookie encryption secret #33550

Merged

Conversation

sberyozkin
Copy link
Member

@sberyozkin sberyozkin commented May 23, 2023

Fixes #33532.

@geoand Can you please review and help to improve the wording ? No OIDC logic has been affected, only more log messages are added, and the warning is issued when the encryption key strength is low.

@rgmz FYI.

Note, OIDC code could've avoided falling back to the configured secrets and just generated a random secret but that would increase the risk of the applications being broken (after restarts in devmode, multiple pods) and force users disable the encryption in any case. Seeing a log message is less intrusive.

What I have also done is to log a warning when the key strength is very low (less than 16 chars) but only debug when the key is strong enough - that should improve the experience as the secrets generated by providers will most definitelybe at least 16 characters long. It looks like the warning message can frustrate quite a few users - the whole session cookie encryption is a hardening fix, so for users running securely over HTTPS or internal networks it can be a bit annoying having to go and disable the encryption just to get rid of the warning.

I also did not go into all the details how the fallback works, as the client secret can be configured in one of the 2 ways, and then if it is a client_jwt_secret authentication between Quarkus and OIDC then it is a jwt secret property, and listing all of that would make a difficult to follow doc. But I added more log messages to show how the fallback might work.

@sberyozkin sberyozkin requested a review from geoand May 23, 2023 10:27
@sberyozkin sberyozkin force-pushed the oidc_improve_key_enc_warn_message branch 2 times, most recently from 94283fc to 323127b Compare May 23, 2023 10:33
@sberyozkin
Copy link
Member Author

I'll add another comment as proposed at #33532 (comment) after all a bit later :-)

@sberyozkin sberyozkin force-pushed the oidc_improve_key_enc_warn_message branch 2 times, most recently from 6e14f39 to dc4ccde Compare May 23, 2023 12:47
@sberyozkin sberyozkin marked this pull request as ready for review May 23, 2023 12:49
@sberyozkin
Copy link
Member Author

Hi @gsmet @geoand, I'm pinging Pedro to have a quick look, but if you think it is safe, please approve and may be it might get to 2.13. It is a pure doc clarification and log noise minimization for the out of the box OIDC user experience, no OIDC logic is affected

@quarkus-bot

This comment has been minimized.

@sberyozkin sberyozkin force-pushed the oidc_improve_key_enc_warn_message branch from 95fee00 to 2ca90c2 Compare May 30, 2023 11:08
@quarkus-bot
Copy link

quarkus-bot bot commented May 30, 2023

✔️ The latest workflow run for the pull request has completed successfully.

It should be safe to merge provided you have a look at the other checks in the summary.

@sberyozkin sberyozkin dismissed gsmet’s stale review May 31, 2023 16:00

Proposed update was applied, thanks

@sberyozkin sberyozkin merged commit 7e30f3c into quarkusio:main May 31, 2023
@sberyozkin sberyozkin deleted the oidc_improve_key_enc_warn_message branch May 31, 2023 16:00
@quarkus-bot quarkus-bot bot added the kind/enhancement New feature or request label May 31, 2023
@quarkus-bot quarkus-bot bot added this to the 3.2 - main milestone May 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/oidc kind/enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[oidc] Clarify startup warning: Secret key for encrypting tokens should be 32 characters long
4 participants