The Spark UI is mainly used to monitor the performance of your Spark setup. However, it may also expose sensitive data such as the keystore password in some of the UIs depending on your Spark configurations. For security purposes, you can either disable the Spark UI completely, remove selected tabs from the selected UIsUI, or disable only the required properties.
...
Table of Contents | ||||
---|---|---|---|---|
|
Disabling the Spark UI completely
To disable the Spark UI completely, follow the steps below.
Build a sample servlet filter.
Info You can use any servlet filter for this purpose. If you want to implement your own servley filter, you can follow the instructions in Apache Tomcat - Interface Filter.
- Place the build jar in the
<DAS_HOME>/repository/component/lib
directory. Add the following property to the
<DAS_HOME>/repository/conf/analytics/spark/spark-default.conf
file.Code Block language java spark.ui.filters com.examples.BasicAuthenticationFilter spark.com.examples.BasicAuthenticationFilter.params username=admin,password=admin
Add the following property to the
<DAS_HOME>/repository/conf/analytics/spark/external-spark-classpath.conf
file.Code Block repository/components/lib/basicAuthenticationFilter-0.0.1-SNAPSHOT.jar
- Restart the the DAS cluster.
Disabling selected UIs
Disable the Spark UIs UI for your DAS deployment by setting the spark.ui.enabled
property to false in the <DAS_HOME>/repository/conf/analytics/spark/spark-defaults.conf
file as shown below.
Code Block |
---|
spark.ui.enabled false |
Disabling the selected properties
Exclude the relevant Spark properties from being displayed in the Environment tab of the Application UI by editing your spark properties.