spark icon indicating copy to clipboard operation
spark copied to clipboard

[SPARK-47172][CORE] Add support for AES-GCM for RPC encryption

Open sweisdb opened this issue 1 year ago • 1 comments

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.

sweisdb avatar May 09 '24 20:05 sweisdb

cc @mridulm

dongjoon-hyun avatar May 09 '24 21:05 dongjoon-hyun

Took a quick pass through it, sorry for the delay.

+CC @JoshRosen as well.

mridulm avatar May 14 '24 02:05 mridulm

@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.

mridulm avatar Jun 18 '24 05:06 mridulm

@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 avatar Jun 21 '24 07:06 mridulm

@mridulm Sure, will do.

Ngone51 avatar Jun 21 '24 07:06 Ngone51

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 avatar Jun 21 '24 13:06 Ngone51

@Ngone51 I created two backport pull requests here: https://github.com/apache/spark/pull/47060 https://github.com/apache/spark/pull/47061

sweisdb avatar Jun 21 '24 18:06 sweisdb