Skip to content

Conversation

@dongjoon-hyun
Copy link
Member

@dongjoon-hyun dongjoon-hyun commented Aug 4, 2024

What changes were proposed in this pull request?

This PR aims the following.

  • Document JWSFilter and its usage in Spark UI and REST API
    • Spark UI section of Configuration page
    • Spark Security page
    • Spark Standalone page
  • Rename the parameter key to secretKey to redact it in Spark Driver UI and Spark Master UI.

Why are the changes needed?

To apply recent new security features

Does this PR introduce any user-facing change?

No because this is a new feature of Apache Spark 4.0.0.

How was this patch tested?

Pass the CIs and manual review.

  • spark-standalone.html
    Screenshot 2024-08-03 at 22 40 53

  • security.html
    Screenshot 2024-08-03 at 22 39 00
    Screenshot 2024-08-03 at 22 39 51

  • configuration.html
    Screenshot 2024-08-03 at 22 38 07

Was this patch authored or co-authored using generative AI tooling?

No.

…REST API and rename parameter to `secretKey`
<tr>
<td><code>spark.redaction.regex</code></td>
<td>(?i)secret|password|token|access[.]key</td>
<td>(?i)secret|password|token|access[.]?key</td>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, this is missed at #47392 .

*/
override def init(config: FilterConfig): Unit = {
key = Keys.hmacShaKeyFor(Decoders.BASE64URL.decode(config.getInitParameter("key")));
key = Keys.hmacShaKeyFor(Decoders.BASE64URL.decode(config.getInitParameter("secretKey")));
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently, key can be exposed if spark.ui.filters configuration is removed mistakenly.
Screenshot 2024-08-03 at 22 02 55

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

secretKey will be redact by Spark, right?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As you make the change #47596 (comment), do we still need to change this param to secretKey?

@dongjoon-hyun
Copy link
Member Author

Could you review this, @viirya ?

@dongjoon-hyun
Copy link
Member Author

Could you review this PR, @yaooqinn ?

@HyukjinKwon
Copy link
Member

Merged to master.

@dongjoon-hyun
Copy link
Member Author

Thank you, @viirya and @HyukjinKwon .

To @viirya , yes. We need to rename key to secretKey to redact. Yes, the documentation change is about to match the code.

As you make the change #47596 (comment), do we still need to change this param to secretKey?

@dongjoon-hyun dongjoon-hyun deleted the SPARK-49104 branch August 5, 2024 00:48
@yaooqinn
Copy link
Member

yaooqinn commented Aug 5, 2024

Late LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants