SecureMode.apt.vm 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656
  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. Hadoop in Secure Mode
  14. ---
  15. ---
  16. ${maven.build.timestamp}
  17. %{toc|section=0|fromDepth=0|toDepth=3}
  18. Hadoop in Secure Mode
  19. * Introduction
  20. This document describes how to configure authentication for Hadoop in
  21. secure mode.
  22. By default Hadoop runs in non-secure mode in which no actual
  23. authentication is required.
  24. By configuring Hadoop runs in secure mode,
  25. each user and service needs to be authenticated by Kerberos
  26. in order to use Hadoop services.
  27. Security features of Hadoop consist of
  28. {{{Authentication}authentication}},
  29. {{{./ServiceLevelAuth.html}service level authorization}},
  30. {{{./HttpAuthentication.html}authentication for Web consoles}}
  31. and {{{Data confidentiality}data confidenciality}}.
  32. * Authentication
  33. ** End User Accounts
  34. When service level authentication is turned on,
  35. end users using Hadoop in secure mode needs to be authenticated by Kerberos.
  36. The simplest way to do authentication is using <<<kinit>>> command of Kerberos.
  37. ** User Accounts for Hadoop Daemons
  38. Ensure that HDFS and YARN daemons run as different Unix users,
  39. e.g. <<<hdfs>>> and <<<yarn>>>.
  40. Also, ensure that the MapReduce JobHistory server runs as
  41. different user such as <<<mapred>>>.
  42. It's recommended to have them share a Unix group, for e.g. <<<hadoop>>>.
  43. See also "{{Mapping from user to group}}" for group management.
  44. *---------------+----------------------------------------------------------------------+
  45. || User:Group || Daemons |
  46. *---------------+----------------------------------------------------------------------+
  47. | hdfs:hadoop | NameNode, Secondary NameNode, JournalNode, DataNode |
  48. *---------------+----------------------------------------------------------------------+
  49. | yarn:hadoop | ResourceManager, NodeManager |
  50. *---------------+----------------------------------------------------------------------+
  51. | mapred:hadoop | MapReduce JobHistory Server |
  52. *---------------+----------------------------------------------------------------------+
  53. ** Kerberos principals for Hadoop Daemons and Users
  54. For running hadoop service daemons in Hadoop in secure mode,
  55. Kerberos principals are required.
  56. Each service reads auhenticate information saved in keytab file with appropriate permission.
  57. HTTP web-consoles should be served by principal different from RPC's one.
  58. Subsections below shows the examples of credentials for Hadoop services.
  59. *** HDFS
  60. The NameNode keytab file, on the NameNode host, should look like the
  61. following:
  62. ----
  63. $ klist -e -k -t /etc/security/keytab/nn.service.keytab
  64. Keytab name: FILE:/etc/security/keytab/nn.service.keytab
  65. KVNO Timestamp Principal
  66. 4 07/18/11 21:08:09 nn/full.qualified.domain.name@REALM.TLD (AES-256 CTS mode with 96-bit SHA-1 HMAC)
  67. 4 07/18/11 21:08:09 nn/full.qualified.domain.name@REALM.TLD (AES-128 CTS mode with 96-bit SHA-1 HMAC)
  68. 4 07/18/11 21:08:09 nn/full.qualified.domain.name@REALM.TLD (ArcFour with HMAC/md5)
  69. 4 07/18/11 21:08:09 host/full.qualified.domain.name@REALM.TLD (AES-256 CTS mode with 96-bit SHA-1 HMAC)
  70. 4 07/18/11 21:08:09 host/full.qualified.domain.name@REALM.TLD (AES-128 CTS mode with 96-bit SHA-1 HMAC)
  71. 4 07/18/11 21:08:09 host/full.qualified.domain.name@REALM.TLD (ArcFour with HMAC/md5)
  72. ----
  73. The Secondary NameNode keytab file, on that host, should look like the
  74. following:
  75. ----
  76. $ klist -e -k -t /etc/security/keytab/sn.service.keytab
  77. Keytab name: FILE:/etc/security/keytab/sn.service.keytab
  78. KVNO Timestamp Principal
  79. 4 07/18/11 21:08:09 sn/full.qualified.domain.name@REALM.TLD (AES-256 CTS mode with 96-bit SHA-1 HMAC)
  80. 4 07/18/11 21:08:09 sn/full.qualified.domain.name@REALM.TLD (AES-128 CTS mode with 96-bit SHA-1 HMAC)
  81. 4 07/18/11 21:08:09 sn/full.qualified.domain.name@REALM.TLD (ArcFour with HMAC/md5)
  82. 4 07/18/11 21:08:09 host/full.qualified.domain.name@REALM.TLD (AES-256 CTS mode with 96-bit SHA-1 HMAC)
  83. 4 07/18/11 21:08:09 host/full.qualified.domain.name@REALM.TLD (AES-128 CTS mode with 96-bit SHA-1 HMAC)
  84. 4 07/18/11 21:08:09 host/full.qualified.domain.name@REALM.TLD (ArcFour with HMAC/md5)
  85. ----
  86. The DataNode keytab file, on each host, should look like the following:
  87. ----
  88. $ klist -e -k -t /etc/security/keytab/dn.service.keytab
  89. Keytab name: FILE:/etc/security/keytab/dn.service.keytab
  90. KVNO Timestamp Principal
  91. 4 07/18/11 21:08:09 dn/full.qualified.domain.name@REALM.TLD (AES-256 CTS mode with 96-bit SHA-1 HMAC)
  92. 4 07/18/11 21:08:09 dn/full.qualified.domain.name@REALM.TLD (AES-128 CTS mode with 96-bit SHA-1 HMAC)
  93. 4 07/18/11 21:08:09 dn/full.qualified.domain.name@REALM.TLD (ArcFour with HMAC/md5)
  94. 4 07/18/11 21:08:09 host/full.qualified.domain.name@REALM.TLD (AES-256 CTS mode with 96-bit SHA-1 HMAC)
  95. 4 07/18/11 21:08:09 host/full.qualified.domain.name@REALM.TLD (AES-128 CTS mode with 96-bit SHA-1 HMAC)
  96. 4 07/18/11 21:08:09 host/full.qualified.domain.name@REALM.TLD (ArcFour with HMAC/md5)
  97. ----
  98. *** YARN
  99. The ResourceManager keytab file, on the ResourceManager host, should look
  100. like the following:
  101. ----
  102. $ klist -e -k -t /etc/security/keytab/rm.service.keytab
  103. Keytab name: FILE:/etc/security/keytab/rm.service.keytab
  104. KVNO Timestamp Principal
  105. 4 07/18/11 21:08:09 rm/full.qualified.domain.name@REALM.TLD (AES-256 CTS mode with 96-bit SHA-1 HMAC)
  106. 4 07/18/11 21:08:09 rm/full.qualified.domain.name@REALM.TLD (AES-128 CTS mode with 96-bit SHA-1 HMAC)
  107. 4 07/18/11 21:08:09 rm/full.qualified.domain.name@REALM.TLD (ArcFour with HMAC/md5)
  108. 4 07/18/11 21:08:09 host/full.qualified.domain.name@REALM.TLD (AES-256 CTS mode with 96-bit SHA-1 HMAC)
  109. 4 07/18/11 21:08:09 host/full.qualified.domain.name@REALM.TLD (AES-128 CTS mode with 96-bit SHA-1 HMAC)
  110. 4 07/18/11 21:08:09 host/full.qualified.domain.name@REALM.TLD (ArcFour with HMAC/md5)
  111. ----
  112. The NodeManager keytab file, on each host, should look like the following:
  113. ----
  114. $ klist -e -k -t /etc/security/keytab/nm.service.keytab
  115. Keytab name: FILE:/etc/security/keytab/nm.service.keytab
  116. KVNO Timestamp Principal
  117. 4 07/18/11 21:08:09 nm/full.qualified.domain.name@REALM.TLD (AES-256 CTS mode with 96-bit SHA-1 HMAC)
  118. 4 07/18/11 21:08:09 nm/full.qualified.domain.name@REALM.TLD (AES-128 CTS mode with 96-bit SHA-1 HMAC)
  119. 4 07/18/11 21:08:09 nm/full.qualified.domain.name@REALM.TLD (ArcFour with HMAC/md5)
  120. 4 07/18/11 21:08:09 host/full.qualified.domain.name@REALM.TLD (AES-256 CTS mode with 96-bit SHA-1 HMAC)
  121. 4 07/18/11 21:08:09 host/full.qualified.domain.name@REALM.TLD (AES-128 CTS mode with 96-bit SHA-1 HMAC)
  122. 4 07/18/11 21:08:09 host/full.qualified.domain.name@REALM.TLD (ArcFour with HMAC/md5)
  123. ----
  124. *** MapReduce JobHistory Server
  125. The MapReduce JobHistory Server keytab file, on that host, should look
  126. like the following:
  127. ----
  128. $ klist -e -k -t /etc/security/keytab/jhs.service.keytab
  129. Keytab name: FILE:/etc/security/keytab/jhs.service.keytab
  130. KVNO Timestamp Principal
  131. 4 07/18/11 21:08:09 jhs/full.qualified.domain.name@REALM.TLD (AES-256 CTS mode with 96-bit SHA-1 HMAC)
  132. 4 07/18/11 21:08:09 jhs/full.qualified.domain.name@REALM.TLD (AES-128 CTS mode with 96-bit SHA-1 HMAC)
  133. 4 07/18/11 21:08:09 jhs/full.qualified.domain.name@REALM.TLD (ArcFour with HMAC/md5)
  134. 4 07/18/11 21:08:09 host/full.qualified.domain.name@REALM.TLD (AES-256 CTS mode with 96-bit SHA-1 HMAC)
  135. 4 07/18/11 21:08:09 host/full.qualified.domain.name@REALM.TLD (AES-128 CTS mode with 96-bit SHA-1 HMAC)
  136. 4 07/18/11 21:08:09 host/full.qualified.domain.name@REALM.TLD (ArcFour with HMAC/md5)
  137. ----
  138. ** Mapping from Kerberos principal to OS user account
  139. Hadoop maps Kerberos principal to OS user account using
  140. the rule specified by <<<hadoop.security.auth_to_local>>>
  141. which works in the same way as the <<<auth_to_local>>> in
  142. {{{http://web.mit.edu/Kerberos/krb5-latest/doc/admin/conf_files/krb5_conf.html}Kerberos configuration file (krb5.conf)}}.
  143. In addition, Hadoop <<<auth_to_local>>> mapping supports the <</L>> flag that
  144. lowercases the returned name.
  145. By default, it picks the first component of principal name as a user name
  146. if the realms matches to the <<<default_realm>>> (usually defined in /etc/krb5.conf).
  147. For example, <<<host/full.qualified.domain.name@REALM.TLD>>> is mapped to <<<host>>>
  148. by default rule.
  149. ** Mapping from user to group
  150. Though files on HDFS are associated to owner and group,
  151. Hadoop does not have the definition of group by itself.
  152. Mapping from user to group is done by OS or LDAP.
  153. You can change a way of mapping by
  154. specifying the name of mapping provider as a value of
  155. <<<hadoop.security.group.mapping>>>
  156. See {{{../hadoop-hdfs/HdfsPermissionsGuide.html}HDFS Permissions Guide}} for details.
  157. Practically you need to manage SSO environment using Kerberos with LDAP
  158. for Hadoop in secure mode.
  159. ** Proxy user
  160. Some products such as Apache Oozie which access the services of Hadoop
  161. on behalf of end users need to be able to impersonate end users.
  162. You can configure proxy user using properties
  163. <<<hadoop.proxyuser.${superuser}.hosts>>> along with either or both of
  164. <<<hadoop.proxyuser.${superuser}.groups>>>
  165. and <<<hadoop.proxyuser.${superuser}.users>>>.
  166. For example, by specifying as below in core-site.xml,
  167. user named <<<oozie>>> accessing from any host
  168. can impersonate any user belonging to any group.
  169. ----
  170. <property>
  171. <name>hadoop.proxyuser.oozie.hosts</name>
  172. <value>*</value>
  173. </property>
  174. <property>
  175. <name>hadoop.proxyuser.oozie.groups</name>
  176. <value>*</value>
  177. </property>
  178. ----
  179. User named <<<oozie>>> accessing from any host
  180. can impersonate user1 and user2 by specifying as below in core-site.xml.
  181. ----
  182. <property>
  183. <name>hadoop.proxyuser.oozie.hosts</name>
  184. <value>*</value>
  185. </property>
  186. <property>
  187. <name>hadoop.proxyuser.oozie.users</name>
  188. <value>user1,user2</value>
  189. </property>
  190. ----
  191. ** Secure DataNode
  192. Because the data transfer protocol of DataNode
  193. does not use the RPC framework of Hadoop,
  194. DataNode must authenticate itself by
  195. using privileged ports which are specified by
  196. <<<dfs.datanode.address>>> and <<<dfs.datanode.http.address>>>.
  197. This authentication is based on the assumption
  198. that the attacker won't be able to get root privileges.
  199. When you execute <<<hdfs datanode>>> command as root,
  200. server process binds privileged port at first,
  201. then drops privilege and runs as the user account specified by
  202. <<<HADOOP_SECURE_DN_USER>>>.
  203. This startup process uses jsvc installed to <<<JSVC_HOME>>>.
  204. You must specify <<<HADOOP_SECURE_DN_USER>>> and <<<JSVC_HOME>>>
  205. as environment variables on start up (in hadoop-env.sh).
  206. * Data confidentiality
  207. ** Data Encryption on RPC
  208. The data transfered between hadoop services and clients.
  209. Setting <<<hadoop.rpc.protection>>> to <<<"privacy">>> in the core-site.xml
  210. activate data encryption.
  211. ** Data Encryption on Block data transfer.
  212. You need to set <<<dfs.encrypt.data.transfer>>> to <<<"true">>> in the hdfs-site.xml
  213. in order to activate data encryption for data transfer protocol of DataNode.
  214. ** Data Encryption on HTTP
  215. Data transfer between Web-console and clients are protected by using SSL(HTTPS).
  216. * Configuration
  217. ** Permissions for both HDFS and local fileSystem paths
  218. The following table lists various paths on HDFS and local filesystems (on
  219. all nodes) and recommended permissions:
  220. *-------------------+-------------------+------------------+------------------+
  221. || Filesystem || Path || User:Group || Permissions |
  222. *-------------------+-------------------+------------------+------------------+
  223. | local | <<<dfs.namenode.name.dir>>> | hdfs:hadoop | drwx------ |
  224. *-------------------+-------------------+------------------+------------------+
  225. | local | <<<dfs.datanode.data.dir>>> | hdfs:hadoop | drwx------ |
  226. *-------------------+-------------------+------------------+------------------+
  227. | local | $HADOOP_LOG_DIR | hdfs:hadoop | drwxrwxr-x |
  228. *-------------------+-------------------+------------------+------------------+
  229. | local | $YARN_LOG_DIR | yarn:hadoop | drwxrwxr-x |
  230. *-------------------+-------------------+------------------+------------------+
  231. | local | <<<yarn.nodemanager.local-dirs>>> | yarn:hadoop | drwxr-xr-x |
  232. *-------------------+-------------------+------------------+------------------+
  233. | local | <<<yarn.nodemanager.log-dirs>>> | yarn:hadoop | drwxr-xr-x |
  234. *-------------------+-------------------+------------------+------------------+
  235. | local | container-executor | root:hadoop | --Sr-s--- |
  236. *-------------------+-------------------+------------------+------------------+
  237. | local | <<<conf/container-executor.cfg>>> | root:hadoop | r-------- |
  238. *-------------------+-------------------+------------------+------------------+
  239. | hdfs | / | hdfs:hadoop | drwxr-xr-x |
  240. *-------------------+-------------------+------------------+------------------+
  241. | hdfs | /tmp | hdfs:hadoop | drwxrwxrwxt |
  242. *-------------------+-------------------+------------------+------------------+
  243. | hdfs | /user | hdfs:hadoop | drwxr-xr-x |
  244. *-------------------+-------------------+------------------+------------------+
  245. | hdfs | <<<yarn.nodemanager.remote-app-log-dir>>> | yarn:hadoop | drwxrwxrwxt |
  246. *-------------------+-------------------+------------------+------------------+
  247. | hdfs | <<<mapreduce.jobhistory.intermediate-done-dir>>> | mapred:hadoop | |
  248. | | | | drwxrwxrwxt |
  249. *-------------------+-------------------+------------------+------------------+
  250. | hdfs | <<<mapreduce.jobhistory.done-dir>>> | mapred:hadoop | |
  251. | | | | drwxr-x--- |
  252. *-------------------+-------------------+------------------+------------------+
  253. ** Common Configurations
  254. In order to turn on RPC authentication in hadoop,
  255. set the value of <<<hadoop.security.authentication>>> property to
  256. <<<"kerberos">>>, and set security related settings listed below appropriately.
  257. The following properties should be in the <<<core-site.xml>>> of all the
  258. nodes in the cluster.
  259. *-------------------------+-------------------------+------------------------+
  260. || Parameter || Value || Notes |
  261. *-------------------------+-------------------------+------------------------+
  262. | <<<hadoop.security.authentication>>> | <kerberos> | |
  263. | | | <<<simple>>> : No authentication. (default) \
  264. | | | <<<kerberos>>> : Enable authentication by Kerberos. |
  265. *-------------------------+-------------------------+------------------------+
  266. | <<<hadoop.security.authorization>>> | <true> | |
  267. | | | Enable {{{./ServiceLevelAuth.html}RPC service-level authorization}}. |
  268. *-------------------------+-------------------------+------------------------+
  269. | <<<hadoop.rpc.protection>>> | <authentication> |
  270. | | | <authentication> : authentication only (default) \
  271. | | | <integrity> : integrity check in addition to authentication \
  272. | | | <privacy> : data encryption in addition to integrity |
  273. *-------------------------+-------------------------+------------------------+
  274. | <<<hadoop.security.auth_to_local>>> | | |
  275. | | <<<RULE:>>><exp1>\
  276. | | <<<RULE:>>><exp2>\
  277. | | <...>\
  278. | | DEFAULT |
  279. | | | The value is string containing new line characters.
  280. | | | See
  281. | | | {{{http://web.mit.edu/Kerberos/krb5-latest/doc/admin/conf_files/krb5_conf.html}Kerberos documentation}}
  282. | | | for format for <exp>.
  283. *-------------------------+-------------------------+------------------------+
  284. | <<<hadoop.proxyuser.>>><superuser><<<.hosts>>> | | |
  285. | | | comma separated hosts from which <superuser> access are allowd to impersonation. |
  286. | | | <<<*>>> means wildcard. |
  287. *-------------------------+-------------------------+------------------------+
  288. | <<<hadoop.proxyuser.>>><superuser><<<.groups>>> | | |
  289. | | | comma separated groups to which users impersonated by <superuser> belongs. |
  290. | | | <<<*>>> means wildcard. |
  291. *-------------------------+-------------------------+------------------------+
  292. Configuration for <<<conf/core-site.xml>>>
  293. ** NameNode
  294. *-------------------------+-------------------------+------------------------+
  295. || Parameter || Value || Notes |
  296. *-------------------------+-------------------------+------------------------+
  297. | <<<dfs.block.access.token.enable>>> | <true> | |
  298. | | | Enable HDFS block access tokens for secure operations. |
  299. *-------------------------+-------------------------+------------------------+
  300. | <<<dfs.https.enable>>> | <true> | |
  301. | | | This value is deprecated. Use dfs.http.policy |
  302. *-------------------------+-------------------------+------------------------+
  303. | <<<dfs.http.policy>>> | <HTTP_ONLY> or <HTTPS_ONLY> or <HTTP_AND_HTTPS> | |
  304. | | | HTTPS_ONLY turns off http access. This option takes precedence over |
  305. | | | the deprecated configuration dfs.https.enable and hadoop.ssl.enabled. |
  306. *-------------------------+-------------------------+------------------------+
  307. | <<<dfs.namenode.https-address>>> | <nn_host_fqdn:50470> | |
  308. *-------------------------+-------------------------+------------------------+
  309. | <<<dfs.https.port>>> | <50470> | |
  310. *-------------------------+-------------------------+------------------------+
  311. | <<<dfs.namenode.keytab.file>>> | </etc/security/keytab/nn.service.keytab> | |
  312. | | | Kerberos keytab file for the NameNode. |
  313. *-------------------------+-------------------------+------------------------+
  314. | <<<dfs.namenode.kerberos.principal>>> | nn/_HOST@REALM.TLD | |
  315. | | | Kerberos principal name for the NameNode. |
  316. *-------------------------+-------------------------+------------------------+
  317. | <<<dfs.namenode.kerberos.https.principal>>> | host/_HOST@REALM.TLD | |
  318. | | | HTTPS Kerberos principal name for the NameNode. |
  319. *-------------------------+-------------------------+------------------------+
  320. Configuration for <<<conf/hdfs-site.xml>>>
  321. ** Secondary NameNode
  322. *-------------------------+-------------------------+------------------------+
  323. || Parameter || Value || Notes |
  324. *-------------------------+-------------------------+------------------------+
  325. | <<<dfs.namenode.secondary.http-address>>> | <c_nn_host_fqdn:50090> | |
  326. *-------------------------+-------------------------+------------------------+
  327. | <<<dfs.namenode.secondary.https-port>>> | <50470> | |
  328. *-------------------------+-------------------------+------------------------+
  329. | <<<dfs.namenode.secondary.keytab.file>>> | | |
  330. | | </etc/security/keytab/sn.service.keytab> | |
  331. | | | Kerberos keytab file for the NameNode. |
  332. *-------------------------+-------------------------+------------------------+
  333. | <<<dfs.namenode.secondary.kerberos.principal>>> | sn/_HOST@REALM.TLD | |
  334. | | | Kerberos principal name for the Secondary NameNode. |
  335. *-------------------------+-------------------------+------------------------+
  336. | <<<dfs.namenode.secondary.kerberos.https.principal>>> | | |
  337. | | host/_HOST@REALM.TLD | |
  338. | | | HTTPS Kerberos principal name for the Secondary NameNode. |
  339. *-------------------------+-------------------------+------------------------+
  340. Configuration for <<<conf/hdfs-site.xml>>>
  341. ** DataNode
  342. *-------------------------+-------------------------+------------------------+
  343. || Parameter || Value || Notes |
  344. *-------------------------+-------------------------+------------------------+
  345. | <<<dfs.datanode.data.dir.perm>>> | 700 | |
  346. *-------------------------+-------------------------+------------------------+
  347. | <<<dfs.datanode.address>>> | <0.0.0.0:1004> | |
  348. | | | Secure DataNode must use privileged port |
  349. | | | in order to assure that the server was started securely. |
  350. | | | This means that the server must be started via jsvc. |
  351. *-------------------------+-------------------------+------------------------+
  352. | <<<dfs.datanode.http.address>>> | <0.0.0.0:1006> | |
  353. | | | Secure DataNode must use privileged port |
  354. | | | in order to assure that the server was started securely. |
  355. | | | This means that the server must be started via jsvc. |
  356. *-------------------------+-------------------------+------------------------+
  357. | <<<dfs.datanode.https.address>>> | <0.0.0.0:50470> | |
  358. *-------------------------+-------------------------+------------------------+
  359. | <<<dfs.datanode.keytab.file>>> | </etc/security/keytab/dn.service.keytab> | |
  360. | | | Kerberos keytab file for the DataNode. |
  361. *-------------------------+-------------------------+------------------------+
  362. | <<<dfs.datanode.kerberos.principal>>> | dn/_HOST@REALM.TLD | |
  363. | | | Kerberos principal name for the DataNode. |
  364. *-------------------------+-------------------------+------------------------+
  365. | <<<dfs.datanode.kerberos.https.principal>>> | | |
  366. | | host/_HOST@REALM.TLD | |
  367. | | | HTTPS Kerberos principal name for the DataNode. |
  368. *-------------------------+-------------------------+------------------------+
  369. | <<<dfs.encrypt.data.transfer>>> | <false> | |
  370. | | | set to <<<true>>> when using data encryption |
  371. *-------------------------+-------------------------+------------------------+
  372. Configuration for <<<conf/hdfs-site.xml>>>
  373. ** WebHDFS
  374. *-------------------------+-------------------------+------------------------+
  375. || Parameter || Value || Notes |
  376. *-------------------------+-------------------------+------------------------+
  377. | <<<dfs.webhdfs.enabled>>> | http/_HOST@REALM.TLD | |
  378. | | | Enable security on WebHDFS. |
  379. *-------------------------+-------------------------+------------------------+
  380. | <<<dfs.web.authentication.kerberos.principal>>> | http/_HOST@REALM.TLD | |
  381. | | | Kerberos keytab file for the WebHDFS. |
  382. *-------------------------+-------------------------+------------------------+
  383. | <<<dfs.web.authentication.kerberos.keytab>>> | </etc/security/keytab/http.service.keytab> | |
  384. | | | Kerberos principal name for WebHDFS. |
  385. *-------------------------+-------------------------+------------------------+
  386. Configuration for <<<conf/hdfs-site.xml>>>
  387. ** ResourceManager
  388. *-------------------------+-------------------------+------------------------+
  389. || Parameter || Value || Notes |
  390. *-------------------------+-------------------------+------------------------+
  391. | <<<yarn.resourcemanager.keytab>>> | | |
  392. | | </etc/security/keytab/rm.service.keytab> | |
  393. | | | Kerberos keytab file for the ResourceManager. |
  394. *-------------------------+-------------------------+------------------------+
  395. | <<<yarn.resourcemanager.principal>>> | rm/_HOST@REALM.TLD | |
  396. | | | Kerberos principal name for the ResourceManager. |
  397. *-------------------------+-------------------------+------------------------+
  398. Configuration for <<<conf/yarn-site.xml>>>
  399. ** NodeManager
  400. *-------------------------+-------------------------+------------------------+
  401. || Parameter || Value || Notes |
  402. *-------------------------+-------------------------+------------------------+
  403. | <<<yarn.nodemanager.keytab>>> | </etc/security/keytab/nm.service.keytab> | |
  404. | | | Kerberos keytab file for the NodeManager. |
  405. *-------------------------+-------------------------+------------------------+
  406. | <<<yarn.nodemanager.principal>>> | nm/_HOST@REALM.TLD | |
  407. | | | Kerberos principal name for the NodeManager. |
  408. *-------------------------+-------------------------+------------------------+
  409. | <<<yarn.nodemanager.container-executor.class>>> | | |
  410. | | <<<org.apache.hadoop.yarn.server.nodemanager.LinuxContainerExecutor>>> |
  411. | | | Use LinuxContainerExecutor. |
  412. *-------------------------+-------------------------+------------------------+
  413. | <<<yarn.nodemanager.linux-container-executor.group>>> | <hadoop> | |
  414. | | | Unix group of the NodeManager. |
  415. *-------------------------+-------------------------+------------------------+
  416. | <<<yarn.nodemanager.linux-container-executor.path>>> | </path/to/bin/container-executor> | |
  417. | | | The path to the executable of Linux container executor. |
  418. *-------------------------+-------------------------+------------------------+
  419. Configuration for <<<conf/yarn-site.xml>>>
  420. ** Configuration for WebAppProxy
  421. The <<<WebAppProxy>>> provides a proxy between the web applications
  422. exported by an application and an end user. If security is enabled
  423. it will warn users before accessing a potentially unsafe web application.
  424. Authentication and authorization using the proxy is handled just like
  425. any other privileged web application.
  426. *-------------------------+-------------------------+------------------------+
  427. || Parameter || Value || Notes |
  428. *-------------------------+-------------------------+------------------------+
  429. | <<<yarn.web-proxy.address>>> | | |
  430. | | <<<WebAppProxy>>> host:port for proxy to AM web apps. | |
  431. | | | <host:port> if this is the same as <<<yarn.resourcemanager.webapp.address>>>|
  432. | | | or it is not defined then the <<<ResourceManager>>> will run the proxy|
  433. | | | otherwise a standalone proxy server will need to be launched.|
  434. *-------------------------+-------------------------+------------------------+
  435. | <<<yarn.web-proxy.keytab>>> | | |
  436. | | </etc/security/keytab/web-app.service.keytab> | |
  437. | | | Kerberos keytab file for the WebAppProxy. |
  438. *-------------------------+-------------------------+------------------------+
  439. | <<<yarn.web-proxy.principal>>> | wap/_HOST@REALM.TLD | |
  440. | | | Kerberos principal name for the WebAppProxy. |
  441. *-------------------------+-------------------------+------------------------+
  442. Configuration for <<<conf/yarn-site.xml>>>
  443. ** LinuxContainerExecutor
  444. A <<<ContainerExecutor>>> used by YARN framework which define how any
  445. <container> launched and controlled.
  446. The following are the available in Hadoop YARN:
  447. *--------------------------------------+--------------------------------------+
  448. || ContainerExecutor || Description |
  449. *--------------------------------------+--------------------------------------+
  450. | <<<DefaultContainerExecutor>>> | |
  451. | | The default executor which YARN uses to manage container execution. |
  452. | | The container process has the same Unix user as the NodeManager. |
  453. *--------------------------------------+--------------------------------------+
  454. | <<<LinuxContainerExecutor>>> | |
  455. | | Supported only on GNU/Linux, this executor runs the containers as either the |
  456. | | YARN user who submitted the application (when full security is enabled) or |
  457. | | as a dedicated user (defaults to nobody) when full security is not enabled. |
  458. | | When full security is enabled, this executor requires all user accounts to be |
  459. | | created on the cluster nodes where the containers are launched. It uses |
  460. | | a <setuid> executable that is included in the Hadoop distribution. |
  461. | | The NodeManager uses this executable to launch and kill containers. |
  462. | | The setuid executable switches to the user who has submitted the |
  463. | | application and launches or kills the containers. For maximum security, |
  464. | | this executor sets up restricted permissions and user/group ownership of |
  465. | | local files and directories used by the containers such as the shared |
  466. | | objects, jars, intermediate files, log files etc. Particularly note that, |
  467. | | because of this, except the application owner and NodeManager, no other |
  468. | | user can access any of the local files/directories including those |
  469. | | localized as part of the distributed cache. |
  470. *--------------------------------------+--------------------------------------+
  471. To build the LinuxContainerExecutor executable run:
  472. ----
  473. $ mvn package -Dcontainer-executor.conf.dir=/etc/hadoop/
  474. ----
  475. The path passed in <<<-Dcontainer-executor.conf.dir>>> should be the
  476. path on the cluster nodes where a configuration file for the setuid
  477. executable should be located. The executable should be installed in
  478. $HADOOP_YARN_HOME/bin.
  479. The executable must have specific permissions: 6050 or --Sr-s---
  480. permissions user-owned by <root> (super-user) and group-owned by a
  481. special group (e.g. <<<hadoop>>>) of which the NodeManager Unix user is
  482. the group member and no ordinary application user is. If any application
  483. user belongs to this special group, security will be compromised. This
  484. special group name should be specified for the configuration property
  485. <<<yarn.nodemanager.linux-container-executor.group>>> in both
  486. <<<conf/yarn-site.xml>>> and <<<conf/container-executor.cfg>>>.
  487. For example, let's say that the NodeManager is run as user <yarn> who is
  488. part of the groups users and <hadoop>, any of them being the primary group.
  489. Let also be that <users> has both <yarn> and another user
  490. (application submitter) <alice> as its members, and <alice> does not
  491. belong to <hadoop>. Going by the above description, the setuid/setgid
  492. executable should be set 6050 or --Sr-s--- with user-owner as <yarn> and
  493. group-owner as <hadoop> which has <yarn> as its member (and not <users>
  494. which has <alice> also as its member besides <yarn>).
  495. The LinuxTaskController requires that paths including and leading up to
  496. the directories specified in <<<yarn.nodemanager.local-dirs>>> and
  497. <<<yarn.nodemanager.log-dirs>>> to be set 755 permissions as described
  498. above in the table on permissions on directories.
  499. * <<<conf/container-executor.cfg>>>
  500. The executable requires a configuration file called
  501. <<<container-executor.cfg>>> to be present in the configuration
  502. directory passed to the mvn target mentioned above.
  503. The configuration file must be owned by the user running NodeManager
  504. (user <<<yarn>>> in the above example), group-owned by anyone and
  505. should have the permissions 0400 or r--------.
  506. The executable requires following configuration items to be present
  507. in the <<<conf/container-executor.cfg>>> file. The items should be
  508. mentioned as simple key=value pairs, one per-line:
  509. *-------------------------+-------------------------+------------------------+
  510. || Parameter || Value || Notes |
  511. *-------------------------+-------------------------+------------------------+
  512. | <<<yarn.nodemanager.linux-container-executor.group>>> | <hadoop> | |
  513. | | | Unix group of the NodeManager. The group owner of the |
  514. | | |<container-executor> binary should be this group. Should be same as the |
  515. | | | value with which the NodeManager is configured. This configuration is |
  516. | | | required for validating the secure access of the <container-executor> |
  517. | | | binary. |
  518. *-------------------------+-------------------------+------------------------+
  519. | <<<banned.users>>> | hfds,yarn,mapred,bin | Banned users. |
  520. *-------------------------+-------------------------+------------------------+
  521. | <<<allowed.system.users>>> | foo,bar | Allowed system users. |
  522. *-------------------------+-------------------------+------------------------+
  523. | <<<min.user.id>>> | 1000 | Prevent other super-users. |
  524. *-------------------------+-------------------------+------------------------+
  525. Configuration for <<<conf/yarn-site.xml>>>
  526. To re-cap, here are the local file-sysytem permissions required for the
  527. various paths related to the <<<LinuxContainerExecutor>>>:
  528. *-------------------+-------------------+------------------+------------------+
  529. || Filesystem || Path || User:Group || Permissions |
  530. *-------------------+-------------------+------------------+------------------+
  531. | local | container-executor | root:hadoop | --Sr-s--- |
  532. *-------------------+-------------------+------------------+------------------+
  533. | local | <<<conf/container-executor.cfg>>> | root:hadoop | r-------- |
  534. *-------------------+-------------------+------------------+------------------+
  535. | local | <<<yarn.nodemanager.local-dirs>>> | yarn:hadoop | drwxr-xr-x |
  536. *-------------------+-------------------+------------------+------------------+
  537. | local | <<<yarn.nodemanager.log-dirs>>> | yarn:hadoop | drwxr-xr-x |
  538. *-------------------+-------------------+------------------+------------------+
  539. ** MapReduce JobHistory Server
  540. *-------------------------+-------------------------+------------------------+
  541. || Parameter || Value || Notes |
  542. *-------------------------+-------------------------+------------------------+
  543. | <<<mapreduce.jobhistory.address>>> | | |
  544. | | MapReduce JobHistory Server <host:port> | Default port is 10020. |
  545. *-------------------------+-------------------------+------------------------+
  546. | <<<mapreduce.jobhistory.keytab>>> | |
  547. | | </etc/security/keytab/jhs.service.keytab> | |
  548. | | | Kerberos keytab file for the MapReduce JobHistory Server. |
  549. *-------------------------+-------------------------+------------------------+
  550. | <<<mapreduce.jobhistory.principal>>> | jhs/_HOST@REALM.TLD | |
  551. | | | Kerberos principal name for the MapReduce JobHistory Server. |
  552. *-------------------------+-------------------------+------------------------+
  553. Configuration for <<<conf/mapred-site.xml>>>