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

feature(client-encrypt): enable peer verification for stress commands #9637

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dimakr
Copy link
Contributor

@dimakr dimakr commented Jan 2, 2025

Peer verification is now enabled by default for cassandra-stress, scylla-bench, and latte stress tools when client encryption is configured in Scylla. This ensures enhanced security by verifying if peer certificate is signed by the trusted CA and that the hostname/IP of the peer matches SAN specified in the peer's certificate.

Closes: https://github.com/scylladb/qa-tasks/issues/1728

Testing

PR pre-checks (self review)

  • I added the relevant backport labels
  • I didn't leave commented-out/debugging code

Reminders

  • Add New configuration option and document them (in sdcm/sct_config.py)
  • Add unit tests to cover my changes (under unit-test/ folder)
  • Update the Readme/doc folder relevant to this change (if needed)

Peer verification is now enabled by default for cassandra-stress, scylla-bench,
and latte stress tools when client encryption is configured in Scylla. This ensures
enhanced security by verifying if peer certificate is signed by the trusted CA and
that the hostname/IP of the peer matches SAN specified in the peer's certificate.

Closes: scylladb/qa-tasks#1728
@dimakr dimakr marked this pull request as ready for review January 2, 2025 11:21
@dimakr dimakr requested a review from fruch January 2, 2025 11:21
@dimakr dimakr added the test-integration Enable running the integration tests suite label Jan 2, 2025
@dimakr dimakr requested a review from a team January 2, 2025 11:22
@fruch fruch added the backport/none Backport is not required label Jan 2, 2025
Copy link
Contributor

@fruch fruch left a comment

Choose a reason for hiding this comment

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

I think at least one test should enabled it (maybe some from tier1, or upgrades)

@dimakr
Copy link
Contributor Author

dimakr commented Jan 2, 2025

I think at least one test should enabled it (maybe some from tier1, or upgrades)

peer_encryption setting is enabled by default in test_default.yaml. So it will be enabled when client_encrypt is ON.
And the client_encrypt is already enabled out-of-box in these test configs:

❯ grep 'client_encrypt: true' -ir ./
./test-cases/artifacts/ubuntu2004-fips.yaml:client_encrypt: true
./test-cases/longevity/longevity-lwt-24h-multidc.yaml:client_encrypt: true
./test-cases/longevity/longevity-50GB-3days-authorization-and-tls-ssl.yaml:client_encrypt: true
./test-cases/longevity/longevity-aws-custom-d2-workload1-3dcs.yaml:client_encrypt: true
./test-cases/longevity/longevity-1TB-5days-authorization-and-tls-ssl.yaml:client_encrypt: true
./test-cases/longevity/longevity-150GB-12h-autorization-LimitedMonkey.yaml:client_encrypt: true
./test-cases/longevity/longevity-2TB-48h-authorization-and-tls-ssl-1dis-2nondis-nemesis.yaml:client_encrypt: true
./test-cases/longevity/longevity-100gb-4h.yaml:client_encrypt: true
./test-cases/longevity/longevity-alternator-200GB-48h.yaml:client_encrypt: true
./test-cases/longevity/longevity-200GB-48h-verifier-LimitedMonkey-tls.yaml:client_encrypt: true
./test-cases/longevity/longevity-1TB-3days-authorization-and-tls-ssl.yaml:client_encrypt: true
./test-cases/longevity/longevity-encryption-at-rest-50GB-1day-authorization-and-tls-ssl.yaml:client_encrypt: true
./test-cases/longevity/longevity-aws-custom-d2-workload1-5dcs.yaml:client_encrypt: true
./test-cases/longevity/longevity-5TB-1day.yaml:client_encrypt: true
./test-cases/nemesis/longevity-5gb-1h-EndOfQuotaNemesis.yaml:client_encrypt: true
./configurations/longevity-fips-and-encryptions.yaml:client_encrypt: true
./configurations/nemesis/longevity-5gb-1h-nemesis.yaml:client_encrypt: true
...

At least some of them are used in tier1, e.g.:
jenkins-pipelines/oss/tier1/longevity-1tb-5days-azure.jenkinsfile: test_config: 'test-cases/longevity/longevity-1TB-5days-authorization-and-tls-ssl.yaml'
jenkins-pipelines/oss/tier1/longevity-50gb-3days.jenkinsfile: test_config: '''["test-cases/longevity/longevity-50GB-3days-authorization-and-tls-ssl.yaml", "configurations/network_config/two_interfaces.yaml", "configurations/advanced-rpc-compression.yaml"]'''
etc.
@fruch

Copy link
Contributor

@fruch fruch left a comment

Choose a reason for hiding this comment

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

LGTM

@fruch
Copy link
Contributor

fruch commented Jan 2, 2025

I think at least one test should enabled it (maybe some from tier1, or upgrades)

peer_encryption setting is enabled by default in test_default.yaml. So it will be enabled when client_encrypt is ON.
And the client_encrypt is already enabled out-of-box in these test configs:

❯ grep 'client_encrypt: true' -ir ./
./test-cases/artifacts/ubuntu2004-fips.yaml:client_encrypt: true
./test-cases/longevity/longevity-lwt-24h-multidc.yaml:client_encrypt: true
./test-cases/longevity/longevity-50GB-3days-authorization-and-tls-ssl.yaml:client_encrypt: true
./test-cases/longevity/longevity-aws-custom-d2-workload1-3dcs.yaml:client_encrypt: true
./test-cases/longevity/longevity-1TB-5days-authorization-and-tls-ssl.yaml:client_encrypt: true
./test-cases/longevity/longevity-150GB-12h-autorization-LimitedMonkey.yaml:client_encrypt: true
./test-cases/longevity/longevity-2TB-48h-authorization-and-tls-ssl-1dis-2nondis-nemesis.yaml:client_encrypt: true
./test-cases/longevity/longevity-100gb-4h.yaml:client_encrypt: true
./test-cases/longevity/longevity-alternator-200GB-48h.yaml:client_encrypt: true
./test-cases/longevity/longevity-200GB-48h-verifier-LimitedMonkey-tls.yaml:client_encrypt: true
./test-cases/longevity/longevity-1TB-3days-authorization-and-tls-ssl.yaml:client_encrypt: true
./test-cases/longevity/longevity-encryption-at-rest-50GB-1day-authorization-and-tls-ssl.yaml:client_encrypt: true
./test-cases/longevity/longevity-aws-custom-d2-workload1-5dcs.yaml:client_encrypt: true
./test-cases/longevity/longevity-5TB-1day.yaml:client_encrypt: true
./test-cases/nemesis/longevity-5gb-1h-EndOfQuotaNemesis.yaml:client_encrypt: true
./configurations/longevity-fips-and-encryptions.yaml:client_encrypt: true
./configurations/nemesis/longevity-5gb-1h-nemesis.yaml:client_encrypt: true
...

At least some of them are used in tier1, e.g.:
jenkins-pipelines/oss/tier1/longevity-1tb-5days-azure.jenkinsfile: test_config: 'test-cases/longevity/longevity-1TB-5days-authorization-and-tls-ssl.yaml'
jenkins-pipelines/oss/tier1/longevity-50gb-3days.jenkinsfile: test_config: '''["test-cases/longevity/longevity-50GB-3days-authorization-and-tls-ssl.yaml", "configurations/network_config/two_interfaces.yaml", "configurations/advanced-rpc-compression.yaml"]'''
etc.
@fruch

So used to be doing it the way around, so I didn't notice you did it by default

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/none Backport is not required test-integration Enable running the integration tests suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants