Skip to content
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

[SPARK-10589] [WEBUI] Add defense against external site framing #8745

Closed
wants to merge 2 commits into from

Conversation

srowen
Copy link
Member

@srowen srowen commented Sep 14, 2015

Set X-Frame-Options: SAMEORIGIN to protect against frame-related vulnerability

@SparkQA
Copy link

SparkQA commented Sep 14, 2015

Test build #42425 has finished for PR 8745 at commit 70da85b.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@holdenk
Copy link
Contributor

holdenk commented Sep 14, 2015

This seems like it could cause issues for manager type programs that want to subframe the Spark UI (e.g. databricks cloud & microsofts hosted spark solution), maybe make it configurable?

@srowen
Copy link
Member Author

srowen commented Sep 14, 2015

Hm, that's a good point -- would they be on the same domain though? I think this setting allows that. There is another value it can take on to allow framing from a specific other domain. That could be configurable ... though I'd love to avoid another config. I am not sure how common this attack is though I hesitate to ignore it too.

@holdenk
Copy link
Contributor

holdenk commented Sep 14, 2015

I'm definitively not a front-end security person so I'm not sure how common/bad an attack like this could be. Adding a config to allow the framing from a specific other domain seems like it would solve the problem. I'm not super sure if the framing is done on the same domain or different domain (no longer have an account either of those systems to check).

@srowen
Copy link
Member Author

srowen commented Sep 14, 2015

I can slap in a config option here in any event, and leave it undocumented (?) for now to both allow for adjusting it but not propagate the little extra complexity for everyone else.

@falaki
Copy link
Contributor

falaki commented Sep 15, 2015

+1 for making it configurable.

@srowen
Copy link
Member Author

srowen commented Sep 15, 2015

@falaki @holdenk what do you think about this? I'm not super excited about plumbing through SparkConf several methods but it's not crazy. The default is SAMEORIGIN but can be configured to ALLOW-FROM [uri].

Another option is to have this off by default, which is most compatible. I'm on the fence; it's a legitimate issue, but for the Spark UIs, the worst case is ... someone tricking you into killing your jobs? Trying to figure out what the right default is.

@SparkQA
Copy link

SparkQA commented Sep 15, 2015

Test build #42482 has finished for PR 8745 at commit 530f1a9.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@JoshRosen
Copy link
Contributor

@holdenk @falaki @ahirreddy, this should not be an issue for DBC since the framed UI should already be served from the same origin.

@srowen
Copy link
Member Author

srowen commented Sep 16, 2015

I'm pretty on the fence on the kind-of-abstract security issue vs possibly inconveniencing some deployments. Certainly it's possible to configure it to still work with framing, securely, after this change. If there's no clear use case that this would break, I would propose proceeding with this to close the possible security issue, for 1.6.

@rxin
Copy link
Contributor

rxin commented Sep 16, 2015

LGTM.

@asfgit asfgit closed this in 5dbaf3d Sep 16, 2015
@srowen srowen deleted the SPARK-10589 branch September 19, 2015 11:03
@alexmnyc
Copy link

Now I am not able to embed it on my grafana dashboard... That should be a configuration parameter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
7 participants