security-settings.asciidoc 58 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466
  1. [role="xpack"]
  2. [[security-settings]]
  3. === Security settings in {es}
  4. ++++
  5. <titleabbrev>Security settings</titleabbrev>
  6. ++++
  7. By default, {security} is disabled when you have a basic or trial license. To
  8. enable {security}, use the `xpack.security.enabled` setting.
  9. You configure `xpack.security` settings to
  10. <<anonymous-access-settings, enable anonymous access>>
  11. and perform message authentication,
  12. <<field-document-security-settings, set up document and field level security>>,
  13. <<realm-settings, configure realms>>,
  14. <<ssl-tls-settings, encrypt communications with SSL>>, and
  15. <<auditing-settings, audit security events>>.
  16. All of these settings can be added to the `elasticsearch.yml` configuration file,
  17. with the exception of the secure settings, which you add to the {es} keystore.
  18. For more information about creating and updating the {es} keystore, see
  19. <<secure-settings>>.
  20. [float]
  21. [[general-security-settings]]
  22. ==== General security settings
  23. `xpack.security.enabled`::
  24. Set to `true` to enable {security} on the node. +
  25. +
  26. --
  27. If set to `false`, which is the default value for basic and trial licenses,
  28. {security} is disabled. It also affects all {kib} instances that connect to this
  29. {es} instance; you do not need to disable {security} in those `kibana.yml` files.
  30. For more information about disabling {security} in specific {kib} instances, see {kibana-ref}/security-settings-kb.html[{kib} security settings].
  31. TIP: If you have gold or higher licenses, the default value is `true`; we
  32. recommend that you explicitly add this setting to avoid confusion.
  33. --
  34. `xpack.security.hide_settings`::
  35. A comma-separated list of settings that are omitted from the results of the
  36. <<cluster-nodes-info,cluster nodes info API>>. You can use wildcards to include
  37. multiple settings in the list. For example, the following value hides all the
  38. settings for the ad1 realm: `xpack.security.authc.realms.ad1.*`. The API already
  39. omits all `ssl` settings, `bind_dn`, and `bind_password` due to the
  40. sensitive nature of the information.
  41. `xpack.security.fips_mode.enabled`::
  42. Enables fips mode of operation. Set this to `true` if you run this {es} instance in a FIPS 140-2 enabled JVM. For more information, see <<fips-140-compliance>>. Defaults to `false`.
  43. [float]
  44. [[password-security-settings]]
  45. ==== Default password security settings
  46. `xpack.security.authc.accept_default_password`::
  47. In `elasticsearch.yml`, set this to `false` to disable support for the default "changeme" password.
  48. [float]
  49. [[password-hashing-settings]]
  50. ==== Password hashing settings
  51. `xpack.security.authc.password_hashing.algorithm`::
  52. Specifies the hashing algorithm that is used for secure user credential storage.
  53. See <<password-hashing-algorithms>>. Defaults to `bcrypt`.
  54. [float]
  55. [[anonymous-access-settings]]
  56. ==== Anonymous access settings
  57. You can configure the following anonymous access settings in
  58. `elasticsearch.yml`. For more information, see {xpack-ref}/anonymous-access.html[
  59. Enabling anonymous access].
  60. `xpack.security.authc.anonymous.username`::
  61. The username (principal) of the anonymous user. Defaults to `_es_anonymous_user`.
  62. `xpack.security.authc.anonymous.roles`::
  63. The roles to associate with the anonymous user. Required.
  64. `xpack.security.authc.anonymous.authz_exception`::
  65. When `true`, an HTTP 403 response is returned if the anonymous user
  66. does not have the appropriate permissions for the requested action. The
  67. user is not prompted to provide credentials to access the requested
  68. resource. When set to `false`, an HTTP 401 response is returned and the user
  69. can provide credentials with the appropriate permissions to gain
  70. access. Defaults to `true`.
  71. [float]
  72. [[security-automata-settings]]
  73. ==== Automata Settings
  74. In places where {security} accepts wildcard patterns (e.g. index patterns in
  75. roles, group matches in the role mapping API), each pattern is compiled into
  76. an Automaton. The follow settings are available to control this behaviour.
  77. `xpack.security.automata.max_determinized_states`::
  78. The upper limit on how many automaton states may be created by a single pattern.
  79. This protects against too-difficult (e.g. exponentially hard) patterns.
  80. Defaults to `100,000`.
  81. `xpack.security.automata.cache.enabled`::
  82. Whether to cache the compiled automata. Compiling automata can be CPU intensive
  83. and may slowdown some operations. The cache reduces the frequency with which
  84. automata need to be compiled.
  85. Defaults to `true`.
  86. `xpack.security.automata.cache.size`::
  87. The maximum number of items to retain in the automata cache.
  88. Defaults to `10,000`.
  89. `xpack.security.automata.cache.ttl`::
  90. The length of time to retain in an item in the automata cache (based on most
  91. recent usage).
  92. Defaults to `48h` (48 hours).
  93. [float]
  94. [[field-document-security-settings]]
  95. ==== Document and field level security settings
  96. You can set the following document and field level security
  97. settings in `elasticsearch.yml`. For more information, see
  98. {xpack-ref}/field-and-document-access-control.html[Setting up document and field
  99. level security].
  100. `xpack.security.dls_fls.enabled`::
  101. Set to `false` to prevent document and field level security
  102. from being configured. Defaults to `true`.
  103. [float]
  104. [[token-service-settings]]
  105. ==== Token service settings
  106. You can set the following token service settings in
  107. `elasticsearch.yml`.
  108. `xpack.security.authc.token.enabled`::
  109. Set to `false` to disable the built-in token service. Defaults to `true` unless
  110. `xpack.security.http.ssl.enabled` is `false`. This prevents sniffing the token
  111. from a connection over plain http.
  112. `xpack.security.authc.token.timeout`::
  113. The length of time that a token is valid for. By default this value is `20m` or
  114. 20 minutes. The maximum value is 1 hour.
  115. [float]
  116. [[realm-settings]]
  117. ==== Realm settings
  118. You configure realm settings in the `xpack.security.authc.realms`
  119. namespace in `elasticsearch.yml`. For example:
  120. [source,yaml]
  121. ----------------------------------------
  122. xpack.security.authc.realms:
  123. realm1:
  124. type: native
  125. order: 0
  126. ...
  127. realm2:
  128. type: ldap
  129. order: 1
  130. ...
  131. realm3:
  132. type: active_directory
  133. order: 2
  134. ...
  135. ...
  136. ----------------------------------------
  137. The valid settings vary depending on the realm type. For more
  138. information, see {xpack-ref}/setting-up-authentication.html[Setting up authentication].
  139. [float]
  140. [[ref-realm-settings]]
  141. ===== Settings valid for all realms
  142. `type`::
  143. The type of the realm: `native, `ldap`, `active_directory`, `pki`, or `file`. Required.
  144. `order`::
  145. The priority of the realm within the realm chain. Realms with a lower order are
  146. consulted first. Although not required, use of this setting is strongly
  147. recommended when you configure multiple realms. Defaults to `Integer.MAX_VALUE`.
  148. `enabled`::
  149. Indicates whether a realm is enabled. You can use this setting to disable a
  150. realm without removing its configuration information. Defaults to `true`.
  151. [[ref-native-settings]]
  152. [float]
  153. ===== Native realm settings
  154. For a native realm, the `type` must be set to `native`. In addition to the
  155. <<ref-realm-settings,settings that are valid for all realms>>, you can specify
  156. the following optional settings:
  157. `cache.ttl`:: The time-to-live for cached user entries. A user and a hash of its
  158. credentials are cached for this period of time. Specify the time period using
  159. the standard {es} <<time-units,time units>>. Defaults to `20m`.
  160. `cache.max_users`:: The maximum number of user entries that can live in the
  161. cache at any given time. Defaults to 100,000.
  162. `cache.hash_algo`:: (Expert Setting) The hashing algorithm that is used for the
  163. in-memory cached user credentials. For possible values, see <<cache-hash-algo>>.
  164. Defaults to `ssha256`.
  165. `authentication.enabled`:: If set to `false`, disables authentication support in
  166. this realm, so that it only supports user lookups.
  167. (See the {xpack-ref}/run-as-privilege.html[run as] and
  168. {stack-ov}/realm-chains.html#authorization_realms[authorization realms] features).
  169. Defaults to `true`.
  170. [[ref-users-settings]]
  171. [float]
  172. ===== File realm settings
  173. The `type` setting must be set to `file`. In addition to the
  174. <<ref-realm-settings,settings that are valid for all realms>>, you can specify
  175. the following settings:
  176. `cache.ttl`::
  177. The time-to-live for cached user entries. A user and a hash of its credentials
  178. are cached for this configured period of time. Defaults to `20m`. Specify values
  179. using the standard {es} {ref}/common-options.html#time-units[time units].
  180. Defaults to `20m`.
  181. `cache.max_users`::
  182. The maximum number of user entries that can live in the cache at a given time.
  183. Defaults to 100,000.
  184. `cache.hash_algo`::
  185. (Expert Setting) The hashing algorithm that is used for the in-memory cached
  186. user credentials. See <<cache-hash-algo>>. Defaults to `ssha256`.
  187. `authentication.enabled`:: If set to `false`, disables authentication support in
  188. this realm, so that it only supports user lookups.
  189. (See the {xpack-ref}/run-as-privilege.html[run as] and
  190. {stack-ov}/realm-chains.html#authorization_realms[authorization realms] features).
  191. Defaults to `true`.
  192. [[ref-ldap-settings]]
  193. [float]
  194. ===== LDAP realm settings
  195. The `type` setting must be set to `ldap`. In addition to the
  196. <<ref-realm-settings>>, you can specify the following settings:
  197. `url`:: Specifies one or more LDAP URLs in the format
  198. `ldap[s]://<server>:<port>`. Multiple URLs can be defined using a comma
  199. separated value or array syntax: `[ "ldaps://server1:636", "ldaps://server2:636" ]`.
  200. `ldaps` and `ldap` URL protocols cannot be mixed in the same realm. Required.
  201. `load_balance.type`::
  202. The behavior to use when there are multiple LDAP URLs defined. For supported
  203. values see <<load-balancing,load balancing and failover types>>.
  204. Defaults to `failover`.
  205. `load_balance.cache_ttl`::
  206. When using `dns_failover` or `dns_round_robin` as the load balancing type,
  207. this setting controls the amount of time to cache DNS lookups. Defaults
  208. to `1h`.
  209. `bind_dn`::
  210. The DN of the user that is used to bind to the LDAP and perform searches.
  211. Only applicable in user search mode.
  212. If not specified, an anonymous bind is attempted.
  213. Defaults to Empty. Due to its potential security impact, `bind_dn` is not
  214. exposed via the <<cluster-nodes-info,nodes info API>>.
  215. `bind_password`::
  216. deprecated[6.3] Use `secure_bind_password` instead. The password for the user
  217. that is used to bind to the LDAP directory.
  218. Defaults to Empty. Due to its potential security impact, `bind_password` is not
  219. exposed via the <<cluster-nodes-info,nodes info API>>.
  220. `secure_bind_password` (<<secure-settings,Secure>>)::
  221. The password for the user that is used to bind to the LDAP directory.
  222. Defaults to Empty.
  223. `user_dn_templates`::
  224. The DN template that replaces the user name with the string `{0}`.
  225. This setting is multivalued; you can specify multiple user contexts.
  226. Required to operate in user template mode. If `user_search.base_dn` is specified,
  227. this setting is not valid. For more information on
  228. the different modes, see {xpack-ref}/ldap-realm.html[LDAP realms].
  229. `authorization_realms`::
  230. The names of the realms that should be consulted for delegate authorization.
  231. If this setting is used, then the LDAP realm does not perform role mapping and
  232. instead loads the user from the listed realms. The referenced realms are
  233. consulted in the order that they are defined in this list.
  234. See {stack-ov}/realm-chains.html#authorization_realms[Delegating authorization to another realm]
  235. +
  236. --
  237. NOTE: If any settings starting with `user_search` are specified, the
  238. `user_dn_templates` settings are ignored.
  239. --
  240. `user_group_attribute`::
  241. Specifies the attribute to examine on the user for group membership.
  242. If any `group_search` settings are specified, this setting is ignored. Defaults
  243. to `memberOf`.
  244. `user_search.base_dn`::
  245. Specifies a container DN to search for users. Required
  246. to operated in user search mode. If `user_dn_templates` is specified, this
  247. setting is not valid. For more information on
  248. the different modes, see {xpack-ref}/ldap-realm.html[LDAP realms].
  249. `user_search.scope`::
  250. The scope of the user search. Valid values are `sub_tree`, `one_level` or
  251. `base`. `one_level` only searches objects directly contained within the
  252. `base_dn`. `sub_tree` searches all objects contained under `base_dn`.
  253. `base` specifies that the `base_dn` is the user object, and that it is
  254. the only user considered. Defaults to `sub_tree`.
  255. `user_search.filter`::
  256. Specifies the filter used to search the directory in attempts to match
  257. an entry with the username provided by the user. Defaults to `(uid={0})`.
  258. `{0}` is substituted with the username provided when searching.
  259. `user_search.attribute`::
  260. deprecated[5.6] Use `user_search.filter` instead.
  261. The attribute to match with the username sent with the request. Defaults to `uid`.
  262. `user_search.pool.enabled`::
  263. Enables or disables connection pooling for user search. If set to `false`, a new
  264. connection is created for every search. The
  265. default is `true` when `bind_dn` is set.
  266. `user_search.pool.size`::
  267. The maximum number of connections to the LDAP server to allow in the
  268. connection pool. Defaults to `20`.
  269. `user_search.pool.initial_size`::
  270. The initial number of connections to create to the LDAP server on startup.
  271. Defaults to `0`. If the LDAP server is down, values greater than `0` could cause
  272. startup failures.
  273. `user_search.pool.health_check.enabled`::
  274. Enables or disables a health check on LDAP connections in the connection
  275. pool. Connections are checked in the background at the specified interval.
  276. Defaults to `true`.
  277. `user_search.pool.health_check.dn`::
  278. The distinguished name that is retrieved as part of the health check.
  279. Defaults to the value of `bind_dn` if present; if
  280. not, falls back to `user_search.base_dn`.
  281. `user_search.pool.health_check.interval`::
  282. The interval to perform background checks of connections in the pool.
  283. Defaults to `60s`.
  284. `group_search.base_dn`::
  285. The container DN to search for groups in which the user has membership. When
  286. this element is absent, {security} searches for the attribute specified by
  287. `user_group_attribute` set on the user in order to determine group membership.
  288. `group_search.scope`::
  289. Specifies whether the group search should be `sub_tree`, `one_level` or
  290. `base`. `one_level` only searches objects directly contained within the
  291. `base_dn`. `sub_tree` searches all objects contained under `base_dn`.
  292. `base` specifies that the `base_dn` is a group object, and that it is the
  293. only group considered. Defaults to `sub_tree`.
  294. `group_search.filter`::
  295. Specifies a filter to use to look up a group.
  296. When not set, the realm searches for `group`, `groupOfNames`, `groupOfUniqueNames`,
  297. or `posixGroup` with the attributes `member`, `memberOf`, or `memberUid`. Any
  298. instance of `{0}` in the filter is replaced by the user attribute defined in
  299. `group_search.user_attribute`.
  300. `group_search.user_attribute`::
  301. Specifies the user attribute that is fetched and provided as a parameter to
  302. the filter. If not set, the user DN is passed into the filter. Defaults to Empty.
  303. `unmapped_groups_as_roles`::
  304. If set to `true`, the names of any unmapped LDAP groups are used as role names
  305. and assigned to the user. A group is considered to be _unmapped_ if it is not
  306. referenced in a
  307. {xpack-ref}/mapping-roles.html#mapping-roles-file[role-mapping file]. API-based
  308. role mappings are not considered. Defaults to `false`.
  309. `files.role_mapping`::
  310. The {xpack-ref}/security-files.html[location] for the {xpack-ref}/mapping-roles.html#mapping-roles[
  311. YAML role mapping configuration file]. Defaults to
  312. `ES_PATH_CONF/role_mapping.yml`.
  313. `follow_referrals`::
  314. Specifies whether {security} should follow referrals returned
  315. by the LDAP server. Referrals are URLs returned by the server that are to be
  316. used to continue the LDAP operation (for example, search). Defaults to `true`.
  317. `metadata`::
  318. A list of additional LDAP attributes that should be loaded from the
  319. LDAP server and stored in the authenticated user's metadata field.
  320. `timeout.tcp_connect`::
  321. The TCP connect timeout period for establishing an LDAP connection.
  322. An `s` at the end indicates seconds, or `ms` indicates milliseconds.
  323. Defaults to `5s` (5 seconds ).
  324. `timeout.tcp_read`::
  325. The TCP read timeout period after establishing an LDAP connection.
  326. An `s` at the end indicates seconds, or `ms` indicates milliseconds.
  327. Defaults to `5s` (5 seconds ).
  328. `timeout.ldap_search`::
  329. The LDAP Server enforced timeout period for an LDAP search.
  330. An `s` at the end indicates seconds, or `ms` indicates milliseconds.
  331. Defaults to `5s` (5 seconds ).
  332. `ssl.key`::
  333. Path to a PEM encoded file containing the private key, which is used if the
  334. LDAP server requires client authentication. `ssl.key` and `ssl.keystore.path`
  335. cannot be used at the same time.
  336. `ssl.key_passphrase`::
  337. The passphrase that is used to decrypt the private key. This value is
  338. optional as the key may not be encrypted.
  339. `ssl.secure_key_passphrase` (<<secure-settings,Secure>>)::
  340. The passphrase that is used to decrypt the private key.
  341. `ssl.certificate`::
  342. Path to a PEM encoded file containing the certificate (or certificate chain)
  343. that will be presented to clients when they connect.
  344. `ssl.certificate_authorities`::
  345. List of paths to PEM encoded certificate files that should be trusted.
  346. `ssl.certificate_authorities` and `ssl.truststore.path` cannot be used at the
  347. same time.
  348. `ssl.keystore.path`::
  349. The path to the Java Keystore file that contains a private key and certificate.
  350. `ssl.key` and `ssl.keystore.path` may not be used at the same time.
  351. `ssl.keystore.type`::
  352. The format of the keystore file. Should be `jks` to use the Java
  353. Keystore format, `PKCS12` to use PKCS#12 files, or `PKCS11` to use a PKCS#11 token.
  354. The default is `jks`.
  355. `ssl.keystore.password`::
  356. The password to the keystore.
  357. `ssl.keystore.secure_password` (<<secure-settings,Secure>>)::
  358. The password to the keystore.
  359. `ssl.keystore.key_password`::
  360. The password for the key in the keystore. Defaults to the keystore password.
  361. `ssl.keystore.secure_key_password`::
  362. The password for the key in the keystore. Defaults to the keystore password.
  363. `ssl.truststore.path`::
  364. The path to the Java Keystore file that contains the certificates to trust.
  365. `ssl.certificate_authorities` and `ssl.truststore.path` cannot be used at the same time.
  366. `ssl.truststore.password`::
  367. The password to the truststore.
  368. `ssl.truststore.secure_password` (<<secure-settings,Secure>>)::
  369. The password to the truststore.
  370. `ssl.truststore.type`::
  371. The format of the keystore file. Should be `jks` to use the Java
  372. Keystore format, `PKCS12` to use PKCS#12 files, or `PKCS11` to use a PKCS#11 token.
  373. The default is `jks`.
  374. `ssl.verification_mode`::
  375. Indicates the type of verification when using `ldaps` to protect against man
  376. in the middle attacks and certificate forgery. Values are `none`, `certificate`,
  377. and `full`. Defaults to the value of `xpack.ssl.verification_mode`.
  378. +
  379. See <<ssl-tls-settings,`xpack.ssl.verification_mode`>> for an explanation of
  380. these values.
  381. `ssl.supported_protocols`::
  382. Supported protocols for TLS/SSL (with versions). Defaults to the value of
  383. `xpack.ssl.supported_protocols`.
  384. `ssl.cipher_suites`:: Specifies the cipher suites that should be supported when
  385. communicating with the LDAP server.
  386. Supported cipher suites can be found in Oracle's http://docs.oracle.com/javase/8/docs/technotes/guides/security/SunProviders.html[
  387. Java Cryptography Architecture documentation]. Defaults to the value of
  388. `xpack.ssl.cipher_suites`.
  389. `cache.ttl`::
  390. Specifies the time-to-live for cached user entries. A user and a hash of its
  391. credentials are cached for this period of time. Use the standard {es}
  392. <<time-units,time units>>. Defaults to `20m`.
  393. `cache.max_users`::
  394. Specifies the maximum number of user entries that the cache can contain.
  395. Defaults to `100000`.
  396. `cache.hash_algo`::
  397. (Expert Setting) Specifies the hashing algorithm that is used for the
  398. in-memory cached user credentials. See <<cache-hash-algo>>. Defaults to `ssha256`.
  399. `authentication.enabled`:: If set to `false`, disables authentication support in
  400. this realm, so that it only supports user lookups.
  401. (See the {xpack-ref}/run-as-privilege.html[run as] and
  402. {stack-ov}/realm-chains.html#authorization_realms[authorization realms] features).
  403. Defaults to `true`.
  404. [[ref-ad-settings]]
  405. [float]
  406. ===== Active Directory realm settings
  407. The `type` setting must be set to `active_directory`. In addition to the
  408. <<ref-realm-settings,settings that are valid for all realms>>, you can specify
  409. the following settings:
  410. `url`::
  411. An LDAP URL of the form `ldap[s]://<server>:<port>`. {security} attempts to
  412. authenticate against this URL. If the URL is not specified, it is derived from
  413. the `domain_name` setting and assumes an unencrypted connection to port 389.
  414. Defaults to `ldap://<domain_name>:389`. This setting is required when connecting
  415. using SSL/TLS or when using a custom port.
  416. `load_balance.type`::
  417. The behavior to use when there are multiple LDAP URLs defined. For supported
  418. values see <<load-balancing,load balancing and failover types>>.
  419. Defaults to `failover`.
  420. `load_balance.cache_ttl`::
  421. When using `dns_failover` or `dns_round_robin` as the load balancing type,
  422. this setting controls the amount of time to cache DNS lookups. Defaults
  423. to `1h`.
  424. `domain_name`::
  425. The domain name of Active Directory. If the `url` and the `user_search_dn`
  426. settings are not specified, the cluster can derive those values from this
  427. setting. Required.
  428. `bind_dn`::
  429. The DN of the user that is used to bind to Active Directory and perform searches.
  430. Defaults to Empty. Due to its potential security impact, `bind_dn` is not
  431. exposed via the <<cluster-nodes-info,nodes info API>>.
  432. `bind_password`::
  433. deprecated[6.3] Use `secure_bind_password` instead. The password for the user
  434. that is used to bind to Active Directory. Defaults to Empty. Due to its
  435. potential security impact, `bind_password` is not exposed via the
  436. <<cluster-nodes-info,nodes info API>>.
  437. `secure_bind_password` (<<secure-settings,Secure>>)::
  438. The password for the user that is used to bind to Active Directory.
  439. Defaults to Empty.
  440. `unmapped_groups_as_roles`::
  441. If set to `true`, the names of any unmapped Active Directory groups are used as
  442. role names and assigned to the user. A group is considered _unmapped_ when it
  443. is not referenced in any role-mapping files. API-based role mappings are not
  444. considered. Defaults to `false`.
  445. `files.role_mapping`::
  446. The {xpack-ref}/security-files.html[location] for the YAML
  447. role mapping configuration file. Defaults to `ES_PATH_CONF/role_mapping.yml`.
  448. `user_search.base_dn`::
  449. The context to search for a user. Defaults to the root
  450. of the Active Directory domain.
  451. `user_search.scope`::
  452. Specifies whether the user search should be `sub_tree`, `one_level` or `base`.
  453. `one_level` only searches users directly contained within the `base_dn`.
  454. `sub_tree` searches all objects contained under `base_dn`. `base`
  455. specifies that the `base_dn` is a user object, and that it is the
  456. only user considered. Defaults to `sub_tree`.
  457. `user_search.filter`::
  458. Specifies a filter to use to lookup a user given a username. The default
  459. filter looks up `user` objects with either `sAMAccountName` or
  460. `userPrincipalName`. If specified, this must be a valid LDAP user search filter.
  461. For example `(&(objectClass=user)(sAMAccountName={0}))`. For more information,
  462. see
  463. https://msdn.microsoft.com/en-us/library/aa746475(v=vs.85).aspx[Search Filter Syntax].
  464. `user_search.upn_filter`::
  465. Specifies a filter to use to lookup a user given a user principal name.
  466. The default filter looks up `user` objects with
  467. a matching `userPrincipalName`. If specified, this
  468. must be a valid LDAP user search filter. For example,
  469. `(&(objectClass=user)(userPrincipalName={1}))`. `{1}` is the full user principal name
  470. provided by the user. For more information, see
  471. https://msdn.microsoft.com/en-us/library/aa746475(v=vs.85).aspx[Search Filter Syntax].
  472. `user_search.down_level_filter`::
  473. Specifies a filter to use to lookup a user given a down level logon name
  474. (DOMAIN\user). The default filter looks up `user` objects with a matching
  475. `sAMAccountName` in the domain provided. If specified, this
  476. must be a valid LDAP user search filter. For example,
  477. `(&(objectClass=user)(sAMAccountName={0}))`. For more information, see
  478. https://msdn.microsoft.com/en-us/library/aa746475(v=vs.85).aspx[Search Filter Syntax].
  479. `user_search.pool.enabled`::
  480. Enables or disables connection pooling for user search. When
  481. disabled a new connection is created for every search. The
  482. default is `true` when `bind_dn` is provided.
  483. `user_search.pool.size`::
  484. The maximum number of connections to the Active Directory server to allow in the
  485. connection pool. Defaults to `20`.
  486. `user_search.pool.initial_size`::
  487. The initial number of connections to create to the Active Directory server on startup.
  488. Defaults to `0`. If the LDAP server is down, values greater than 0
  489. could cause startup failures.
  490. `user_search.pool.health_check.enabled`::
  491. Enables or disables a health check on Active Directory connections in the connection
  492. pool. Connections are checked in the background at the specified interval.
  493. Defaults to `true`.
  494. `user_search.pool.health_check.dn`::
  495. The distinguished name to be retrieved as part of the health check.
  496. Defaults to the value of `bind_dn` if that setting is present. Otherwise, it
  497. defaults to the value of the `user_search.base_dn` setting.
  498. `user_search.pool.health_check.interval`::
  499. The interval to perform background checks of connections in the pool.
  500. Defaults to `60s`.
  501. `group_search.base_dn`::
  502. The context to search for groups in which the user has membership. Defaults
  503. to the root of the Active Directory domain.
  504. `group_search.scope`::
  505. Specifies whether the group search should be `sub_tree`, `one_level` or
  506. `base`. `one_level` searches for groups directly contained within the
  507. `base_dn`. `sub_tree` searches all objects contained under `base_dn`.
  508. `base` specifies that the `base_dn` is a group object, and that it is
  509. the only group considered. Defaults to `sub_tree`.
  510. `metadata`::
  511. A list of additional LDAP attributes that should be loaded from the
  512. LDAP server and stored in the authenticated user's metadata field.
  513. `timeout.tcp_connect`::
  514. The TCP connect timeout period for establishing an LDAP connection.
  515. An `s` at the end indicates seconds, or `ms` indicates milliseconds.
  516. Defaults to `5s` (5 seconds ).
  517. `timeout.tcp_read`::
  518. The TCP read timeout period after establishing an LDAP connection.
  519. An `s` at the end indicates seconds, or `ms` indicates milliseconds.
  520. Defaults to `5s` (5 seconds ).
  521. `timeout.ldap_search`::
  522. The LDAP Server enforced timeout period for an LDAP search.
  523. An `s` at the end indicates seconds, or `ms` indicates milliseconds.
  524. Defaults to `5s` (5 seconds ).
  525. `ssl.certificate`::
  526. Path to a PEM encoded file containing the certificate (or certificate chain)
  527. that will be presented to clients when they connect.
  528. `ssl.certificate_authorities`::
  529. List of paths to PEM encoded certificate files that should be trusted.
  530. `ssl.certificate_authorities` and `ssl.truststore.path` cannot be used at the
  531. same time.
  532. `ssl.key`::
  533. Path to the PEM encoded file containing the private key, which is used when the
  534. Active Directory server requires client authentication. `ssl.key` and
  535. `ssl.keystore.path` cannot be used at the same time.
  536. `ssl.key_passphrase`::
  537. The passphrase that is used to decrypt the private key. This value is
  538. optional as the key might not be encrypted.
  539. `ssl.secure_key_passphrase` (<<secure-settings,Secure>>)::
  540. The passphrase that is used to decrypt the private key. This value is
  541. optional as the key might not be encrypted.
  542. `ssl.keystore.key_password`::
  543. The password for the key in the keystore. Defaults to the keystore password.
  544. `ssl.keystore.secure_key_password` (<<secure-settings,Secure>>)::
  545. The password for the key in the keystore. Defaults to the keystore password.
  546. `ssl.keystore.password`::
  547. The password to the keystore.
  548. `ssl.secure_keystore.password` (<<secure-settings,Secure>>)::
  549. The password to the keystore.
  550. `ssl.keystore.path`::
  551. The path to the Java Keystore file that contains a private key and certificate.
  552. `ssl.key` and `ssl.keystore.path` cannot be used at the same time.
  553. `ssl.keystore.type`::
  554. The format of the keystore file. Should be `jks` to use the Java
  555. Keystore format, `PKCS12` to use PKCS#12 files, or `PKCS11` to use a PKCS#11 token.
  556. The default is `jks`.
  557. `ssl.truststore.password`::
  558. The password to the truststore.
  559. `ssl.truststore.secure_password` (<<secure-settings,Secure>>)::
  560. The password to the truststore.
  561. `ssl.truststore.path`::
  562. The path to the Java Keystore file that contains the certificates to trust.
  563. `ssl.certificate_authorities` and `ssl.truststore.path` cannot be used at the
  564. same time.
  565. `ssl.truststore.type`::
  566. The format of the truststore file. Should be `jks` to use the Java
  567. Keystore format, `PKCS12` to use PKCS#12 files, or `PKCS11` to use a PKCS#11 token.
  568. The default is `jks`.
  569. `ssl.verification_mode`::
  570. Indicates the type of verification when using `ldaps` to protect against man
  571. in the middle attacks and certificate forgery. Values are `none`, `certificate`,
  572. and `full`. Defaults to the value of `xpack.ssl.verification_mode`.
  573. +
  574. See <<ssl-tls-settings,`xpack.ssl.verification_mode`>> for an explanation of
  575. these values.
  576. `ssl.supported_protocols`::
  577. Supported protocols for TLS/SSL (with versions). Defaults to the value of
  578. `xpack.ssl.supported_protocols`.
  579. `ssl.cipher_suites`:: Specifies the cipher suites that should be supported when
  580. communicating with the Active Directory server.
  581. Supported cipher suites can be found in Oracle's http://docs.oracle.com/javase/8/docs/technotes/guides/security/SunProviders.html[
  582. Java Cryptography Architecture documentation]. Defaults to the value of
  583. `xpack.ssl.cipher_suites`.
  584. `cache.ttl`::
  585. Specifies the time-to-live for cached user entries. A user and a hash of its
  586. credentials are cached for this configured period of time. Use the
  587. standard Elasticsearch {ref}/common-options.html#time-units[time units]).
  588. Defaults to `20m`.
  589. `cache.max_users`::
  590. Specifies the maximum number of user entries that the cache can contain.
  591. Defaults to `100000`.
  592. `cache.hash_algo`::
  593. (Expert Setting) Specifies the hashing algorithm that is used for
  594. the in-memory cached user credentials. See <<cache-hash-algo>>. Defaults to `ssha256`.
  595. `authentication.enabled`:: If set to `false`, disables authentication support in
  596. this realm, so that it only supports user lookups.
  597. (See the {xpack-ref}/run-as-privilege.html[run as] and
  598. {stack-ov}/realm-chains.html#authorization_realms[authorization realms] features).
  599. Defaults to `true`.
  600. `follow_referrals`::
  601. If set to `true` {security} follows referrals returned by the LDAP server.
  602. Referrals are URLs returned by the server that are to be used to continue the
  603. LDAP operation (such as `search`). Defaults to `true`.
  604. [[ref-pki-settings]]
  605. [float]
  606. ===== PKI realm settings
  607. The `type` setting must be set to `pki`. In addition to the
  608. <<ref-realm-settings,settings that are valid for all realms>>, you can specify
  609. the following settings:
  610. `username_pattern`::
  611. The regular expression pattern used to extract the username from the
  612. certificate DN. The first match group is the used as the username.
  613. Defaults to `CN=(.*?)(?:,\|$)`.
  614. `certificate_authorities`::
  615. List of paths to the PEM certificate files that should be used to authenticate a
  616. user's certificate as trusted. Defaults to the trusted certificates configured
  617. for SSL. This setting cannot be used with `truststore.path`.
  618. `truststore.algorithm`::
  619. Algorithm for the truststore. Defaults to `SunX509`.
  620. `truststore.password`::
  621. The password for the truststore. Must be provided if `truststore.path` is set.
  622. `truststore.secure_password` (<<secure-settings,Secure>>)::
  623. The password for the truststore.
  624. `truststore.path`::
  625. The path of a truststore to use. Defaults to the trusted certificates configured
  626. for SSL. This setting cannot be used with `certificate_authorities`.
  627. `files.role_mapping`::
  628. Specifies the {xpack-ref}/security-files.html[location] of the
  629. {xpack-ref}/mapping-roles.html[YAML role mapping configuration file].
  630. Defaults to `ES_PATH_CONF/role_mapping.yml`.
  631. `authorization_realms`::
  632. The names of the realms that should be consulted for delegate authorization.
  633. If this setting is used, then the PKI realm does not perform role mapping and
  634. instead loads the user from the listed realms.
  635. See {stack-ov}/realm-chains.html#authorization_realms[Delegating authorization to another realm]
  636. `cache.ttl`::
  637. Specifies the time-to-live for cached user entries. A user and a hash of its
  638. credentials are cached for this period of time. Use the
  639. standard {es} {ref}/common-options.html#time-units[time units]).
  640. Defaults to `20m`.
  641. `cache.max_users`::
  642. Specifies the maximum number of user entries that the cache can contain.
  643. Defaults to `100000`.
  644. [[ref-saml-settings]]
  645. [float]
  646. ===== SAML realm settings
  647. The `type` setting must be set to `saml`. In addition to the
  648. <<ref-realm-settings,settings that are valid for all realms>>, you can specify
  649. the following settings:
  650. `idp.entity_id`::
  651. The Entity ID of the SAML Identity Provider. An Entity ID is a URI with a
  652. maximum length of 1024 characters. It can be a URL (https://idp.example.com/) or
  653. a URN (`urn:example.com:idp`) and can be found in the configuration or the SAML
  654. metadata of the Identity Provider.
  655. `idp.metadata.path`::
  656. The path _(recommended)_ or URL to a SAML 2.0 metadata file describing the
  657. capabilities and configuration of the Identity Provider.
  658. If a path is provided, then it is resolved relative to the {es} config
  659. directory.
  660. If a URL is provided, then it must be either a `file` URL or a `https` URL.
  661. {security} automatically polls this metadata resource and reloads
  662. the IdP configuration when changes are detected.
  663. File based resources are polled at a frequency determined by the global {es}
  664. `resource.reload.interval.high` setting, which defaults to 5 seconds.
  665. HTTPS resources are polled at a frequency determined by the realm's
  666. `idp.metadata.http.refresh` setting.
  667. `idp.metadata.http.refresh`::
  668. Controls the frequency with which `https` metadata is checked for changes.
  669. Defaults to `1h` (1 hour).
  670. `idp.use_single_logout`::
  671. Indicates whether to utilise the Identity Provider's Single Logout service
  672. (if one exists in the IdP metadata file).
  673. Defaults to `true`.
  674. `sp.entity_id`::
  675. The Entity ID to use for this SAML Service Provider. This should be entered as a
  676. URI. We recommend that you use the base URL of your Kibana instance. For example,
  677. `https://kibana.example.com/`.
  678. `sp.acs`::
  679. The URL of the Assertion Consumer Service within {kib}. Typically this is the
  680. "api/security/v1/saml" endpoint of your Kibana server. For example,
  681. `https://kibana.example.com/api/security/v1/saml`.
  682. `sp.logout`::
  683. The URL of the Single Logout service within {kib}. Typically this is the
  684. "logout" endpoint of your Kibana server. For example,
  685. `https://kibana.example.com/logout`.
  686. `attributes.principal`::
  687. The Name of the SAML attribute that should be used as the {security} user's
  688. principal (username).
  689. `attributes.groups`::
  690. The Name of the SAML attribute that should be used to populate {security}
  691. user's groups.
  692. `attributes.name`::
  693. The Name of the SAML attribute that should be used to populate {security}
  694. user's full name.
  695. `attributes.mail`::
  696. The Name of the SAML attribute that should be used to populate {security}
  697. user's email address.
  698. `attributes.dn`::
  699. The Name of the SAML attribute that should be used to populate {security}
  700. user's X.500 _Distinguished Name_.
  701. `attribute_patterns.principal`::
  702. A Java regular expression that is matched against the SAML attribute specified
  703. by `attributes.pattern` before it is applied to the user's _principal_ property.
  704. The attribute value must match the pattern and the value of the first
  705. _capturing group_ is used as the principal. For example, `^([^@]+)@example\\.com$`
  706. matches email addresses from the "example.com" domain and uses the local-part as
  707. the principal.
  708. `attribute_patterns.groups`::
  709. As per `attribute_patterns.principal`, but for the _group_ property.
  710. `attribute_patterns.name`::
  711. As per `attribute_patterns.principal`, but for the _name_ property.
  712. `attribute_patterns.mail`::
  713. As per `attribute_patterns.principal`, but for the _mail_ property.
  714. `attribute_patterns.dn`::
  715. As per `attribute_patterns.principal`, but for the _dn_ property.
  716. `nameid_format`::
  717. The NameID format that should be requested when asking the IdP to authenticate
  718. the current user. Defaults to requesting _transient_ names
  719. (`urn:oasis:names:tc:SAML:2.0:nameid-format:transient`).
  720. `nameid.allow_create`:: The value of the `AllowCreate` attribute of the
  721. `NameIdPolicy` element in an authentication request. Defaults to `false`.
  722. `nameid.sp_qualifier`:: The value of the `SPNameQualifier` attribute of the
  723. `NameIdPolicy` element in an authentication request. The default is to not
  724. include the `SPNameQualifier` attribute.
  725. `force_authn`::
  726. Specifies whether to set the `ForceAuthn` attribute when requesting that the IdP
  727. authenticate the current user. If set to `true`, the IdP is required to verify
  728. the user’s identity, irrespective of any existing sessions they might have.
  729. Defaults to `false`.
  730. `populate_user_metadata`::
  731. Specifies whether to populate the {es} user's metadata with the values that are
  732. provided by the SAML attributes. Defaults to `true`.
  733. `authorization_realms`::
  734. The names of the realms that should be consulted for delegate authorization.
  735. If this setting is used, then the SAML realm does not perform role mapping and
  736. instead loads the user from the listed realms.
  737. See {stack-ov}/realm-chains.html#authorization_realms[Delegating authorization to another realm]
  738. `allowed_clock_skew`::
  739. The maximum amount of skew that can be tolerated between the IdP's clock and the
  740. {es} node's clock.
  741. Defaults to `3m` (3 minutes).
  742. `req_authn_context_class_ref`::
  743. A comma separated list of Authentication Context Class Reference values to be
  744. included in the Requested Authentication Context when requesting the IdP to
  745. authenticate the current user. The Authentication Context of the corresponding
  746. authentication response should contain at least one of the requested values.
  747. +
  748. For more information, see
  749. {stack-ov}/saml-guide-authentication.html#req-authn-context[Requesting specific authentication methods].
  750. [float]
  751. [[ref-saml-signing-settings]]
  752. ===== SAML realm signing settings
  753. If a signing key is configured (that is, either `signing.key` or
  754. `signing.keystore.path` is set), then {security} signs outgoing SAML messages.
  755. Signing can be configured using the following settings:
  756. `signing.saml_messages`::
  757. A list of SAML message types that should be signed or `*` to sign all messages.
  758. Each element in the list should be the local name of a SAML XML Element.
  759. Supported element types are `AuthnRequest`, `LogoutRequest` and `LogoutResponse`.
  760. Only valid if `signing.key` or `signing.keystore.path` is also specified.
  761. Defaults to `*`.
  762. `signing.key`::
  763. Specifies the path to the PEM encoded private key to use for SAML message signing.
  764. `signing.key` and `signing.keystore.path` cannot be used at the same time.
  765. `signing.secure_key_passphrase` (<<secure-settings,Secure>>)::
  766. Specifies the passphrase to decrypt the PEM encoded private key (`signing.key`)
  767. if it is encrypted.
  768. `signing.certificate`::
  769. Specifies the path to the PEM encoded certificate (or certificate chain) that
  770. corresponds to the `signing.key`. This certificate must also be included in the
  771. Service Provider metadata or manually configured within the IdP to allow for
  772. signature validation. This setting can only be used if `signing.key` is set.
  773. `signing.keystore.path`::
  774. The path to the keystore that contains a private key and certificate.
  775. Must be either a Java Keystore (jks) or a PKCS#12 file.
  776. `signing.key` and `signing.keystore.path` cannot be used at the same time.
  777. `signing.keystore.type`::
  778. The type of the keystore in `signing.keystore.path`.
  779. Must be either `jks` or `PKCS12`. If the keystore path ends in ".p12", ".pfx",
  780. or "pkcs12", this setting defaults to `PKCS12`. Otherwise, it defaults to `jks`.
  781. `signing.keystore.alias`::
  782. Specifies the alias of the key within the keystore that should be
  783. used for SAML message signing. If the keystore contains more than one private
  784. key, this setting must be specified.
  785. `signing.keystore.secure_password` (<<secure-settings,Secure>>)::
  786. The password to the keystore in `signing.keystore.path`.
  787. `signing.keystore.secure_key_password` (<<secure-settings,Secure>>)::
  788. The password for the key in the keystore (`signing.keystore.path`).
  789. Defaults to the keystore password.
  790. [float]
  791. [[ref-saml-encryption-settings]]
  792. ===== SAML realm encryption settings
  793. If an encryption key is configured (that is, either `encryption.key` or
  794. `encryption.keystore.path` is set), then {security} publishes an encryption
  795. certificate when generating metadata and attempts to decrypt incoming SAML
  796. content. Encryption can be configured using the following settings:
  797. `encryption.key`::
  798. Specifies the path to the PEM encoded private key to use for SAML message
  799. decryption.
  800. `encryption.key` and `encryption.keystore.path` cannot be used at the same time.
  801. `encryption.secure_key_passphrase` (<<secure-settings,Secure>>)::
  802. Specifies the passphrase to decrypt the PEM encoded private key
  803. (`encryption.key`) if it is encrypted.
  804. `encryption.certificate`::
  805. Specifies the path to the PEM encoded certificate (or certificate chain) that is
  806. associated with the `encryption.key`. This certificate must also be included in
  807. the Service Provider metadata or manually configured within the IdP to enable
  808. message encryption. This setting can be used only if `encryption.key` is set.
  809. `encryption.keystore.path`::
  810. The path to the keystore that contains a private key and certificate.
  811. Must be either a Java Keystore (jks) or a PKCS#12 file.
  812. `encryption.key` and `encryption.keystore.path` cannot be used at the same time.
  813. `encryption.keystore.type`::
  814. The type of the keystore (`encryption.keystore.path`).
  815. Must be either `jks` or `PKCS12`. If the keystore path ends in ".p12", ".pfx",
  816. or "pkcs12", this setting defaults to `PKCS12`. Otherwise, it defaults to `jks`.
  817. `encryption.keystore.alias`::
  818. Specifies the alias of the key within the keystore (`encryption.keystore.path`)
  819. that should be used for SAML message decryption. If not specified, all compatible
  820. key pairs from the keystore are considered as candidate keys for decryption.
  821. `encryption.keystore.secure_password` (<<secure-settings,Secure>>)::
  822. The password to the keystore (`encryption.keystore.path`).
  823. `encryption.keystore.secure_key_password` (<<secure-settings,Secure>>)::
  824. The password for the key in the keystore (`encryption.keystore.path`). Only a
  825. single password is supported. If you are using multiple decryption keys,
  826. they cannot have individual passwords.
  827. [float]
  828. [[ref-saml-ssl-settings]]
  829. ===== SAML realm SSL settings
  830. If you are loading the IdP metadata over SSL/TLS (that is, `idp.metadata.path`
  831. is a URL using the `https` protocol), the following settings can be used to
  832. configure SSL. If these are not specified, then the
  833. <<ssl-tls-settings,default SSL settings>> are used.
  834. NOTE: These settings are not used for any purpose other than loading metadata
  835. over https.
  836. `ssl.key`::
  837. Specifies the path to the PEM encoded private key to use for http client
  838. authentication (if required). `ssl.key` and `ssl.keystore.path` cannot be used
  839. at the same time.
  840. `ssl.key_passphrase`::
  841. Specifies the
  842. passphrase to decrypt the PEM encoded private key (`ssl.key`) if it is
  843. encrypted. Cannot be used with `ssl.secure_key_passphrase`.
  844. `ssl.secure_key_passphrase` (<<secure-settings,Secure>>)::
  845. Specifies the
  846. passphrase to decrypt the PEM encoded private key (`ssl.key`) if it is
  847. encrypted. Cannot be used with `ssl.key_passphrase`.
  848. `ssl.certificate`::
  849. Specifies the
  850. path to the PEM encoded certificate (or certificate chain) that is associated
  851. with the key (`ssl.key`). This setting can be used only if `ssl.key` is set.
  852. `ssl.certificate_authorities`::
  853. Specifies the
  854. paths to the PEM encoded certificate authority certificates that should be
  855. trusted. `ssl.certificate_authorities` and `ssl.truststore.path` cannot be
  856. used at the same time.
  857. `ssl.keystore.path`::
  858. Specifies the path to
  859. the keystore that contains a private key and certificate.
  860. Must be either a Java Keystore (jks) or a PKCS#12 file.
  861. `ssl.key` and `ssl.keystore.path` cannot be used at the same time.
  862. `ssl.keystore.type`::
  863. The type of the keystore (`ssl.keystore.path`). Must be either `jks` or `PKCS12`.
  864. If the keystore path ends in ".p12", ".pfx" or "pkcs12", this setting defaults
  865. to `PKCS12`. Otherwise, it defaults to `jks`.
  866. `ssl.keystore.password`::
  867. The password to the keystore (`ssl.keystore.path`). This setting cannot be used
  868. with `ssl.keystore.secure_password`.
  869. `ssl.keystore.secure_password` (<<secure-settings,Secure>>)::
  870. The password to the keystore (`ssl.keystore.path`).
  871. This setting cannot be used with `ssl.keystore.password`.
  872. `ssl.keystore.key_password`::
  873. The password for the key in the keystore (`ssl.keystore.path`).
  874. Defaults to the keystore password. This setting cannot be used with
  875. `ssl.keystore.secure_key_password`.
  876. `ssl.keystore.secure_key_password` (<<secure-settings,Secure>>)::
  877. The password for the key in the keystore (`ssl.keystore.path`).
  878. Defaults to the keystore password. This setting cannot be used with
  879. `ssl.keystore.key_password`.
  880. `ssl.truststore.path`::
  881. The path to the
  882. keystore that contains the certificates to trust.
  883. Must be either a Java Keystore (jks) or a PKCS#12 file.
  884. `ssl.certificate_authorities` and `ssl.truststore.path` cannot be used at the
  885. same time.
  886. `ssl.truststore.type`::
  887. The type of the truststore (`ssl.truststore.path`). Must be either `jks` or
  888. `PKCS12`. If the keystore path ends in ".p12", ".pfx" or "pkcs12", this setting
  889. defaults to `PKCS12`. Otherwise, it defaults to `jks`.
  890. `ssl.truststore.password`::
  891. The password to the truststore (`ssl.truststore.path`). This setting cannot be
  892. used with `ssl.truststore.secure_password`.
  893. `ssl.truststore.secure_password` (<<secure-settings,Secure>>)::
  894. The password to the truststore (`ssl.truststore.path`). This setting cannot be
  895. used with `ssl.truststore.password`.
  896. `ssl.verification_mode`::
  897. One of `full`
  898. (verify the hostname and the certificate path), `certificate` (verify the
  899. certificate path, but not the hostname) or `none` (perform no verification).
  900. Defaults to `full`.
  901. +
  902. See <<ssl-tls-settings,`xpack.ssl.verification_mode`>> for a more detailed
  903. explanation of these values.
  904. `ssl.supported_protocols`::
  905. Specifies the supported protocols for TLS/SSL.
  906. `ssl.cipher_suites`::
  907. Specifies the
  908. cipher suites that should be supported.
  909. [float]
  910. [[ref-kerberos-settings]]
  911. ===== Kerberos realm settings
  912. For a Kerberos realm, the `type` must be set to `kerberos`. In addition to the
  913. <<ref-realm-settings,settings that are valid for all realms>>, you can specify
  914. the following settings:
  915. `keytab.path`:: Specifies the path to the Kerberos keytab file that contains the
  916. service principal used by this {es} node. This must be a location within the
  917. {es} configuration directory and the file must have read permissions. Required.
  918. `remove_realm_name`:: Set to `true` to remove the realm part of principal names.
  919. Principal names in Kerberos have the form `user/instance@REALM`. If this option
  920. is `true`, the realm part (`@REALM`) will not be included in the username.
  921. Defaults to `false`.
  922. `krb.debug`:: Set to `true` to enable debug logs for the Java login module that
  923. provides support for Kerberos authentication. Defaults to `false`.
  924. `cache.ttl`:: The time-to-live for cached user entries. A user is cached for
  925. this period of time. Specify the time period using the standard {es}
  926. <<time-units,time units>>. Defaults to `20m`.
  927. `cache.max_users`:: The maximum number of user entries that can live in the
  928. cache at any given time. Defaults to 100,000.
  929. [float]
  930. [[load-balancing]]
  931. ===== Load balancing and failover
  932. The `load_balance.type` setting can have the following values:
  933. * `failover`: The URLs specified are used in the order that they are specified.
  934. The first server that can be connected to will be used for all subsequent
  935. connections. If a connection to that server fails then the next server that a
  936. connection can be established to will be used for subsequent connections.
  937. * `dns_failover`: In this mode of operation, only a single URL may be specified.
  938. This URL must contain a DNS name. The system will be queried for all IP
  939. addresses that correspond to this DNS name. Connections to the Active Directory
  940. or LDAP server will always be tried in the order in which they were retrieved.
  941. This differs from `failover` in that there is no reordering of the list and if a
  942. server has failed at the beginning of the list, it will still be tried for each
  943. subsequent connection.
  944. * `round_robin`: Connections will continuously iterate through the list of
  945. provided URLs. If a server is unavailable, iterating through the list of URLs
  946. will continue until a successful connection is made.
  947. * `dns_round_robin`: In this mode of operation, only a single URL may be
  948. specified. This URL must contain a DNS name. The system will be queried for all
  949. IP addresses that correspond to this DNS name. Connections will continuously
  950. iterate through the list of addresses. If a server is unavailable, iterating
  951. through the list of URLs will continue until a successful connection is made.
  952. [float]
  953. [[ssl-tls-settings]]
  954. ==== Default TLS/SSL settings
  955. You can configure the following TLS/SSL settings in
  956. `elasticsearch.yml`. For more information, see
  957. {xpack-ref}/encrypting-communications.html[Encrypting communications]. These settings will be used
  958. for all of {xpack} unless they have been overridden by more specific
  959. settings such as those for HTTP or Transport.
  960. `xpack.ssl.supported_protocols`::
  961. Supported protocols with versions. Valid protocols: `SSLv2Hello`,
  962. `SSLv3`, `TLSv1`, `TLSv1.1`, `TLSv1.2`. Defaults to `TLSv1.2`, `TLSv1.1`,
  963. `TLSv1`.
  964. +
  965. --
  966. NOTE: If `xpack.security.fips_mode.enabled` is `true`, you cannot use `SSLv2Hello`
  967. or `SSLv3`. See <<fips-140-compliance>>.
  968. --
  969. `xpack.ssl.client_authentication`::
  970. Controls the server's behavior in regard to requesting a certificate
  971. from client connections. Valid values are `required`, `optional`, and `none`.
  972. `required` forces a client to present a certificate, while `optional`
  973. requests a client certificate but the client is not required to present one.
  974. Defaults to `required`. This global setting is not applicable for HTTP, see
  975. <<http-tls-ssl-settings>>.
  976. `xpack.ssl.verification_mode`::
  977. Controls the verification of certificates. Valid values are:
  978. - `full`, which verifies that the provided certificate is signed by a trusted
  979. authority (CA) and also verifies that the server's hostname (or IP
  980. address) matches the names identified within the certificate.
  981. - `certificate`, which verifies that the provided certificate is signed by a
  982. trusted authority (CA), but does not perform any hostname verification.
  983. - `none`, which performs _no verification_ of the server's certificate. This mode
  984. disables many of the security benefits of SSL/TLS and should only be
  985. used after very careful consideration. It is primarily intended as a
  986. temporary diagnostic mechanism when attempting to resolve TLS errors,
  987. and its use on production clusters is strongly discouraged.
  988. +
  989. The default value is `full`.
  990. `xpack.ssl.cipher_suites`::
  991. Supported cipher suites can be found in Oracle's http://docs.oracle.com/javase/8/docs/technotes/guides/security/SunProviders.html[
  992. Java Cryptography Architecture documentation]. Defaults to `TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256`,
  993. `TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256`, `TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA`, `TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA`,
  994. `TLS_RSA_WITH_AES_128_CBC_SHA256`, `TLS_RSA_WITH_AES_128_CBC_SHA`. If the _Java Cryptography Extension (JCE) Unlimited Strength
  995. Jurisdiction Policy Files_ has been installed, the default value also includes `TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384`,
  996. `TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384`, `TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA`, `TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA`,
  997. `TLS_RSA_WITH_AES_256_CBC_SHA256`, `TLS_RSA_WITH_AES_256_CBC_SHA`.
  998. [float]
  999. [[tls-ssl-key-settings]]
  1000. ===== Default TLS/SSL key and trusted certificate settings
  1001. The following settings are used to specify a private key, certificate, and the
  1002. trusted certificates that should be used when communicating over an SSL/TLS connection.
  1003. If none of the settings below are specified, this will default to the <<ssl-tls-settings, {xpack}
  1004. defaults>>. If no trusted certificates are configured, the default certificates that are trusted by the JVM will be
  1005. trusted along with the certificate(s) from the <<tls-ssl-key-settings, key settings>>. The key and certificate must be in place
  1006. for connections that require client authentication or when acting as a SSL enabled server.
  1007. [float]
  1008. ===== PEM encoded files
  1009. When using PEM encoded files, use the following settings:
  1010. `xpack.ssl.key`::
  1011. Path to the PEM encoded file containing the private key.
  1012. `xpack.ssl.key_passphrase`::
  1013. The passphrase that is used to decrypt the private key. This value is
  1014. optional as the key might not be encrypted.
  1015. `xpack.ssl.secure_key_passphrase` (<<secure-settings,Secure>>)::
  1016. The passphrase that is used to decrypt the private key. This value is
  1017. optional as the key might not be encrypted.
  1018. `xpack.ssl.certificate`::
  1019. Path to a PEM encoded file containing the certificate (or certificate chain)
  1020. that will be presented to clients when they connect.
  1021. `xpack.ssl.certificate_authorities`::
  1022. List of paths to the PEM encoded certificate files that should be trusted.
  1023. [float]
  1024. ===== Java keystore files
  1025. When using Java keystore files (JKS), which contain the private key, certificate
  1026. and certificates that should be trusted, use the following settings:
  1027. `xpack.ssl.keystore.path`::
  1028. Path to the keystore that holds the private key and certificate.
  1029. `xpack.ssl.keystore.password`::
  1030. Password to the keystore.
  1031. `xpack.ssl.keystore.secure_password` (<<secure-settings,Secure>>)::
  1032. Password to the keystore.
  1033. `xpack.ssl.keystore.key_password`::
  1034. Password for the private key in the keystore. Defaults to the
  1035. same value as `xpack.ssl.keystore.password`.
  1036. `xpack.ssl.keystore.secure_key_password` (<<secure-settings,Secure>>)::
  1037. Password for the private key in the keystore.
  1038. `xpack.ssl.truststore.path`::
  1039. Path to the truststore file.
  1040. `xpack.ssl.truststore.password`::
  1041. Password to the truststore.
  1042. `xpack.ssl.truststore.secure_password` (<<secure-settings,Secure>>)::
  1043. Password to the truststore.
  1044. WARNING: If `xpack.security.fips_mode.enabled` is `true`, you cannot use Java
  1045. keystore files. See <<fips-140-compliance>>.
  1046. [float]
  1047. ===== PKCS#12 files
  1048. When using PKCS#12 container files (`.p12` or `.pfx`), which contain the
  1049. private key, certificate, and certificates that should be trusted, use
  1050. the following settings:
  1051. `xpack.ssl.keystore.path`::
  1052. Path to the PKCS#12 file that holds the private key and certificate.
  1053. `xpack.ssl.keystore.type`::
  1054. Set this to `PKCS12`.
  1055. `xpack.ssl.keystore.password`::
  1056. Password to the PKCS#12 file.
  1057. `xpack.ssl.keystore.secure_password` (<<secure-settings,Secure>>)::
  1058. Password to the PKCS#12 file.
  1059. `xpack.ssl.keystore.key_password`::
  1060. Password for the private key in the PKCS12 file.
  1061. Defaults to the same value as `xpack.ssl.keystore.password`.
  1062. `xpack.ssl.keystore.secure_key_password` (<<secure-settings,Secure>>)::
  1063. Password for the private key in the PKCS12 file.
  1064. `xpack.ssl.truststore.path`::
  1065. Path to the truststore file.
  1066. `xpack.ssl.truststore.type`::
  1067. Set this to `PKCS12`.
  1068. `xpack.ssl.truststore.password`::
  1069. Password to the truststore.
  1070. `xpack.ssl.truststore.secure_password` (<<secure-settings,Secure>>)::
  1071. Password to the truststore.
  1072. WARNING: If `xpack.security.fips_mode.enabled` is `true`, you cannot use PKCS#12
  1073. keystore files. See <<fips-140-compliance>>.
  1074. [[pkcs12-truststore-note]]
  1075. [NOTE]
  1076. Storing trusted certificates in a PKCS#12 file, although supported, is
  1077. uncommon in practice. The {ref}/certutil.html[`elasticsearch-certutil`] tool,
  1078. as well as Java's `keytool`, are designed to generate PKCS#12 files that
  1079. can be used both as a keystore and as a truststore, but this may not be the
  1080. case for container files that are created using other tools. Usually,
  1081. PKCS#12 files only contain secret and private entries. To confirm that
  1082. a PKCS#12 container includes trusted certificate ("anchor") entries look for
  1083. `2.16.840.1.113894.746875.1.1: <Unsupported tag 6>` in the
  1084. `openssl pkcs12 -info` output, or `trustedCertEntry` in the
  1085. `keytool -list` output.
  1086. [float]
  1087. ===== PKCS#11 tokens
  1088. When using a PKCS#11 cryptographic token, which contains the
  1089. private key, certificate, and certificates that should be trusted, use
  1090. the following settings:
  1091. `xpack.ssl.keystore.type`::
  1092. Set this to `PKCS11`.
  1093. `xpack.ssl.truststore.type`::
  1094. Set this to `PKCS11`.
  1095. [[pkcs11-truststore-note]]
  1096. [NOTE]
  1097. When configuring the PKCS#11 token that your JVM is configured to use as
  1098. a keystore or a truststore for Elasticsearch, the PIN for the token can be
  1099. configured by setting the appropriate value to `xpack.ssl.truststore.password`
  1100. or `xpack.ssl.truststore.secure_password`. In the absence of the above, {es} will
  1101. fallback to use he appropriate JVM setting (`-Djavax.net.ssl.trustStorePassword`)
  1102. if that is set.
  1103. Since there can only be one PKCS#11 token configured, only one keystore and
  1104. truststore will be usable for configuration in {es}. This in turn means
  1105. that only one certificate can be used for TLS both in the transport and the
  1106. http layer.
  1107. [[http-tls-ssl-settings]]
  1108. :ssl-prefix: xpack.security.http
  1109. :component: HTTP
  1110. :client-auth-default: none
  1111. :verifies!:
  1112. :server:
  1113. include::ssl-settings.asciidoc[]
  1114. [[transport-tls-ssl-settings]]
  1115. :ssl-prefix: xpack.security.transport
  1116. :component: Transport
  1117. :client-auth-default!:
  1118. :verifies:
  1119. :server:
  1120. include::ssl-settings.asciidoc[]
  1121. [[ssl-tls-profile-settings]]
  1122. [float]
  1123. ===== Transport profile TLS/SSL settings
  1124. The same settings that are available for the <<transport-tls-ssl-settings, default transport>>
  1125. are also available for each transport profile. By default, the settings for a
  1126. transport profile will be the same as the default transport unless they
  1127. are specified.
  1128. As an example, lets look at the key setting. For the default transport
  1129. this is `xpack.security.transport.ssl.key`. In order to use this setting in a
  1130. transport profile, use the prefix `transport.profiles.$PROFILE.xpack.security.` and
  1131. append the portion of the setting after `xpack.security.transport.`. For the key
  1132. setting, this would be `transport.profiles.$PROFILE.xpack.security.ssl.key`.
  1133. [[auditing-tls-ssl-settings]]
  1134. :ssl-prefix: xpack.security.audit.index.client.xpack
  1135. :component: Auditing
  1136. :client-auth-default!:
  1137. :server!:
  1138. include::ssl-settings.asciidoc[]
  1139. See also <<remote-audit-settings>>.
  1140. [float]
  1141. [[ip-filtering-settings]]
  1142. ==== IP filtering settings
  1143. You can configure the following settings for {xpack-ref}/ip-filtering.html[IP filtering].
  1144. `xpack.security.transport.filter.allow`::
  1145. List of IP addresses to allow.
  1146. `xpack.security.transport.filter.deny`::
  1147. List of IP addresses to deny.
  1148. `xpack.security.http.filter.allow`::
  1149. List of IP addresses to allow just for HTTP.
  1150. `xpack.security.http.filter.deny`::
  1151. List of IP addresses to deny just for HTTP.
  1152. `transport.profiles.$PROFILE.xpack.security.filter.allow`::
  1153. List of IP addresses to allow for this profile.
  1154. `transport.profiles.$PROFILE.xpack.security.filter.deny`::
  1155. List of IP addresses to deny for this profile.
  1156. include::security-hash-settings.asciidoc[]