security-settings.asciidoc 58 KB

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