Repository navigation
fix: Use the correct key for the data transfer cipher suite - #854
Merged
Merged
Conversation
Hadoop reads dfs.encrypt.data.transfer.cipher.suites, plural. The singular key was ignored, so the client never offered AES/CTR during the SASL handshake, the DataNode never accepted it, and block data was only protected by SASL DIGEST-MD5 with the privacy QOP. Both sides have to set the key: the client only offers a cipher option when it is set in its own configuration (SaslDataTransferClient), and the DataNode only accepts one when it is set in its own (DataTransferSaslUtil.negotiateCipherOption). The discovery ConfigMap already carries the same wire encryption settings as the Pods, so downstream clients pick the corrected key up from there. Config overrides do not reach the discovery ConfigMap, which is why setting the right key through an override was no workaround for clients.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The operator wrote
dfs.encrypt.data.transfer.cipher.suite, but Hadoop readsdfs.encrypt.data.transfer.cipher.suites(HdfsClientConfigKeys.DFS_ENCRYPT_DATA_TRANSFER_CIPHER_SUITES_KEY).The misspelt key is just ignored so it wrongly fell back to
SASL DIGEST-MD5. This has been the case since #693.The client and the server need to set this setting. We have it in the discovery ConfigMap so this should fix HBase, Hive, Trino, Spark and any other client using the discovery stuff.
Testing
On a k3d cluster with Hadoop 3.5.0, using a Kerberos test case that writes blocks and asserts the DataNodes log
Using crypto codec org.apache.hadoop.crypto.OpensslAesCtrCryptoCodec.dfs.encrypt.data.transfer.cipher.suites, the DataNodes log the OpenSSL AES/CTR codec, and the whole case passes.