Skip to content

KAFKA-9460: Enable TLSv1.2 by default and disable all others protocol versions#7998

Merged
rajinisivaram merged 9 commits intoapache:trunkfrom
nizhikov:KAFKA-9460
Jan 28, 2020
Merged

KAFKA-9460: Enable TLSv1.2 by default and disable all others protocol versions#7998
rajinisivaram merged 9 commits intoapache:trunkfrom
nizhikov:KAFKA-9460

Conversation

@nizhikov
Copy link
Copy Markdown
Contributor

This PR by default disable all SSL protocols except TLSv1.2.
Changes discussed in KIP-553.

Committer Checklist (excluded from commit message)

  • Verify design and implementation
  • Verify test coverage and CI build status
  • Verify documentation (including upgrade notes)

@nizhikov
Copy link
Copy Markdown
Contributor Author

Hello @rajinisivaram.
Can you, please, review my changes regarding KIP-553.

+ "Allowed values in recent JVMs are TLS, TLSv1.1, TLSv1.2 and TLSv1.3. SSL, SSLv2 and SSLv3 "
+ "may be supported in older JVMs, but their usage is discouraged due to known security vulnerabilities.";

public static final String DEFAULT_SSL_PROTOCOL = "TLS";
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Does this need to change as well? Or does the enabled protocol list constrain it?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It seems, doc inconsistent for now.
We do support TLVv1.3.

see e275742

Copy link
Copy Markdown
Contributor

@rajinisivaram rajinisivaram left a comment

Choose a reason for hiding this comment

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

@nizhikov Thanks for the PR, left a couple of comments. Can we also add a test to verify the change?

Comment thread clients/src/main/java/org/apache/kafka/common/config/SslConfigs.java Outdated
Comment thread clients/src/main/java/org/apache/kafka/common/config/SslConfigs.java Outdated
@nizhikov
Copy link
Copy Markdown
Contributor Author

@rajinisivaram

Can we also add a test to verify the change?

Can you, please, clarify, what should this new test check?
Just assert the value of the default SslConfig? Or something more complicated?

@rajinisivaram
Copy link
Copy Markdown
Contributor

@nizhikov I think it is perhaps useful to add a test that uses the actual configs. Something similar to SslTransportLayerTest.testUnsupportedTLSVersion(), but where the protocol configs are the defaults. You could use TestSecurityConfig to ensure we are using defaults, since this is already used in SslTransportLayerTest for server-side configs.

@nizhikov
Copy link
Copy Markdown
Contributor Author

@rajinisivaram

SslTransportLayerTest#testTLSDefaults added.
Please, take a look.

@nizhikov
Copy link
Copy Markdown
Contributor Author

retest this please

Copy link
Copy Markdown
Contributor

@rajinisivaram rajinisivaram left a comment

Choose a reason for hiding this comment

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

@nizhikov Thanks for adding the test. Left a few comments.

Comment thread clients/src/main/java/org/apache/kafka/common/config/SslConfigs.java Outdated
Comment thread clients/src/test/java/org/apache/kafka/common/network/SslTransportLayerTest.java Outdated
Comment thread clients/src/test/java/org/apache/kafka/common/network/SslTransportLayerTest.java Outdated
@nizhikov
Copy link
Copy Markdown
Contributor Author

@rajinisivaram Thanks for the feedback.

PR updated according to your comments.
Please, take a look.

Copy link
Copy Markdown
Contributor

@rajinisivaram rajinisivaram left a comment

Choose a reason for hiding this comment

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

@nizhikov Thanks for the updates, left a few more minor comments in the test. Apart from those, I think this is ready to go.


