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

K8SSAND-1841 ⁃ Stargate client-to-node encryption allows unencrypted connections #722

Closed
adejanovski opened this issue Oct 17, 2022 · 3 comments · Fixed by #733
Closed
Assignees

Comments

@adejanovski
Copy link
Contributor

adejanovski commented Oct 17, 2022

It seems like enabling client to node encryption in k8ssandra-operator, and despite the encryption settings being passed to Stargate, it is still possible to use cqlsh without any encryption setting to connect to the Stargate service. The Cassandra service refuses similar connection attempts in this case.

This can be easily reproduced with the encryption with Stargate manifest we use for e2e test: test/testdata/fixtures/single-dc-encryption-stargate/k8ssandra.yaml

It requires to install first the following manifests to get the encryption stores:

  • test/testdata/fixtures/server-encryption-secret.yaml
  • test/testdata/fixtures/client-encryption-secret.yaml

Then ssh into one of the Cassandra pods and try both:

cqlsh --username test-superuser --password <superuser password> test-dc1-service
and
cqlsh --username test-superuser --password <superuser password> test-dc1-stargate-service

The former will fail but the latter will succeed.

┆Issue is synchronized with this Jira Task by Unito
┆friendlyId: K8SSAND-1841
┆priority: Medium

@adejanovski adejanovski added the zh:Assess/Investigate Issues in the ZenHub pipeline 'Assess/Investigate' label Oct 17, 2022
@sync-by-unito sync-by-unito bot changed the title Stargate client-to-node encryption allows unencrypted connections K8SSAND-1841 ⁃ Stargate client-to-node encryption allows unencrypted connections Oct 17, 2022
@olim7t
Copy link
Contributor

olim7t commented Oct 17, 2022

Stargate CQL uses a separate configuration file: provided with -Dstargate.cql.config_path, sample contents here. I'll look at generating and mounting it.

For reference, this was introduced in stargate/stargate#1992.

@adejanovski
Copy link
Contributor Author

oooooh, I see.
Thanks for taking care of that 🙏

@olim7t
Copy link
Contributor

olim7t commented Oct 18, 2022

Useful info from the discussions on #721:

We are only copying the server_encryption_options and client_encryption_options properties from Cassandra [to the Stargate config map] when they are set.

What Stargate CQL needs is client_encryption_options. So we can actually omit them from cassandra.yaml, and copy them to the new file instead.

Note: reusing cassandra.yaml for both would also probably work, but having two separate files is a bit cleaner IMO.

@adejanovski adejanovski added zh:In-Progress Issues in the ZenHub pipeline 'In-Progress' zh:Review Issues in the ZenHub pipeline 'Review' zh:Done Issues in the ZenHub pipeline 'Done' and removed zh:Assess/Investigate Issues in the ZenHub pipeline 'Assess/Investigate' zh:In-Progress Issues in the ZenHub pipeline 'In-Progress' zh:Review Issues in the ZenHub pipeline 'Review' labels Oct 20, 2022
olim7t added a commit that referenced this issue Oct 21, 2022
@adejanovski adejanovski removed zh:Done Issues in the ZenHub pipeline 'Done' zh:Review Issues in the ZenHub pipeline 'Review' labels Nov 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants