diff options
author | Artur Sukhenko <artur.sukhenko@gmail.com> | 2016-08-02 16:13:12 -0700 |
---|---|---|
committer | Sean Owen <sowen@cloudera.com> | 2016-08-02 16:13:12 -0700 |
commit | 3861273771c2631e88e1f37a498c644ad45ac1c0 (patch) | |
tree | fa296c8771bf4035f28e9b8c33ca00e6c7844ffd /core/src/main | |
parent | b73a5706032eae7c87f7f2f8b0a72e7ee6d2e7e5 (diff) | |
download | spark-3861273771c2631e88e1f37a498c644ad45ac1c0.tar.gz spark-3861273771c2631e88e1f37a498c644ad45ac1c0.tar.bz2 spark-3861273771c2631e88e1f37a498c644ad45ac1c0.zip |
[SPARK-16796][WEB UI] Visible passwords on Spark environment page
## What changes were proposed in this pull request?
Mask spark.ssl.keyPassword, spark.ssl.keyStorePassword, spark.ssl.trustStorePassword in Web UI environment page.
(Changes their values to ***** in env. page)
## How was this patch tested?
I've built spark, run spark shell and checked that this values have been masked with *****.
Also run tests:
./dev/run-tests
[info] ScalaTest
[info] Run completed in 1 hour, 9 minutes, 5 seconds.
[info] Total number of tests run: 2166
[info] Suites: completed 65, aborted 0
[info] Tests: succeeded 2166, failed 0, canceled 0, ignored 590, pending 0
[info] All tests passed.
![mask](https://cloud.githubusercontent.com/assets/15244468/17262154/7641e132-55e2-11e6-8a6c-30ead77c7372.png)
Author: Artur Sukhenko <artur.sukhenko@gmail.com>
Closes #14409 from Devian-ua/maskpass.
Diffstat (limited to 'core/src/main')
-rw-r--r-- | core/src/main/scala/org/apache/spark/ui/env/EnvironmentPage.scala | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/core/src/main/scala/org/apache/spark/ui/env/EnvironmentPage.scala b/core/src/main/scala/org/apache/spark/ui/env/EnvironmentPage.scala index f0a1174a71..22136a6f10 100644 --- a/core/src/main/scala/org/apache/spark/ui/env/EnvironmentPage.scala +++ b/core/src/main/scala/org/apache/spark/ui/env/EnvironmentPage.scala @@ -26,11 +26,15 @@ import org.apache.spark.ui.{UIUtils, WebUIPage} private[ui] class EnvironmentPage(parent: EnvironmentTab) extends WebUIPage("") { private val listener = parent.listener + private def removePass(kv: (String, String)): (String, String) = { + if (kv._1.toLowerCase.contains("password")) (kv._1, "******") else kv + } + def render(request: HttpServletRequest): Seq[Node] = { val runtimeInformationTable = UIUtils.listingTable( propertyHeader, jvmRow, listener.jvmInformation, fixedWidth = true) val sparkPropertiesTable = UIUtils.listingTable( - propertyHeader, propertyRow, listener.sparkProperties, fixedWidth = true) + propertyHeader, propertyRow, listener.sparkProperties.map(removePass), fixedWidth = true) val systemPropertiesTable = UIUtils.listingTable( propertyHeader, propertyRow, listener.systemProperties, fixedWidth = true) val classpathEntriesTable = UIUtils.listingTable( |