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

security: remove the node TLS client cert exemption #71134

Merged
merged 1 commit into from
Oct 6, 2021

Conversation

knz
Copy link
Contributor

@knz knz commented Oct 5, 2021

Fixes #71102.

Release note (security update): It is not possible any more to use a
node TLS certificate to establish a SQL connection with another
username than node. This facility had existed as an "escape hatch"
so that an operator could use the node cert to perform operations on
behalf of another SQL user. However, this facility is not necessary:
an operator with access to a node cert can log in as node directly
and create new credentials for another user anyway. By removing
this facility, we tighten the guarantee that the principal in the TLS
client cert always matches the SQL identity.

@knz knz requested review from bdarnell and catj-cockroach October 5, 2021 14:30
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@knz
Copy link
Contributor Author

knz commented Oct 5, 2021

this doesn't work, as explained here #71102 (comment)

@knz knz closed this Oct 5, 2021
@knz knz deleted the 20211005-tls branch October 5, 2021 17:19
@knz knz restored the 20211005-tls branch October 5, 2021 18:08
@knz knz reopened this Oct 5, 2021
@knz knz requested a review from a team October 5, 2021 18:11
@knz knz requested a review from a team as a code owner October 5, 2021 18:33
@knz knz requested a review from andy-kimball October 5, 2021 18:33
@knz
Copy link
Contributor Author

knz commented Oct 5, 2021

@andy-kimball can you also check the sql proxy test changes here thanks

@knz knz requested a review from chrisseto October 5, 2021 18:42
Copy link
Contributor

@chrisseto chrisseto left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @andy-kimball, @bdarnell, @catj-cockroach, and @knz)


pkg/ccl/sqlproxyccl/proxy_handler_test.go, line 1041 at r1 (raw file):

	te.setAuthenticated(false)
	te.setErrToClient(nil)
	t.Logf("WOO %q", url)

nit: Remove this log line or make it more informative if it should stay.

Copy link
Contributor

@catj-cockroach catj-cockroach left a comment

Choose a reason for hiding this comment

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

Reviewed 5 of 5 files at r1, all commit messages.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @andy-kimball, @bdarnell, and @knz)

@knz knz force-pushed the 20211005-tls branch 4 times, most recently from ed821ba to 608c15b Compare October 5, 2021 22:25
Copy link
Contributor Author

@knz knz left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @andy-kimball, @bdarnell, and @catj-cockroach)


pkg/ccl/sqlproxyccl/proxy_handler_test.go, line 1041 at r1 (raw file):

Previously, chrisseto (Chris Seto) wrote…

nit: Remove this log line or make it more informative if it should stay.

Done

@knz knz force-pushed the 20211005-tls branch 4 times, most recently from d085991 to 4eca33c Compare October 5, 2021 23:43
@andy-kimball
Copy link
Contributor

The test changes LGTM.

This patch also fixes the TestComposeGSSPython test.

Release note (security update): It is not possible any more to use a
node TLS certificate to establish a SQL connection with another
username than `node`. This facility had existed as an "escape hatch"
so that an operator could use the node cert to perform operations on
behalf of another SQL user. However, this facility is not necessary:
an operator with access to a node cert can log in as `node` directly
and create new credentials for another user anyway. By removing
this facility, we tighten the guarantee that the principal in the TLS
client cert always matches the SQL identity.
@knz
Copy link
Contributor Author

knz commented Oct 6, 2021

ok the tests pass now I think

bors r=catj-cockroach,andy-kimball

@craig
Copy link
Contributor

craig bot commented Oct 6, 2021

Build succeeded:

@craig craig bot merged commit 04d6d93 into cockroachdb:master Oct 6, 2021
@knz knz deleted the 20211005-tls branch October 6, 2021 01:20
knz added a commit to knz/cockroach that referenced this pull request May 24, 2022
The RSA key size used by TLS certs for acceptance tests must be at
least 2048 to please OpenSSL (which is used by libpq in tests).

The previous PR cockroachdb#71134 had improved this for some cases but the
chance was hidden in-between other things. This commit makes
it clearer what is going on.

Release note: None
knz added a commit to knz/cockroach that referenced this pull request May 24, 2022
The RSA key size used by TLS certs for acceptance tests must be at
least 2048 to please OpenSSL (which is used by libpq in tests).

The previous PR cockroachdb#71134 had improved this for some cases but the
chance was hidden in-between other things. This commit makes
it clearer what is going on.

Release note: None
knz added a commit to knz/cockroach that referenced this pull request May 24, 2022
The RSA key size used by TLS certs for acceptance tests must be at
least 2048 to please OpenSSL (which is used by libpq in tests).

The previous PR cockroachdb#71134 had improved this for some cases but the
chance was hidden in-between other things. This commit makes
it clearer what is going on.

Release note: None
knz added a commit to knz/cockroach that referenced this pull request May 24, 2022
The RSA key size used by TLS certs for acceptance tests must be at
least 2048 to please OpenSSL (which is used by libpq in tests).

The previous PR cockroachdb#71134 had improved this for some cases but the
chance was hidden in-between other things. This commit makes
it clearer what is going on.

Release note: None
craig bot pushed a commit that referenced this pull request May 24, 2022
81727: acceptance: comply with openssl key size restrictions r=rickystewart a=knz

The RSA key size used by TLS certs for acceptance tests must be at
least 2048 to please OpenSSL (which is used by libpq in tests).

The previous PR #71134 had improved this for some cases but the
chance was hidden in-between other things. This commit makes
it clearer what is going on.

Release note: None

Co-authored-by: Raphael 'kena' Poss <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants