-
Notifications
You must be signed in to change notification settings - Fork 179
Add Details About username_rdn_name and username_rdn_oid to PKI Security Doc #4022
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 2 commits
bb53b30
7407abc
63764e0
c717dcc
8306f98
a78bf13
fc077f5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -44,24 +44,51 @@ To use PKI in {{es}}, you configure a PKI realm, enable client authentication on | |||||
| When you configure realms in `elasticsearch.yml`, only the realms you specify are used for authentication. If you also want to use the `native` or `file` realms, you must include them in the realm chain. | ||||||
| :::: | ||||||
|
|
||||||
| 2. Optional: The username is defined by the [username_pattern](elasticsearch://reference/elasticsearch/configuration-reference/security-settings.md#ref-pki-settings). If you want to use something other than the CN of the Subject DN as the username, you can specify a regex to extract the desired username. The regex is applied on the Subject DN. | ||||||
|
|
||||||
| For example, the regex in the following configuration extracts the email address from the Subject DN: | ||||||
|
|
||||||
| ```yaml | ||||||
| xpack: | ||||||
| security: | ||||||
| authc: | ||||||
| realms: | ||||||
| pki: | ||||||
| pki1: | ||||||
| order: 1 | ||||||
| username_pattern: "EMAILADDRESS=(.*?)(?:,|$)" | ||||||
| ``` | ||||||
|
|
||||||
| ::::{note} | ||||||
| If the regex is too restrictive and does not match the Subject DN of the client’s certificate, then the realm does not authenticate the certificate. | ||||||
| :::: | ||||||
| 2. Optional: The username is defined by the [username_pattern](https://docs-v3-preview.elastic.dev/elastic/elasticsearch/tree/main/reference/elasticsearch/configuration-reference/security-settings#ref-pki-settings). If you want to use something other than the CN of the Subject DN as the username, you can use one of the following methods to extract the username: | ||||||
|
|
||||||
| * {applies_to}`stack: ga 9.1` Extract the username from a specific RDN attribute in the Subject DN. | ||||||
ebarlas marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||
| * Specify a regex to extract the desired username. The regex is applied on the Subject DN. | ||||||
ebarlas marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||||||
|
|
||||||
| :::::{tab-set} | ||||||
|
|
||||||
| ::::{tab-item} Specific RDN attribute | ||||||
| The username can be extracted from a specific RDN attribute in the Subject DN by using [username_rdn_name](elasticsearch://reference/elasticsearch/configuration-reference/security-settings.md#ref-pki-settings) or [username_rdn_oid](elasticsearch://reference/elasticsearch/configuration-reference/security-settings.md#ref-pki-settings). When an RDN attribute configuration is provided, it supersedes `username_pattern`. | ||||||
|
|
||||||
| For example, to extract the username from the `CN` RDN attribute: | ||||||
|
|
||||||
| ```yaml | ||||||
| xpack: | ||||||
| security: | ||||||
| authc: | ||||||
| realms: | ||||||
| pki: | ||||||
| pki1: | ||||||
| order: 1 | ||||||
| username_rdn_name: "CN" | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. qq: does this just replicate the default behavior (the CN of the Subject DN as the username)? we might want to choose a different field to display in the example
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, it does. There's a subtlety here, which is that we'd eventually like to deprecate the pattern-based configuration. So, eventually, the |
||||||
| ``` | ||||||
| :::: | ||||||
|
|
||||||
| ::::{tab-item} Regex | ||||||
| Specify a regex to extract the desired username. The regex is applied on the Subject DN. | ||||||
|
||||||
| Specify a regex to extract the desired username. The regex is applied on the Subject DN. | |
| Using the [[username_pattern](elasticsearch://reference/elasticsearch/configuration-reference/security-settings.md#ref-pki-settings) setting, specify a regex to extract the desired username. The regex is applied on the Subject DN. The regex is applied on the Subject DN. |
Uh oh!
There was an error while loading. Please reload this page.