Skip to content

Commit 3991350

Browse files
committed
Added the steps for field-level security configuration + screenshots
1 parent 2f1bf7c commit 3991350

5 files changed

+41
-2
lines changed
31.8 KB
Loading
46.6 KB
Loading
46.1 KB
Loading
47 KB
Loading

deploy-manage/users-roles/cluster-or-deployment-auth/controlling-access-at-document-field-level.md

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,20 +210,29 @@ To configure document-level security (DLS), you create a custom role where you d
210210
1. Go to the **Custom Roles** page using the navigation menu or the [global search field](/explore-analyze/find-and-organize/find-apps-and-objects.md).
211211
1. Select **Create role**.
212212
1. Give your custom role a meaningful name and description.
213-
1. In the **Index privileges** area, specify the data stream pattern, For example, enter `events-*`.
213+
1. In the **Index privileges** area, specify the data stream pattern and the privilege you want to grant. For example, enter `events-*` and `read`.
214214
1. Enable the **Grant read privileges to specific documents** toggle and add your query using the QueryDSL syntax.
215-
* For example, to allow read access only to documents that belong to the click category within all the events-* data streams, enter the following query:
215+
* For example, to allow read access only to documents that belong to the click category within all the `events-*` data streams, enter the following query:
216216
```
217217
{
218218
"match" : { "category" : “click” }
219219
}
220220
```
221+
222+
:::{image} /deploy-manage/images/serverless-custom-role-document-level-privileges-ex-1.png
223+
:title: Configuring document-level security
224+
:::
225+
221226
* To allow read access only to the documents whose `department_id` equals 12, enter the following query:
222227
```
223228
{
224229
"term" : { "department_id" : 12 }
225230
}
226231
```
232+
233+
:::{image} /deploy-manage/images/serverless-custom-role-document-level-privileges-ex-2.png
234+
:title: Configuring document-level security another example
235+
:::
227236
228237
1. Optional: To grant this role access to {{kib}} spaces for feature access and visibility, click **Assign to this space**. Specify the level of access required and click **Assign role**.
229238
1. Select **Create role** to save your custom role.
@@ -421,6 +430,36 @@ The resulting permission is equal to:
421430
Field-level security should not be set on [`alias`](elasticsearch://reference/elasticsearch/mapping-reference/field-alias.md) fields. To secure a concrete field, its field name must be used directly.
422431
::::
423432

433+
### Configuring field-level security in {{serverless-short}} [field-level-serverless]
434+
```{applies_to}
435+
serverless: ga
436+
```
437+
438+
As an administrator, you can create custom roles that enable users to access data and project features. When you create a custom role, you can assign {{es}} [cluster](/deploy-manage/users-roles/serverless-custom-roles.md#custom-roles-es-cluster-privileges) and [index](/deploy-manage/users-roles/serverless-custom-roles.md#custom-roles-es-index-privileges) privileges and [{{kib}}](/deploy-manage/users-roles/serverless-custom-roles.md#custom-roles-kib-privileges) privileges.
439+
440+
To configure field-level security (FLS), you create a custom role where you define the specific fields that this role grants or denies access to:
441+
442+
1. Go to the **Custom Roles** page using the navigation menu or the [global search field](/explore-analyze/find-and-organize/find-apps-and-objects.md).
443+
1. Select **Create role**.
444+
1. Give your custom role a meaningful name and description.
445+
1. In the **Index privileges** area, specify the data stream pattern and the privilege you want to grant. For example, enter `events-*` and `read`.
446+
1. Enable the **Grant access to specific fields** toggle.
447+
* To grant access to specific fields within each document in all the `events-*` data streams, add the fields to the **Granted fields** list. For example, you can add `category`, `@timestamp`, and `message` as individual fields, or you can specify a field expression such as `event_*` that grants read access to all the fields that start with an `event_` prefix.
448+
449+
:::{image} /deploy-manage/images/serverless-custom-role-grant-field-level-privileges.png
450+
:title: Configuring field-level security by granting access to fields
451+
:::
452+
453+
* To deny access to specific fields within each document, add the fields to the **Denied fields** list. For example, you can add the `customer.handle` field.
454+
455+
:::{image} /deploy-manage/images/serverless-custom-role-deny-field-level-privileges.png
456+
:title: Configuring field-level security by denying access to fields
457+
:::
458+
459+
1. Optional: To grant this role access to {{kib}} spaces for feature access and visibility, click **Assign to this space**. Specify the level of access required and click **Assign role**.
460+
1. Select **Create role** to save your custom role.
461+
462+
424463
## Multiple roles with document and field level security [multiple-roles-dls-fls]
425464

426465
A user can have many roles and each role can define different permissions on the same data stream or index. When assigning users multiple roles, be careful that you don’t inadvertently grant wider access than intended.

0 commit comments

Comments
 (0)