Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
import org.apache.hbase.thirdparty.org.eclipse.jetty.server.ServerConnector;
import org.apache.hbase.thirdparty.org.eclipse.jetty.server.SslConnectionFactory;
import org.apache.hbase.thirdparty.org.eclipse.jetty.server.handler.ContextHandlerCollection;
import org.apache.hbase.thirdparty.org.eclipse.jetty.server.handler.ErrorHandler;
import org.apache.hbase.thirdparty.org.eclipse.jetty.server.handler.HandlerCollection;
import org.apache.hbase.thirdparty.org.eclipse.jetty.server.handler.RequestLogHandler;
import org.apache.hbase.thirdparty.org.eclipse.jetty.server.handler.gzip.GzipHandler;
Expand Down Expand Up @@ -153,6 +154,7 @@ public class HttpServer implements FilterContainer {
public static final String SPNEGO_PROXYUSER_FILTER = "SpnegoProxyUserFilter";
public static final String NO_CACHE_FILTER = "NoCacheFilter";
public static final String APP_DIR = "webapps";
public static final String HTTP_UI_SHOW_STACKTRACE_KEY = "hbase.ui.show-stack-traces";

public static final String METRIC_SERVLETS_CONF_KEY = "hbase.http.metrics.servlets";
public static final String[] METRICS_SERVLETS_DEFAULT = { "jmx", "metrics", "prometheus" };
Expand Down Expand Up @@ -652,6 +654,14 @@ private void initializeWebServer(String name, String hostName, Configuration con
addFilterPathMapping(path, webAppContext);
}
}
// Check if disable stack trace property is configured
if (!conf.getBoolean(HTTP_UI_SHOW_STACKTRACE_KEY, true)) {
// Disable stack traces for server errors in UI
webServer.setErrorHandler(new ErrorHandler());
webServer.getErrorHandler().setShowStacks(false);
// Disable stack traces for web app errors in UI
webAppContext.getErrorHandler().setShowStacks(false);
}
}

private void addManagedListener(ServerConnector connector) {
Expand Down
9 changes: 9 additions & 0 deletions src/main/asciidoc/_chapters/security.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,15 @@ Users who wish to change this would set the following in their hbase-site.xml:
</property>
----

To disable showing stack traces in HBase UI for hiding sensitive information, set the following in hbase-site:
[source,xml]
----
<property>
<name>hbase.ui.show-stack-traces</name>
<value>false</value>
</property>
----

[[hbase.secure.configuration]]
== Secure Client Access to Apache HBase

Expand Down