-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-18535][UI][YARN] Redact sensitive information from Spark logs and UI #15971
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
5dd3630
[SPARK-18535][UI][YARN] Redact sensitive information from Spark logs …
markgrover b0ad319
Review feedback:
markgrover 78e4398
Fixing a typo
markgrover eed33db
More review feedback. Having Utils.redact() take in the list of tuple…
markgrover 84a7ef3
More review feedback
markgrover 549881b
Making the test in EventLoggingListenerSuite less bloated
markgrover 61a961c
More feedback
markgrover 49015ac
Function indentation at 4
markgrover File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -95,6 +95,18 @@ class EventLoggingListenerSuite extends SparkFunSuite with LocalSparkContext wit | |
| } | ||
| } | ||
|
|
||
| test("Event logging with password redaction") { | ||
| val key = "spark.executorEnv.HADOOP_CREDSTORE_PASSWORD" | ||
| val secretPassword = "secret_password" | ||
| val conf = getLoggingConf(testDirPath, None) | ||
| .set(key, secretPassword) | ||
| val eventLogger = new EventLoggingListener("test", None, testDirPath.toUri(), conf) | ||
| val envDetails = SparkEnv.environmentDetails(conf, "FIFO", Seq.empty, Seq.empty) | ||
| val event = SparkListenerEnvironmentUpdate(envDetails) | ||
| val redactedProps = eventLogger.redactEvent(event).environmentDetails("Spark Properties").toMap | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "Spark Properties" is begging to be turned into a constant somewhere... |
||
| assert(redactedProps(key) == "*********(redacted)") | ||
| } | ||
|
|
||
| test("Log overwriting") { | ||
| val logUri = EventLoggingListener.getLogPath(testDir.toURI, "test", None) | ||
| val logPath = new URI(logUri).getPath | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is very expensive. How about a version that takes a list of tuples and redacts them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What part do you think is expensive? Going through all the configuration properties and matching them with the regex?
If so, I agree. However, that has to be done somewhere. All the callers of this function have a
SparkConfthat they want stuff redacted from. So, if this function accepts a list of tuples, they have to run the regex check to find that list first before sending it toredact(). So, overall, unless I am missing something, I don't think we can avoid the expense.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Compiling the regex once for every item in the list being redacted, instead of doing it once for the whole list.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, good point. Let me fix this.