security-settings.asciidoc 59 KB

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