spark
spark copied to clipboard
[SPARK-47172][CORE] Add support for AES-GCM for RPC encryption
What changes were proposed in this pull request?
This change adds AES-GCM as an optional AES cipher mode for RPC encryption. The current default is using AES-CTR without any authentication. That would allow someone on the network to easily modify RPC contents on the wire and impact Spark behavior. See SPARK-47172 for more details.
Why are the changes needed?
The current default is using AES-CTR without any authentication. That would allow someone on the network to easily modify RPC contents on the wire and impact Spark behavior.
Does this PR introduce any user-facing change?
Yes, it adds an additional configuration flag is reflected in the documentation.
How was this patch tested?
Existing unit tests are all ensured to pass. New unit tests are written to explicitly test GCM support and to verify that modifying ciphertext content will cause an exception and fail.
build/sbt "network-common/test:testOnly"
build/sbt "network-common/test:testOnly org.apache.spark.network.crypto.AuthIntegrationSuite"
build/sbt "network-common/test:testOnly org.apache.spark.network.crypto.AuthEngineSuite"
Was this patch authored or co-authored using generative AI tooling?
Nope.
cc @mridulm
Took a quick pass through it, sorry for the delay.
+CC @JoshRosen as well.
@Ngone51, did you get a chance to review this ? (not sure if you synced with @sweisdb offline :-) ) Given this has to go into released branches, I want to make sure we have more eyes on it.
@Ngone51 , can you merge it to master/branch-3.5 and branch-3.4 once you are done with the reviews ? I might be afk, and dont want to block on this PR getting committed. Thanks !
@mridulm Sure, will do.
Thanks, merged to master!
There are conflicts with branch-3.5/branch-3.4. @sweisdb Could you open the separate PRs for 3.5/3.4? Thanks!
@Ngone51 I created two backport pull requests here: https://github.com/apache/spark/pull/47060 https://github.com/apache/spark/pull/47061