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

release-21.2: security: remove the node TLS client cert exemption #71188

Merged
merged 1 commit into from Oct 11, 2021

Conversation

blathers-crl[bot]
Copy link

@blathers-crl blathers-crl bot commented Oct 6, 2021

Backport 1/1 commits from #71134 on behalf of @knz.

/cc @cockroachdb/release


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.


Release justification: prevents a significant security risk in CC serverless

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.
@blathers-crl blathers-crl bot requested a review from a team October 6, 2021 01:20
@blathers-crl blathers-crl bot requested a review from a team as a code owner October 6, 2021 01:20
@blathers-crl blathers-crl bot force-pushed the blathers/backport-release-21.2-71134 branch from 986fe62 to 64c1481 Compare October 6, 2021 01:20
@blathers-crl
Copy link
Author

blathers-crl bot commented Oct 6, 2021

Thanks for opening a backport.

Please check the backport criteria before merging:

  • Patches should only be created for serious issues.
  • Patches should not break backwards-compatibility.
  • Patches should change as little code as possible.
  • Patches should not change on-disk formats or node communication protocols.
  • Patches should not add new functionality.
  • Patches must not add, edit, or otherwise modify cluster versions; or add version gates.
If some of the basic criteria cannot be satisfied, ensure that the exceptional criteria are satisfied within.
  • There is a high priority need for the functionality that cannot wait until the next release and is difficult to address in another way.
  • The new functionality is additive-only and only runs for clusters which have specifically “opted in” to it (e.g. by a cluster setting).
  • New code is protected by a conditional check that is trivial to verify and ensures that it only runs for opt-in clusters.
  • The PM and TL on the team that owns the changed code have signed off that the change obeys the above rules.

Add a brief release justification to the body of your PR to justify this backport.

Some other things to consider:

  • What did we do to ensure that a user that doesn’t know & care about this backport, has no idea that it happened?
  • Will this work in a cluster of mixed patch versions? Did we test that?
  • If a user upgrades a patch version, uses this feature, and then downgrades, what happens?

@cockroach-teamcity
Copy link
Member

This change is Reviewable

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 10 of 10 files at r1, all commit messages.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @andy-kimball, @bdarnell, @blathers-crl[bot], @chrisseto, and @knz)


pkg/acceptance/cluster/certs.go, line 42 at r1 (raw file):

	maybePanic(security.CreateClientPair(
		certsDir, filepath.Join(certsDir, security.EmbeddedCAKey),
		2048, 48*time.Hour, false, security.RootUserName(), true /* generate pk8 key */))

This looks like an unintentional side effect but one I'm not worried about.


pkg/acceptance/compose/gss/psql/start.sh, line 16 at r1 (raw file):

echo "Preparing SQL user ahead of test"
env \
    PGSSLKEY=/certs/client.root.key \

Not certain this is desired... I'll dig into this more.


pkg/acceptance/compose/gss/python/start.sh, line 14 at r1 (raw file):

echo psql | kinit tester@MY.EX

export PGSSLKEY=/certs/client.root.key

Not certain this is desired either

@catj-cockroach
Copy link
Contributor

The test failure in Github CI (Cockroach) was for the package ccl/sqlproxyccl/tenant, in the Bazel CI runner the tests passed so I'm rerunning the tests.

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.

This looks good to me, I don't have any concerns about the code that's being changed by the backport.

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @andy-kimball, @bdarnell, @blathers-crl[bot], @chrisseto, and @knz)


pkg/acceptance/compose/gss/psql/start.sh, line 16 at r1 (raw file):

Previously, catj-cockroach (Cat J) wrote…

Not certain this is desired... I'll dig into this more.

Oh I missed that this was for creating a user for testing with, ignore this comment and the following comment regarding PGSSLKEY

Copy link
Contributor

@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, @blathers-crl[bot], @catj-cockroach, and @chrisseto)


pkg/acceptance/cluster/certs.go, line 42 at r1 (raw file):

Previously, catj-cockroach (Cat J) wrote…

This looks like an unintentional side effect but one I'm not worried about.

It's absolutely necessary. The Docker image we use as base for the TestComposeGSS uses a version of debian which has a OpenSSL constraint on minimum key size. At key size 1024, the test fails with error message "ee key too small" when the key is loaded from disk.

@otan otan removed the request for review from a team October 10, 2021 23:58
@knz knz merged commit d5d93a1 into release-21.2 Oct 11, 2021
@knz knz deleted the blathers/backport-release-21.2-71134 branch October 11, 2021 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants