HttpAuthentication.apt.vm 4.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. ~~ Licensed under the Apache License, Version 2.0 (the "License");
  2. ~~ you may not use this file except in compliance with the License.
  3. ~~ You may obtain a copy of the License at
  4. ~~
  5. ~~ http://www.apache.org/licenses/LICENSE-2.0
  6. ~~
  7. ~~ Unless required by applicable law or agreed to in writing, software
  8. ~~ distributed under the License is distributed on an "AS IS" BASIS,
  9. ~~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. ~~ See the License for the specific language governing permissions and
  11. ~~ limitations under the License. See accompanying LICENSE file.
  12. ---
  13. Authentication for Hadoop HTTP web-consoles
  14. ---
  15. ---
  16. ${maven.build.timestamp}
  17. Authentication for Hadoop HTTP web-consoles
  18. %{toc|section=1|fromDepth=0}
  19. * Introduction
  20. This document describes how to configure Hadoop HTTP web-consoles to
  21. require user authentication.
  22. By default Hadoop HTTP web-consoles (JobTracker, NameNode, TaskTrackers
  23. and DataNodes) allow access without any form of authentication.
  24. Similarly to Hadoop RPC, Hadoop HTTP web-consoles can be configured to
  25. require Kerberos authentication using HTTP SPNEGO protocol (supported
  26. by browsers like Firefox and Internet Explorer).
  27. In addition, Hadoop HTTP web-consoles support the equivalent of
  28. Hadoop's Pseudo/Simple authentication. If this option is enabled, user
  29. must specify their user name in the first browser interaction using the
  30. user.name query string parameter. For example:
  31. <<<http://localhost:50030/jobtracker.jsp?user.name=babu>>>.
  32. If a custom authentication mechanism is required for the HTTP
  33. web-consoles, it is possible to implement a plugin to support the
  34. alternate authentication mechanism (refer to Hadoop hadoop-auth for details
  35. on writing an <<<AuthenticatorHandler>>>).
  36. The next section describes how to configure Hadoop HTTP web-consoles to
  37. require user authentication.
  38. * Configuration
  39. The following properties should be in the <<<core-site.xml>>> of all the
  40. nodes in the cluster.
  41. <<<hadoop.http.filter.initializers>>>: add to this property the
  42. <<<org.apache.hadoop.security.AuthenticationFilterInitializer>>> initializer
  43. class.
  44. <<<hadoop.http.authentication.type>>>: Defines authentication used for the
  45. HTTP web-consoles. The supported values are: <<<simple>>> | <<<kerberos>>> |
  46. <<<#AUTHENTICATION_HANDLER_CLASSNAME#>>>. The dfeault value is <<<simple>>>.
  47. <<<hadoop.http.authentication.token.validity>>>: Indicates how long (in
  48. seconds) an authentication token is valid before it has to be renewed.
  49. The default value is <<<36000>>>.
  50. <<<hadoop.http.authentication.signature.secret.file>>>: The signature secret
  51. file for signing the authentication tokens. The same secret should be used
  52. for all nodes in the cluster, JobTracker, NameNode, DataNode and TastTracker.
  53. The default value is <<<${user.home}/hadoop-http-auth-signature-secret>>>.
  54. IMPORTANT: This file should be readable only by the Unix user running the
  55. daemons.
  56. <<<hadoop.http.authentication.cookie.domain>>>: The domain to use for the
  57. HTTP cookie that stores the authentication token. In order to
  58. authentiation to work correctly across all nodes in the cluster the
  59. domain must be correctly set. There is no default value, the HTTP
  60. cookie will not have a domain working only with the hostname issuing
  61. the HTTP cookie.
  62. IMPORTANT: when using IP addresses, browsers ignore cookies with domain
  63. settings. For this setting to work properly all nodes in the cluster
  64. must be configured to generate URLs with <<<hostname.domain>>> names on it.
  65. <<<hadoop.http.authentication.simple.anonymous.allowed>>>: Indicates if
  66. anonymous requests are allowed when using 'simple' authentication. The
  67. default value is <<<true>>>
  68. <<<hadoop.http.authentication.kerberos.principal>>>: Indicates the Kerberos
  69. principal to be used for HTTP endpoint when using 'kerberos'
  70. authentication. The principal short name must be <<<HTTP>>> per Kerberos HTTP
  71. SPNEGO specification. The default value is <<<HTTP/_HOST@$LOCALHOST>>>,
  72. where <<<_HOST>>> -if present- is replaced with bind address of the HTTP
  73. server.
  74. <<<hadoop.http.authentication.kerberos.keytab>>>: Location of the keytab file
  75. with the credentials for the Kerberos principal used for the HTTP
  76. endpoint. The default value is <<<${user.home}/hadoop.keytab>>>.i