/**
* Tests that connections cannot be made with unsupported TLS versions
* Tests that connection sucess with the default TLS version.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: typo success
Also mention that it tests that insecure protocols are not enabled by default.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

Comment thread clients/src/test/java/org/apache/kafka/common/network/SslTransportLayerTest.java Outdated
Comment thread clients/src/test/java/org/apache/kafka/common/network/SslTransportLayerTest.java Outdated
@nizhikov
Copy link
Copy Markdown
Contributor Author

@rajinisivaram PR updated according to your comments.

Copy link
Copy Markdown
Contributor

@rajinisivaram rajinisivaram left a comment

Choose a reason for hiding this comment

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

@nizhikov Thanks for the updates, LGTM. Will merge if the PR builds pass.

@nizhikov
Copy link
Copy Markdown
Contributor Author

nizhikov commented Jan 28, 2020

@rajinisivaram One of the build passed and other failed. It seems fail doesn't relate to these changes.

@rajinisivaram
Copy link
Copy Markdown
Contributor

@nizhikov Yes, the test failure is unrelated (ConsumerBounceTest). Merging to trunk.

@rajinisivaram rajinisivaram merged commit 172409c into apache:trunk Jan 28, 2020
@nizhikov
Copy link
Copy Markdown
Contributor Author

@rajinisivaram Thank you so much for the review and merge!

ijuma added a commit to confluentinc/kafka that referenced this pull request Feb 2, 2020
Conflicts and/or compiler errors due to the fact that we
temporarily reverted the commit that removes
Scala 2.11 support:

* SslAdminIntegrationTest: keep using JAdminClient,
take upstream changes otherwise.
* ReassignPartitionsClusterTest: keep using
JAdminClient, take upstream changes otherwise.
* KafkaApis: use `asScala.foreach` instead of
`forEach`.

# By Ismael Juma (3) and others
# Via GitHub
* apache-github/trunk: (22 commits)
  KAFKA-9437; Make the Kafka Protocol Friendlier with L7 Proxies [KIP-559] (apache#7994)
  KAFKA-9375: Add names to all Connect threads (apache#7901)
  MINOR: Introduce 2.5-IV0 IBP (apache#8010)
  KAFKA-8503; Add default api timeout to AdminClient (KIP-533) (apache#8011)
  Add retries to release.py script (apache#8021)
  KAFKA-8162: IBM JDK Class not found error when handling SASL (apache#6524)
  MINOR: Add explicit result type in public defs/vals (apache#7993)
  KAFKA-9408: Use StandardCharsets.UTF-8 instead of "UTF-8" (apache#7940)
  KAFKA-9474: Adds 'float64' to the RPC protocol types (apache#8012)
  KAFKA-9360: Allow disabling MM2 heartbeat and checkpoint emissions (apache#7887)
  KAFKA-7658: Add KStream#toTable to the Streams DSL (apache#7985)
  KAFKA-9445: Allow adding changes to allow serving from a specific partition (apache#7984)
  KAFKA-9422: Track the set of topics a connector is using (KIP-558) (apache#8017)
  KAFKA-9040; Add --all option to config command (apache#7607)
  KAFKA-4203: Align broker default for max.message.bytes with Java producer default (apache#4154)
  KAFKA-9426: Use switch instead of chained if/else in OffsetsForLeaderEpochClient (apache#7959)
  KAFKA-9405: Use Map.computeIfAbsent where applicable (apache#7937)
  KAFKA-9026: Use automatic RPC generation in DescribeAcls (apache#7560)
  MINOR: Remove unused fields in StreamsMetricsImpl (apache#7992)
  KAFKA-9460: Enable only TLSv1.2 by default and disable other TLS protocol versions (KIP-553) (apache#7998)
  ...
rajinisivaram added a commit to confluentinc/kafka that referenced this pull request Mar 2, 2020
…TLS protocol versions (KIP-553) (apache#7998)"

This reverts commit 172409c
rajinisivaram added a commit to confluentinc/kafka that referenced this pull request Mar 3, 2020
…able other TLS protocol versions (KIP-553) (apache#7998)" (#275)

This reverts commit 172409c

TLSv1.0 and TLSv1.1 will be disabled in CP 6.0 across the whole platform.
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.

3 participants