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

auth: respect default tls.verify_server_hostname=false #19425

Merged
merged 1 commit into from
Dec 11, 2023

Conversation

tgross
Copy link
Member

@tgross tgross commented Dec 11, 2023

In Nomad 1.7.0, we refactored much of the authentication code to eliminate nil ACLs and create "virtual" ACL objects that can be used to reduce the risk of fail-open security bugs. In doing so, we accidentally dropped support for the default tls.verify_server_hostname=false option.

Fix the bug by including the field in the set of conditions we check for the TLS argument we pass into the constructor (this keeps "policy" separate from "mechanism" in the auth code and reduces the number of dimensions we need to test). Change the field name in the Authenticator to better match the intent.

Fixes: #19405

In Nomad 1.7.0, we refactored much of the authentication code to eliminate nil
ACLs and create "virtual" ACL objects that can be used to reduce the risk of
fail-open security bugs. In doing so, we accidentally dropped support for the
default `tls.verify_server_hostname=false` option.

Fix the bug by including the field in the set of conditions we check for the TLS
argument we pass into the constructor (this keeps "policy" separate from
"mechanism" in the auth code and reduces the number of dimensions we need to
test). Change the field name in the Authenticator to better match the intent.
@tgross tgross force-pushed the b-tls-verify-server-hostname-fail-closed branch from ac11340 to 3b029d1 Compare December 11, 2023 14:26
@tgross tgross added this to the 1.7.x milestone Dec 11, 2023
@tgross tgross marked this pull request as ready for review December 11, 2023 14:48
@tgross tgross requested review from jrasell and lgfa29 December 11, 2023 14:48
@tgross
Copy link
Member Author

tgross commented Dec 11, 2023

I'm going to do some quick end-to-end testing of this as well. Will post results here.

@tgross
Copy link
Member Author

tgross commented Dec 11, 2023

I've been able to reproduce the failure described in #19405 for servers and test the fix in this patch:

The error message shown for clients here I was not able to reproduce exactly, but I know from working on the unit tests for the big auth refactor that the error message can actually vary slightly depending on timing and whether you get the EOF before the "permission denied" error gets written (we had to account for this in the tests). After the patch, everything seems to work fine.

Copy link
Member

@shoenig shoenig left a comment

Choose a reason for hiding this comment

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

LGTM!

@tgross tgross added the backport/1.7.x backport to 1.7.x release line label Dec 11, 2023
@tgross tgross merged commit 7f87ede into main Dec 11, 2023
25 checks passed
@tgross tgross deleted the b-tls-verify-server-hostname-fail-closed branch December 11, 2023 19:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/1.7.x backport to 1.7.x release line theme/auth type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

worker: failed to dequeue evaluation: error="rpc error: Permission denied" after upgrade to 1.7.1
2 participants