Skip to content

Commit 7dee198

Browse files
ywangdAdam Locketvernumalbertzaharovits
authored
User Profile: Initial beta overview documentations (#83766)
Add initial feature overview documentation pages for User Profile and Security Domain. Co-authored-by: Adam Locke <[email protected]> Co-authored-by: Tim Vernum <[email protected]> Co-authored-by: Albert Zaharovits <[email protected]>
1 parent f60a410 commit 7dee198

File tree

9 files changed

+234
-10
lines changed

9 files changed

+234
-10
lines changed

docs/reference/settings/security-settings.asciidoc

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,30 @@ The hashing algorithm that is used for the
193193
in-memory cached API key credentials. For possible values, see <<cache-hash-algo>>.
194194
Defaults to `ssha256`.
195195

196+
ifeval::["{release-state}"!="released"]
197+
[discrete]
198+
[[security-domain-settings]]
199+
==== Security domain settings
200+
// tag::security-domain-settings-description-tag[]
201+
You configure security domain settings in the `xpack.security.authc.domains`
202+
namespace in `elasticsearch.yml`.
203+
204+
For example:
205+
206+
[source, yaml]
207+
------------------------------------------------------------
208+
xpack:
209+
security:
210+
authc:
211+
domains:
212+
my_domain: <1>
213+
realms: [ 'default_native', 'saml1' ] <2>
214+
------------------------------------------------------------
215+
<1> Specifies the name of the security domain
216+
<2> Specifies the realms that belong to the domain
217+
// end::security-domain-settings-description-tag[]
218+
endif::[]
219+
196220
[discrete]
197221
[[realm-settings]]
198222
==== Realm settings

x-pack/docs/en/rest-api/security.asciidoc

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -132,21 +132,21 @@ communicate with a secured {es} cluster.
132132
* <<security-api-node-enrollment, Enroll a new node>>
133133
* <<security-api-kibana-enrollment, Enroll a new {kib} instance>>
134134

135+
ifeval::["{release-state}"!="released"]
135136
[discrete]
136137
[[security-user-profile-apis]]
137138
=== User Profile
138139

139140
Use the following APIs to retrieve and manage user profiles.
140141

141-
* <<security-api-activiate-user-profile, Activate user profile>>
142+
* <<security-api-activate-user-profile, Activate user profile>>
142143
* <<security-api-get-user-profile, Get user profile>>
143144
* <<security-api-update-user-profile-data, Update user profile data>>
144145
* <<security-api-enable-user-profile, Enable user profile>>
145146
* <<security-api-disable-user-profile, Disable user profile>>
146147
* <<security-api-suggest-user-profile, Suggest user profile>>
148+
endif::[]
147149

148-
149-
include::security/activate-user-profile.asciidoc[]
150150
include::security/authenticate.asciidoc[]
151151
include::security/change-password.asciidoc[]
152152
include::security/clear-cache.asciidoc[]
@@ -168,8 +168,6 @@ include::security/delete-service-token.asciidoc[]
168168
include::security/delete-users.asciidoc[]
169169
include::security/disable-users.asciidoc[]
170170
include::security/enable-users.asciidoc[]
171-
include::security/disable-user-profile.asciidoc[]
172-
include::security/enable-user-profile.asciidoc[]
173171
include::security/enroll-kibana.asciidoc[]
174172
include::security/enroll-node.asciidoc[]
175173
include::security/get-api-keys.asciidoc[]
@@ -181,7 +179,7 @@ include::security/get-service-accounts.asciidoc[]
181179
include::security/get-service-credentials.asciidoc[]
182180
include::security/get-tokens.asciidoc[]
183181
include::security/get-user-privileges.asciidoc[]
184-
include::security/get-user-profile.asciidoc[]
182+
185183
include::security/get-users.asciidoc[]
186184
include::security/grant-api-keys.asciidoc[]
187185
include::security/has-privileges.asciidoc[]
@@ -198,5 +196,11 @@ include::security/saml-invalidate-api.asciidoc[]
198196
include::security/saml-complete-logout-api.asciidoc[]
199197
include::security/saml-sp-metadata.asciidoc[]
200198
include::security/ssl.asciidoc[]
199+
ifeval::["{release-state}"!="released"]
200+
include::security/activate-user-profile.asciidoc[]
201+
include::security/disable-user-profile.asciidoc[]
202+
include::security/enable-user-profile.asciidoc[]
203+
include::security/get-user-profile.asciidoc[]
201204
include::security/suggest-user-profile.asciidoc[]
202205
include::security/update-user-profile-data.asciidoc[]
206+
endif::[]

x-pack/docs/en/rest-api/security/activate-user-profile.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[role="xpack"]
2-
[[security-api-activiate-user-profile]]
2+
[[security-api-activate-user-profile]]
33
=== Activate user profile API
44
++++
55
<titleabbrev>Activate user profile</titleabbrev>

x-pack/docs/en/rest-api/security/disable-user-profile.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ To use this API, you must have the `manage_user_profile` cluster privilege.
2525
[[security-api-disable-user-profile-desc]]
2626
==== {api-description-title}
2727

28-
When you <<security-api-activiate-user-profile,activate a user profile>>, it's
28+
When you <<security-api-activate-user-profile,activate a user profile>>, it's
2929
automatically enabled and visible in user profile searches. You can use the
3030
disable user profile API to disable a user profile so it's not visible in
3131
these searches.

x-pack/docs/en/rest-api/security/enable-user-profile.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ To use this API, you must have the `manage_user_profile` cluster privilege.
2525
[[security-api-enable-user-profile-desc]]
2626
==== {api-description-title}
2727

28-
When you <<security-api-activiate-user-profile,activate a user profile>>, it's
28+
When you <<security-api-activate-user-profile,activate a user profile>>, it's
2929
automatically enabled and visible in user profile searches. If you later
3030
<<security-api-disable-user-profile,disable the user profile>>, you can use the
3131
enable user profile API to make the profile visible in these searches again.

x-pack/docs/en/rest-api/security/get-user-profile.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Retrieves a user's profile using the unique profile ID.
2525

2626
The get user profile API returns the user profile document matching a specified
2727
`uid`, which is generated when
28-
<<security-api-activiate-user-profile,activating a user profile>>.
28+
<<security-api-activate-user-profile,activating a user profile>>.
2929

3030
[[security-api-get-user-profile-path-params]]
3131
==== {api-path-parms-title}

x-pack/docs/en/security/authentication/overview.asciidoc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,14 @@ include::built-in-users.asciidoc[][]
3636
include::service-accounts.asciidoc[]
3737
include::internal-users.asciidoc[]
3838
include::token-authentication-services.asciidoc[]
39+
ifeval::["{release-state}"!="released"]
40+
include::user-profile.asciidoc[]
41+
endif::[]
3942
include::realms.asciidoc[]
4043
include::realm-chains.asciidoc[]
44+
ifeval::["{release-state}"!="released"]
45+
include::security-domain.asciidoc[]
46+
endif::[]
4147
include::active-directory-realm.asciidoc[]
4248
include::file-realm.asciidoc[]
4349
include::ldap-realm.asciidoc[]
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
[role="xpack"]
2+
[[security-domain]]
3+
=== Security domains
4+
5+
beta::[]
6+
7+
Security domains are a method of grouping multiple <<realms,realms>> under the
8+
same domain so that the {stack} can recognize when a single user authenticates
9+
with these realms. Users can authenticate with any of the realms in the domain
10+
group, and have access to the same set of resources regardless of which realm
11+
they authenticated with.
12+
13+
For example, a single <<user-profile,user profile>> is associated with a user,
14+
enabling preferences, notifications, and other user data to be shared across
15+
realms. The user can view results from an asynchronous search request or a
16+
scrolling search across realms. If the user has the necessary privileges, they
17+
can also view and manage API keys across realms.
18+
19+
[[security-domain-resource-sharing]]
20+
==== Resource sharing across domains
21+
Some types of resources in {es} are owned by a single user, such as
22+
<<async-search,async search contexts>>, <<security-api-create-api-key,API keys>>,
23+
and <<user-profile,user profiles>>. When a user creates a resource, {es}
24+
captures the user's username and realm information as part of the resource's
25+
metadata.
26+
27+
When a user later attempts to access the resource, {es} compares
28+
the captured username and realm information against those from the accessing
29+
user. {es} will deny access unless both the realm and username match.
30+
If {es} detects that a username from two different realms is
31+
attempting to access a resource, {es} assumes that these users are distinct and
32+
doesn't allow resources to be shared between those users.
33+
34+
However, there are cases where the same user can authenticate with
35+
multiple realms and needs to share the same set of resources across realms.
36+
For example, an <<ldap-realm,LDAP realm>> and a <<saml-realm,SAML realm>> can
37+
be backed by the same directory service. Additionally,
38+
<<configuring-authorization-delegation,authorization delegation>> allows one
39+
realm to delegate authorization to another realm. If both realms authenticate
40+
users with the same username, it's reasonable to treat these users as the
41+
same user from a resource ownership perspective.
42+
43+
Security domains make resource sharing across realms possible by grouping those
44+
realms under the same domain. {es} always enforces the privileges that are
45+
associated with the currently authenticated user, which remains true with
46+
security domains. Security domains don't bypass
47+
<<authorization,user authorization>> when resource sharing requires them. For
48+
example, a user requires the `manage_own_api_key` privilege to manage their own
49+
API keys. If that user doesn't have this privilege when authenticating with one
50+
realm, they won't be able to manage API keys while authenticating with another
51+
realm.
52+
53+
[[security-domain-realm-roles]]
54+
===== Managing roles across realms
55+
{es} provides multiple ways to consistently apply roles across realms. For example, you can use
56+
<<configuring-authorization-delegation,authorization delegation>> to
57+
ensure that a user is assigned the same roles from multiple realms. You can also
58+
manually configure multiple realms that are backed by the same directory service.
59+
Though it's possible to configure different <<roles,roles>> for the same user
60+
when authenticating with different realms, it is _not_ recommended.
61+
62+
[[security-domain-configure]]
63+
==== Configure a security domain
64+
65+
You configure realms to be under a domain in `elasticsearch.yml`. The realms must
66+
be defined in `elasticsearch.yml` but do not need to be enabled.
67+
68+
NOTE: The <<file-realm,file realm>> and <<native-realm,native realm>> are
69+
automatically enabled as `default_file` and `default_native`, respectively,
70+
without any explicit configuration. You can list these realms under domains even
71+
when they are not explicitly defined in `elasticsearch.yml`.
72+
73+
. Add a security domain configuration to `elasticsearch.yml` under the
74+
`xpack.security.authc.domains` namespace:
75+
+
76+
[source, yaml]
77+
----
78+
xpack:
79+
security:
80+
authc:
81+
domains:
82+
my_domain:
83+
realms: [ 'default_native', 'saml1' ] <1>
84+
----
85+
<1> This configuration defines a security domain called `my_domain`, which
86+
contains two realms named `default_native` and `saml1`.
87+
88+
. Restart {es}.
89+
90+
[IMPORTANT]
91+
====
92+
{es} can fail to start if the domain configuration is invalid, such as:
93+
94+
* A single realm is configured under multiple domains.
95+
* Any undefined realm, synthetic realm, or the reserved realm is configured to
96+
be under a domain.
97+
====
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
[role="xpack"]
2+
[[user-profile]]
3+
=== User profiles
4+
5+
beta::[]
6+
7+
Because the {stack} supports externally-managed users (such as users who
8+
authenticate via SAML, or users stored in an LDAP directory), there's a
9+
distinction between _users_ and their _profile_.
10+
11+
_Users_ refer to the entities that authenticate requests to the {stack}.
12+
Each user has a username and a set of privileges (represented by <<roles,roles>>)
13+
that determine which types of requests they can issue. Users can be ephemeral;
14+
they might exist only for the duration of a request to an {es} API or for the
15+
lifetime of a session in {kib}. These users cannot be retrieved after the session
16+
ends, and can't store preferences across sessions.
17+
18+
_User profiles_ provide persistent and stable representations of users.
19+
A user profile exists even if the user is offline, so their profile persists across sessions.
20+
The unique identifier assigned to each profile doesn't change
21+
throughout the lifetime of a deployment, providing a stable way of referring
22+
to the associated user. Each profile has a unique identifier, is searchable, and
23+
can store user data such as format and notification preferences.
24+
25+
The capability of uniquely referring to users regardless of whether they're
26+
actively online is a critical function that underpins important features like
27+
personalization and collaboration in {kib}.
28+
29+
30+
==== User profiles in {kib}
31+
32+
A user profile is the persistent record that the {stack} stores for each
33+
interactive user that authenticates to {kib}.
34+
35+
When a user logs in to {kib}, a profile is automatically created for the user,
36+
or an existing profile is updated to reflect the user's active session.
37+
By using the unique ID of the user profile, {kib} can store user-level data such as preferences
38+
separately for each user, which is key to fine-grained levels of customization.
39+
{kib} uses this unique ID to route messages and notifications to a distinct user,
40+
regardless of whether they're logged in.
41+
42+
===== Usernames and user profiles
43+
44+
You can use the same username across multiple realms for a single user. In {es},
45+
it's possible for two different realms to authenticate users with the same username
46+
and different roles.
47+
{es} doesn't assume that these users are the same person, and treats
48+
them as separate individuals with distinct user profiles by default.
49+
50+
NOTE: For use cases where one individual can authenticate against
51+
multiple realms, you can use the <<security-domain,security domain>> feature
52+
so that these distinct users are considered to be the same identity
53+
and share a single user profile.
54+
55+
==== Create and manage user profiles
56+
57+
To create a new user profile or update an existing one, use the
58+
<<security-api-activate-user-profile,activate user profile API>>. When you
59+
submit a request, {es} attempts to locate an existing profile document for the
60+
specified user. If one doesn't exist, {es} creates a new profile document.
61+
62+
In either case, the profile document captures the user's `full_name`, `email`,
63+
`roles`, and `realms`, and also includes the profile unique ID and timestamp of
64+
the operation. You can retrieve a user profile with
65+
the <<security-api-get-user-profile,get user profile API>> by including the
66+
profile's unique ID (`uid`).
67+
68+
In addition to the user's basic information, you can add data to a profile document
69+
with the <<security-api-update-user-profile-data,update user profile API>>. For
70+
example, you can add user-specific preferences as part of the profile data.
71+
72+
Use the <<security-api-suggest-user-profile,search user profile API>> to search profiles
73+
that match given criteria. This search API is designed to support user-suggestions,
74+
in collaboration with features such as those found in {kib}.
75+
However, the search user profile API is not intended to provide a general-purpose search API.
76+
77+
==== Limitations
78+
79+
* Creating a new user profile requires a user's authentication details
80+
(`username` and `password` or its
81+
<<token-authentication-services,OAuth2 access token>>).
82+
This means that a user must authenticate at least one time to create a
83+
user profile. Users who have never authenticated to {kib}
84+
(or another profile-aware application) won't have a user profile, and the
85+
<<security-api-suggest-user-profile,search user profile API>> won't return
86+
any results for those users.
87+
88+
* User profiles are meant for interactive users, such as a human user who
89+
interacts with {kib}. Therefore, user profiles don't support API keys or
90+
<<service-accounts,service accounts>>.
91+
+
92+
NOTE: <<token-authentication-services,OAuth2 tokens>> that represent an
93+
interactive end-user are supported.

0 commit comments

Comments
 (0)