Secure Spark connections
Communication between Spark applications and transactional nodes, masters and workers, and intercommunication between Spark drivers and executors can be encrypted. Encryption must be configured individually on each node in the cluster.
The location of the cassandra.yaml
file depends on the type of installation:
-
Package installations
-
Tarball installations
/etc/hcd/cassandra/cassandra.yaml
<installation_location>/resources/cassandra/conf/cassandra.yaml
Encryption between Spark applications, including between the Spark master and worker nodes, is configured by enabling Spark security in the hcd.yaml
file.
Encryption between the Spark driver and executors in client applications is configured by enabling Spark security in the application configuration properties, or by default in spark-defaults.conf
and spark-daemon-defaults.conf
in the Spark configuration directory.
The default location of the Spark configuration files depends on the type of installation:
-
Package installations:
/etc/hcd/spark/
-
Tarball installations:
<installation_location>/resources/spark/conf
Use the hcd.yaml configuration file to enable Spark security
-
Locate the
hcd.yaml
configuration file. The location of this file depends on the type of installation:-
Package installations
-
Tarball installations
/etc/hcd/hcd.yaml
<installation_location>/resources/cassandra/conf/cassandra.yaml
-
-
Enable mutual authentication and encryption between Spark master and worker nodes in the
hcd.yaml
file.spark_security_enabled: true spark_security_encryption_enabled: true
To enable encryption, you must also enable mutual authentication.
-
To encrypt communication between the Spark application and master, HCD inherits the
client to cluster connection encryption
options. To enable SSL security separately from HCD client-to-cluster encryption, change the settings in thecassandra.yaml
file underspark_ui_options
. Setencryption
tocustom
, then set the keystore settings inencryption_options
.The Spark web UI server automatically discards all cipher algorithms that end with a suffix
SHA
,SHA1
orMD5
. If you manually specify cipher suites for encryption, make sure the specified cipher suites are not ignored by the server and are supported by the web browsers used to access the Spark web UI. For example, two 256 bit cipher suites that are supported by both the server and current web browsers areTLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
andTLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
.
-
For each Spark application, set the following client encryption options to true in the
spark-defaults.conf
file to enable encryption between the Spark driver and executors.Option Description spark.authenticate
Enables or disables mutual authentication using a secret key. The default is
false
.spark.authenticate.enableSaslEncryption
Enables or disables SASL encryption between a Spark driver and its executors. The default is
false
.spark.io.encryption.enabled
Enables or disables encryption for data stored by drivers directly on disk.
To enable encryption by default for all Spark applications, modify the options in the
spark-defaults.conf
file in the Spark configuration directory. To encrypt data stored on the server by default, modify the options in thespark-daemon-defaults.conf
file.Option Description spark.io.encryption.enabled
Enables or disables encryption for data stored by executors and shuffle services directly on disk.