-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
HBASE-28294 Support to skip Kerberos authentication for metric endpoints #5606
base: master
Are you sure you want to change the base?
Conversation
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
Hi @eubnara Welcome and thank you for your first PR in Apache HBase.Please have a look at the review comments and please let me know if you need any support. |
@@ -152,6 +152,9 @@ public class HttpServer implements FilterContainer { | |||
"hbase.security.authentication.ui.config.protected"; | |||
public static final String HTTP_UI_NO_CACHE_ENABLE_KEY = "hbase.http.filter.no-store.enable"; | |||
public static final boolean HTTP_PRIVILEGED_CONF_DEFAULT = false; | |||
public static final String HTTP_PRIVILEGED_METRICS_KEY = |
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.
Can we have a test case similar to the hadoop PR? Else it's difficult to ensure this doesn't break in future.
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.
I got it, thanks. I will prepare with that.
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.
I'm trying to add a test case but I encountered a problem. In order to use "hbase.security.authentication.spnego.kerberos.endpoint.whitelist", HBase should use the hadoop which has HADOOP-18666.
I think HADOOP-18666 will be committed to hadoop >= 3.4.0 according to jira https://issues.apache.org/jira/browse/HADOOP-18666.
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.
Oh oh, in that case this feature won't even work until we have hadoop-3.4 right/ Maybe we park this PR for later then?
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.
I think so.
Let's postpone this PR until hbase uses hadoop with HADOOP-18666.
`false` | ||
|
||
|
||
[[hbase.security.authentication.spnego.kerberos.endpoint.whitelist]] |
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.
Was going through hadoop PR. This property has been implemented in hadoop to handle any endpoint irrespective of whether it is metrics or something else. Why don't we follow same approach.? Do we really need to handle just metrics endpoint and have the other property hbase.security.authentication.ui.metrics.protected
? The property will become redundant.
A generic implementation like the one in hadoop sound more useful to me. Also the name of the config will confuse others. As it seems like a generic whitelist.
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.
If you want to use the name "hadoop.http.authentication.kerberos.endpoint.whitelist", instead of initializing params using configurations that starts with HTTP_SPNEGO_AUTHENTICATION_PREFIX
, that name should be used like:
String endpointWhitelist = getOrEmptyString(conf, "hadoop.http.authentication.kerberos.endpoint.whitelist");
if (!endpointWhitelist.isEmpty()) {
params.put("endpoint.whitelist", endpointWhitelist);
}
Do you think it is more suitable for HBase code?
I did initialize params using configurations that starts with HTTP_SPNEGO_AUTHENTICATION_PREFIX
because already other configurations uses prefix with it.
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.
If you want to use the name "hadoop.http.authentication.kerberos.endpoint.whitelist"
Hey I did not mean to change name.
A generic implementation like the one in hadoop sound more useful to me.
What I am trying to say is current implementation in PR aims to just whitelist which are under metrics umbrella. But if you look at the hadoop PR, it aims to provide a way to whitelist any endpoint in the passed list. Can we not follow that approach and have a generic implementation where we let the user whitelist any endpoint irrespective of whether it is a metric endpoint or say /logs
Also the name of the config will confuse others. As it seems like a generic whitelist.
I mean nowhere in config name hbase.security.authentication.spnego.kerberos.endpoint.whitelist
it is obvious that this can control only metrics endpoints.
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.
Ignore as my doubt is clear here. Just that I think even conf servlet would also require the whitelisting if one want to access it:
if (conf.getBoolean(HTTP_PRIVILEGED_CONF_KEY, HTTP_PRIVILEGED_CONF_DEFAULT)) { |
So is this documentation correct? It is valid even if hbase.security.authentication.ui.config.protected
is false and whitelist is set to \conf, isn't it?
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.
Yes, if someone wants to disable spnego authentication completely on /conf
endpoint completely, /conf
should also be added to whitelist.
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.
Maybe then update docs to reflect same?
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.
I updated docs.
hbase-http/src/main/java/org/apache/hadoop/hbase/http/HttpServer.java
Outdated
Show resolved
Hide resolved
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
// FIXME: hadoop >= 3.4.0 (or hadoop with HADOOP-18666) is needed to test with below lines. | ||
// url = new URL(getServerURL(server), "/prometheus"); | ||
// conn = (HttpURLConnection) url.openConnection(); | ||
// assertEquals(HttpURLConnection.HTTP_OK, conn.getResponseCode()); |
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.
I added a test case but it cannot be tested properly if you don't use hadoop with HADOOP-18666 😢 .
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
25150c8
to
09291ac
Compare
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
https://issues.apache.org/jira/browse/HBASE-28294
Make HBase support to skip Kerberos authentication for metric endpoints. (e.g. /jvm, /prometheus, /metrics)
Since HBase uses KerberoAuthenticationHandler.java, whitelist configuration can be used like HADOOP-16527.