Uh oh!
There was an error while loading. Please reload this page.
[SPARK-18061][SQL][Security] Spark Thriftserver needs to create SPNego principal - #15594
[SPARK-18061][SQL][Security] Spark Thriftserver needs to create SPNego principal#15594cmirash wants to merge 1 commit into
Conversation
cmirash
commented
Nov 1, 2016
@steveloughran@yhuai Will you be able to help review this PR? |
steveloughran
commented
Nov 2, 2016
I'm not spark committer so can't review it well enough to get in; I was just watching it out of concern for the word "kerberos". How about you ask on the spark developer list for any volunteers to review. Looking at the code, I'd drop using reflection for logging. You can just create an SLF4J log with the name "org.apache.hive.hiveserver2" (or whatever the full path is) and end up with the same log name as the parent class. As for the setting of the hive option, I do think it's an ugly pain which should really be addressed by making hive extensible —until then, what choice to do you have. |
cmirash
commented
Nov 2, 2016
Thanks @steveloughran. I will check on the developer list. |
| } else { | ||
| try { | ||
| httpUGI = HiveAuthFactory.loginFromSpnegoKeytabAndReturnUGI(hiveConf) | ||
| setSuperField(this, "httpUGI", httpUGI) |
There was a problem hiding this comment.
We have similar code in CLIService.java which is not setting the httpUGI field, do we need to make the behavior the same in both files ?
lresende
commented
Nov 18, 2016
@vanzin I believe this might be your realm :) Could you please help review this. |
cmirash
commented
Nov 18, 2016
Thanks Luciano. I am looking at the changes and will add them soon. |
vanzin
commented
Nov 22, 2016
ok to test |
vanzin
left a comment
There was a problem hiding this comment.
I'm not really familiar with the thrift server (Spark's or Hive's) so can't really comment much. Maybe someone more familiar with this code can take a look (use git blame to find out?).
| } | ||
| } | ||
| // Also try creating a UGI object for the SPNego principal |
There was a problem hiding this comment.
Indentation here is wrong. Also, following blocks have code indented with 4 spaces instead of 2, and wrong indentation.
| val principal = hiveConf.getVar(ConfVars.HIVE_SERVER2_SPNEGO_PRINCIPAL) | ||
| val keyTabFile = hiveConf.getVar(ConfVars.HIVE_SERVER2_SPNEGO_KEYTAB) | ||
| if (principal.isEmpty() || keyTabFile.isEmpty()) { | ||
| getAncestorField[Log](this, 3, "LOG").info( |
There was a problem hiding this comment.
This log message seems unnecessary.
There was a problem hiding this comment.
Thanks @vanzin. The log message was added to replicate same behavior as the Hive Thriftserver code block. @steveloughran added the kerberos code and he added his comments above.
There was a problem hiding this comment.
I don't know about the specific log policy here; but I do think using reflection to get a private stuff is dangerous. I know it happens a lot in this code but at some point it'd be nice to move it. you don't need to use reflection to get the same log as a parent, just go
LoggerFactory.getLog("org.apache.hive.thrift...whatever").info(s"something $key")
This is cleaner and not going to break if hive ever change logging frameworks.
SparkQA
commented
Nov 22, 2016
Test build #69034 has finished for PR 15594 at commit
|
HyukjinKwon
commented
May 11, 2017
Hi @cmirash, is it still active? |
## What changes were proposed in this pull request? This PR proposes to close PRs ... - inactive to the review comments more than a month - WIP and inactive more than a month - with Jenkins build failure but inactive more than a month - suggested to be closed and no comment against that - obviously looking inappropriate (e.g., Branch 0.5) To make sure, I left a comment for each PR about a week ago and I could not have a response back from the author in these PRs below: Closesapache#11129Closesapache#12085Closesapache#12162Closesapache#12419Closesapache#12420Closesapache#12491Closesapache#13762Closesapache#13837Closesapache#13851Closesapache#13881Closesapache#13891Closesapache#13959Closesapache#14091Closesapache#14481Closesapache#14547Closesapache#14557Closesapache#14686Closesapache#15594Closesapache#15652Closesapache#15850Closesapache#15914Closesapache#15918Closesapache#16285Closesapache#16389Closesapache#16652Closesapache#16743Closesapache#16893Closesapache#16975Closesapache#17001Closesapache#17088Closesapache#17119Closesapache#17272Closesapache#17971 Added: Closesapache#17778Closesapache#17303Closesapache#17872 ## How was this patch tested? N/A Author: hyukjinkwon <gurwls223@gmail.com> Closesapache#18017 from HyukjinKwon/close-inactive-prs.
What changes were proposed in this pull request?
Spark Thriftserver when running in HTTP mode with Kerberos enabled gives a 401 authentication error when receiving beeline HTTP request (with end user as kerberos principal). The similar command works with Hive Thriftserver.
What we find is Hive thriftserver CLI service creates both hive service and SPNego principal when kerberos is enabled whereas Spark Thriftserver only creates hive service principal.
CLIService.java
SparkSQLCLIService.scala
The patch will add missing SPNego principal to Spark Thriftserver.
How was this patch tested?
Ran manual testing with beeline command through spark against kerberized cluster.
Ran Spark unit tests for hive, sql and catalyst.