Skip to content
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

Reorganize Configuration section of the Security TOC #2212

Merged
merged 13 commits into from
Jan 27, 2023
10 changes: 5 additions & 5 deletions _security-plugin/access-control/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
layout: default
title: API
parent: Access control
nav_order: 90
nav_order: 120
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generic question: Changing nav_order will re-organize this document based on the value entered. Correct?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it's the method for ordering topics in the TOC. This is how the TOC will look after merging this PR.
SEC_TOC
I will be breaking out two new sections for "Authentication Backends" once this is merged and the new structure is in place (Basic Authentication and JWT). But it doesn't make sense to do it in this PR, or until the new structure is in place. Once the review is complete for this, I'll get started on that.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oo nice..thank you for sharing the final view. This helps a lot in visualizing the "re-organization" of the Security Plugin section

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. It helps.

---

# API
Expand Down Expand Up @@ -678,11 +678,11 @@ PUT _plugins/_security/api/roles/<role>
}
```

>Due to word boundaries associated with Unicode special characters, the Unicode standard analyzer cannot index a [text field type](https://opensearch.org/docs/2.2/opensearch/supported-field-types/text/) value as a whole value when it includes one of these special characters. As a result, a text field value that includes a special character is parsed by the standard analyzer as multiple values separated by the special character, effectively tokenizing the different elements on either side of it.
>Due to word boundaries associated with Unicode special characters, the Unicode standard analyzer cannot index a [text field type]({{site.url}}{{site.baseurl}}/opensearch/supported-field-types/text/) value as a whole value when it includes one of these special characters. As a result, a text field value that includes a special character is parsed by the standard analyzer as multiple values separated by the special character, effectively tokenizing the different elements on either side of it.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any automation in place to warn against the use of specific version urls?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe we're using an automated link checker now. Not sure if it would identify this specific problem. But will look into it.

>
>For example, since the values in the fields ```"user.id": "User-1"``` and ```"user.id": "User-2"``` contain the hyphen/minus sign, this special character will prevent the analyzer from distinguishing between the two different users for `user.id` and interpret them as one and the same. This can lead to unintentional filtering of documents and potentially compromise control over their access.
>
>To avoid this circumstance, you can use a custom analyzer or map the field as `keyword`, which performs an exact-match search. See [Keyword field type](https://opensearch.org/docs/2.2/opensearch/supported-field-types/keyword/) for the latter option.
>To avoid this circumstance, you can use a custom analyzer or map the field as `keyword`, which performs an exact-match search. See [Keyword field type]({{site.url}}{{site.baseurl}}/opensearch/supported-field-types/keyword/) for the latter option.
>
>For a list of characters that should be avoided when field type is `text`, see [Word Boundaries](https://unicode.org/reports/tr29/#Word_Boundaries).
{: .warning}
Expand Down Expand Up @@ -1424,7 +1424,7 @@ The following API is available for audit logging in the security plugin.

This API allows you to enable or disable audit logging, define the configuration for audit logging and compliance, and make updates to settings.

For details on using audit logging to track access to OpenSearch clusters, as well as information on further configurations, see [Audit logs](https://opensearch.org/docs/latest/security-plugin/audit-logs/index/).
For details on using audit logging to track access to OpenSearch clusters, as well as information on further configurations, see [Audit logs]({{site.url}}{{site.baseurl}}/security-plugin/audit-logs/index/).

You can do an initial configuration of audit logging in the `audit.yml` file, found in the `opensearch-project/security/config` directory. Thereafter, you can use the REST API or Dashboards for further changes to the configuration.
{: note.}
Expand Down Expand Up @@ -1525,7 +1525,7 @@ PUT /_opendistro/_security/api/audit/config

A PATCH call is used to update specified fields in the audit configuration. The PATCH method requires an operation, a path, and a value to complete a valid request. For details on using the PATCH method, see the following [Patching resources](https://en.wikipedia.org/wiki/PATCH_%28HTTP%29#Patching_resources) description at Wikipedia.

Using the PATCH method also requires a user to have a security configuration that includes admin certificates for encryption. To find out more about these certificates, see [Configure admin certificates](https://opensearch.org/docs/latest/security-plugin/configuration/tls/#configure-admin-certificates).
Using the PATCH method also requires a user to have a security configuration that includes admin certificates for encryption. To find out more about these certificates, see [Configure admin certificates]({{site.url}}{{site.baseurl}}/security-plugin/configuration/tls/#configure-admin-certificates).

```bash
curl -X PATCH -k -i --cert <admin_cert file name> --key <admin_cert_key file name> <domain>/_opendistro/_security/api/audit -H 'Content-Type: application/json' -d'[{"op":"add","path":"/config/enabled","value":"true"}]'
Expand Down
2 changes: 1 addition & 1 deletion _security-plugin/access-control/cross-cluster-search.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
layout: default
title: Cross-cluster search
parent: Access control
nav_order: 40
nav_order: 105
---

# Cross-cluster search
Expand Down
2 changes: 1 addition & 1 deletion _security-plugin/access-control/default-action-groups.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
layout: default
title: Default action groups
parent: Access control
nav_order: 51
nav_order: 115
---

# Default action groups
Expand Down
8 changes: 4 additions & 4 deletions _security-plugin/access-control/document-level-security.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
layout: default
title: Document-level security
parent: Access control
nav_order: 10
nav_order: 85
---

# Document-level security (DLS)
Expand Down Expand Up @@ -57,7 +57,7 @@ These queries can be as complex as you want, but we recommend keeping them simpl

### A note on Unicode special characters in text fields

Due to word boundaries associated with Unicode special characters, the Unicode standard analyzer cannot index a [text field type](https://opensearch.org/docs/2.2/opensearch/supported-field-types/text/) value as a whole value when it includes one of these special characters. As a result, a text field value that includes a special character is parsed by the standard analyzer as multiple values separated by the special character, effectively tokenizing the different elements on either side of it. This can lead to unintentional filtering of documents and potentially compromise control over their access.
Due to word boundaries associated with Unicode special characters, the Unicode standard analyzer cannot index a [text field type]({{site.url}}{{site.baseurl}}/opensearch/supported-field-types/text/) value as a whole value when it includes one of these special characters. As a result, a text field value that includes a special character is parsed by the standard analyzer as multiple values separated by the special character, effectively tokenizing the different elements on either side of it. This can lead to unintentional filtering of documents and potentially compromise control over their access.

The examples below illustrate values containing special characters that will be parsed improperly by the standard analyzer. In this example, the existence of the hyphen/minus sign in the value prevents the analyzer from distinguishing between the two different users for `user.id` and interprets them as one and the same:

Expand Down Expand Up @@ -85,7 +85,7 @@ The examples below illustrate values containing special characters that will be
}
```

To avoid this circumstance when using either Query DSL or the REST API, you can use a custom analyzer or map the field as `keyword`, which performs an exact-match search. See [Keyword field type](https://opensearch.org/docs/2.2/opensearch/supported-field-types/keyword/) for the latter option.
To avoid this circumstance when using either Query DSL or the REST API, you can use a custom analyzer or map the field as `keyword`, which performs an exact-match search. See [Keyword field type]({{site.url}}{{site.baseurl}}/opensearch/supported-field-types/keyword/) for the latter option.

For a list of characters that should be avoided when field type is `text`, see [Word Boundaries](https://unicode.org/reports/tr29/#Word_Boundaries).

Expand Down Expand Up @@ -165,7 +165,7 @@ You can perform term-level lookup queries (TLQs) with document-level security (D

By default, the security plugin detects if a DLS query contains a TLQ or not and chooses the appropriate mode automatically at runtime.

To learn more about OpenSearch queries, see [Term-level queries](https://opensearch.org/docs/latest/opensearch/query-dsl/term/).
To learn more about OpenSearch queries, see [Term-level queries]({{site.url}}{{site.baseurl}}/opensearch/query-dsl/term/).

### How to set the DLS evaluation mode in `opensearch.yml`

Expand Down
4 changes: 2 additions & 2 deletions _security-plugin/access-control/field-level-security.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
layout: default
title: Field-level security
parent: Access control
nav_order: 11
nav_order: 90
---

# Field-level security
Expand Down Expand Up @@ -93,7 +93,7 @@ someonerole:

### REST API

See [Create role]({{site.url}}{{site.baseurl}}/security-plugin/access-control/api#create-role).
See [Create role]({{site.url}}{{site.baseurl}}/security-plugin/access-control/api/#create-role).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the addition of an extra slash when reference an ID on the API page?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apparently both ways work. I just followed the lead of the web server, which adds the forward slash when you use the link. The doc team informed me that behavior originates with the web server. In any case, I see now there's no need bothering to add it from now on. Thanks.



## Interaction with multiple roles
Expand Down
4 changes: 2 additions & 2 deletions _security-plugin/access-control/field-masking.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
layout: default
title: Field masking
parent: Access control
nav_order: 12
nav_order: 95
---

# Field masking
Expand Down Expand Up @@ -68,7 +68,7 @@ someonerole:

### REST API

See [Create role]({{site.url}}{{site.baseurl}}/security-plugin/access-control/api#create-role).
See [Create role]({{site.url}}{{site.baseurl}}/security-plugin/access-control/api/#create-role).


## (Advanced) Use an alternative hash algorithm
Expand Down
2 changes: 1 addition & 1 deletion _security-plugin/access-control/impersonation.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
layout: default
title: User impersonation
parent: Access control
nav_order: 20
nav_order: 100
---

# User impersonation
Expand Down
4 changes: 2 additions & 2 deletions _security-plugin/access-control/index.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
layout: default
title: Access control
nav_order: 30
nav_order: 75
has_children: true
has_toc: false
redirect_from:
Expand All @@ -10,7 +10,7 @@ redirect_from:

# Access control

After you [configure the security plugin]({{site.url}}{{site.baseurl}}/security-plugin/configuration/index/) to use your own certificates and preferred authentication backend, you can start adding users, creating roles, and mapping roles to users.
After you [configure the Security plugin]({{site.url}}{{site.baseurl}}/security-plugin/configuration/index/) to use your own certificates and preferred authentication backend, you can start adding users, creating roles, and mapping roles to users.

This section of the documentation covers what a user is allowed to see and do after successfully authenticating.

Expand Down
4 changes: 2 additions & 2 deletions _security-plugin/access-control/permissions.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
layout: default
title: Permissions
parent: Access control
nav_order: 50
nav_order: 110
---

# Permissions
Expand Down Expand Up @@ -41,7 +41,7 @@ These permissions also allow you add, update, or delete documents (e.g. `PUT tes

## Test permissions

If you want a user to have the absolute minimum set of permissions necessary to perform some function---the [principle of least privilege](https://en.wikipedia.org/wiki/Principle_of_least_privilege)----the best way is to send representative requests to your cluster as a new test user. In the case of a permissions error, the security plugin is very explicit about which permissions are missing. Consider this request and response:
If you want a user to have the absolute minimum set of permissions necessary to perform some functionthe [principle of least privilege](https://en.wikipedia.org/wiki/Principle_of_least_privilege)the best way is to send representative requests to your cluster as a new test user. In the case of a permissions error, the security plugin is very explicit about which permissions are missing. Consider this request and response:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should p be capital as in [Principle of least privilege]

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like the internet generally uses lower case to name this principle. I think it should be OK.


```json
GET _cat/shards?v
Expand Down
18 changes: 9 additions & 9 deletions _security-plugin/access-control/users-roles.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
layout: default
title: Users and roles
parent: Access control
nav_order: 1
nav_order: 80
---

# Users and roles
Expand All @@ -11,7 +11,7 @@ The security plugin includes an internal user database. Use this database in pla

Roles are the core way of controlling access to your cluster. Roles contain any combination of cluster-wide permissions, index-specific permissions, document- and field-level security, and tenants. Then you map users to these roles so that users gain those permissions.

Unless you need to create new [reserved or hidden users]({{site.url}}{{site.baseurl}}/security-plugin/access-control/api#reserved-and-hidden-resources), we **highly** recommend using OpenSearch Dashboards or the REST API to create new users, roles, and role mappings. The `.yml` files are for initial setup, not ongoing use.
Unless you need to create new [reserved or hidden users]({{site.url}}{{site.baseurl}}/security-plugin/access-control/api/#reserved-and-hidden-resources), we **highly** recommend using OpenSearch Dashboards or the REST API to create new users, roles, and role mappings. The `.yml` files are for initial setup, not ongoing use.
{: .warning }

---
Expand Down Expand Up @@ -39,12 +39,12 @@ You can create users using OpenSearch Dashboards, `internal_users.yml`, or the R

### internal_users.yml

See [YAML files]({{site.url}}{{site.baseurl}}/security-plugin/configuration/yaml#internal_usersyml).
See [YAML files]({{site.url}}{{site.baseurl}}/security-plugin/configuration/yaml/#internal_usersyml).


### REST API

See [Create user]({{site.url}}{{site.baseurl}}/security-plugin/access-control/api#create-user).
See [Create user]({{site.url}}{{site.baseurl}}/security-plugin/access-control/api/#create-user).


## Create roles
Expand All @@ -65,12 +65,12 @@ Just like users, you can create roles using OpenSearch Dashboards, `roles.yml`,

### roles.yml

See [YAML files]({{site.url}}{{site.baseurl}}/security-plugin/configuration/yaml#rolesyml).
See [YAML files]({{site.url}}{{site.baseurl}}/security-plugin/configuration/yaml/#rolesyml).


### REST API

See [Create role]({{site.url}}{{site.baseurl}}/security-plugin/access-control/api#create-role).
See [Create role]({{site.url}}{{site.baseurl}}/security-plugin/access-control/api/#create-role).


## Map users to roles
Expand All @@ -89,12 +89,12 @@ Just like users and roles, you create role mappings using OpenSearch Dashboards,

### roles_mapping.yml

See [YAML files]({{site.url}}{{site.baseurl}}/security-plugin/configuration/yaml#roles_mappingyml).
See [YAML files]({{site.url}}{{site.baseurl}}/security-plugin/configuration/yaml/#roles_mappingyml).


### REST API

See [Create role mapping]({{site.url}}{{site.baseurl}}/security-plugin/access-control/api#create-role-mapping).
See [Create role mapping]({{site.url}}{{site.baseurl}}/security-plugin/access-control/api/#create-role-mapping).


## Predefined roles
Expand All @@ -119,7 +119,7 @@ Role | Description
`manage_snapshots` | Grants permissions to manage snapshot repositories, take snapshots, and restore snapshots.
`readall` | Grants permissions for cluster-wide searches like `msearch` and search permissions for all indices.
`readall_and_monitor` | Same as `readall`, but with added cluster monitoring permissions.
`security_rest_api_access` | A special role that allows access to the REST API. See `plugins.security.restapi.roles_enabled` in `opensearch.yml` and [Access control for the API]({{site.url}}{{site.baseurl}}/security-plugin/access-control/api#access-control-for-the-api).
`security_rest_api_access` | A special role that allows access to the REST API. See `plugins.security.restapi.roles_enabled` in `opensearch.yml` and [Access control for the API]({{site.url}}{{site.baseurl}}/security-plugin/access-control/api/#access-control-for-the-api).
`reports_read_access` | Grants permissions to generate on-demand reports, download existing reports, and view report definitions, but not to create report definitions.
`reports_instances_read_access` | Grants permissions to generate on-demand reports and download existing reports, but not to view or create report definitions.
`reports_full_access` | Grants full permissions to reports.
Expand Down
2 changes: 1 addition & 1 deletion _security-plugin/audit-logs/field-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
layout: default
title: Audit log field reference
parent: Audit logs
nav_order: 1
nav_order: 130
---

# Audit log field reference
Expand Down
2 changes: 1 addition & 1 deletion _security-plugin/audit-logs/index.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
layout: default
title: Audit logs
nav_order: 40
nav_order: 125
has_children: true
has_toc: false
redirect_from:
Expand Down
2 changes: 1 addition & 1 deletion _security-plugin/audit-logs/storage-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
layout: default
title: Audit log storage types
parent: Audit logs
nav_order: 10
nav_order: 135
---

# Audit log storage types
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,28 @@
---
layout: default
title: Authentication flow
parent: Configuration
nav_order: 1
title: Authentication backends
nav_order: 45
has_children: true
has_toc: false
redirect_from:
- /security-plugin/authentication-backends/
---

# Authentication flow
# Authentication backends

Understanding the authentication flow is a great way to get started with configuring the security plugin.
Authentication backend configurations determine the method or methods you use for authenticating users and the way users pass their credentials and sign in to OpenSearch. Having an understanding of the basic authentication flow before getting started can help with the configuration process for whichever backend you choose. Consider the high-level sequence of events in the description that follows, and then refer to the detailed steps for configuring the authentication type you choose to use with OpenSearch.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thoughts on: .. the method/s to be used for authenticating users ..

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we're trying to stay away from shorthand like this in the documentation. But I would be fine with using the singular "method" alone. I don't think it confuses the meaning.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, singular usage sounds good and it won't divert the user interpretation of this sentence.


1. To identify a user who wants to access the cluster, the security plugin needs the user's credentials.
## Authentication flow

1. To identify a user who wants to access the cluster, the Security plugin needs the user's credentials.

These credentials differ depending on how you've configured the plugin. For example, if you use basic authentication, the credentials are a user name and password. If you use a JSON web token, the credentials are stored within the token itself. If you use TLS certificates, the credentials are the distinguished name (DN) of the certificate.

2. The security plugin authenticates the user's credentials against a backend: the internal user database, Lightweight Directory Access Protocol (LDAP), Active Directory, Kerberos, or JSON web tokens.
2. The Security plugin authenticates the user's credentials against a backend: the internal user database (basic authentictation), Lightweight Directory Access Protocol (LDAP)/Active Directory, JSON web tokens, SAML, or another authentication protocol.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thinking about how to be precise and clear when communication about backend vs. way of communicating auth info (user + password combo or token) to OpenSearch.

There are 2 high-level types of IdP, Identity Providers, backends that Opensearch security plugin interfaces with. 1. Internal User database or 2. an external provider (a backend compliant with LDAP, ODIC or SAML). For client cert, jwt and proxy auth, these could be described as backend-less providers (not completely accurate, but I'll explain) in that OpenSearch does not verify the info passed in the request with a list of users and instead extracts username and backend roles from the request passed to opensearch.

  1. For client cert auth, the principal of the cert is used to extract the username and backend roles. I believe username is the CN field and backend_roles are the concatenated OU fields. As long as the cert is issued by a CA in the SECURITY_SSL_HTTP_PEMTRUSTEDCAS_FILEPATH setting the cert will be trusted.
  2. For JWT, a token is passed in an HTTP Authorization request header which must contain claims that match the subject_key and roles_key. The JWT must also be able to be verified with the signing_key configured in config.yml
  3. For proxy auth authentication is performed at the IdP and then forwarded to opensearch. The forwarded request contains the username and backend roles in the HTTP request and OpenSearch trusts the request if its coming from the correct configured source.

The internal database is used with Basic Auth to get username and password info from an HTTP request. So in this case Basic Auth is the mechanism for transmitting auth info (username + password) in a request and the Authentication Backend would be the internal user database.

How does this sound?

The Security plugin authenticates a request against a configured backend.  Authentication providers include: Basic Auth using the internal user database, Lightweight Directory Access Protocol (LDAP)/Active Directory, JSON web tokens, SAML, or another authentication protocol.

This change you are presenting in this PR looks good to me, but stuff to keep in mind.

Copy link
Contributor Author

@cwillum cwillum Dec 27, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see the distinction. And those are good points to keep in mind. I tweaked the suggestion a little. Does it still make sense, or have I taken it off course?

The Security plugin authenticates a server request against a backend configured for an authentication provider. Some examples of authentication providers used with OpenSearch include Basic Auth (which uses the internal user database), Lightweight Directory Access Protocol (LDAP)/Active Directory, JSON web tokens, SAML, or another authentication protocol.

@cwperks Also, referring to item 1 in the flow, is it accurate to say that a user's credentials will be included in the request, no matter which authentication provider is being used? If I can say that, it will improve continuity with the statement in item 2 (continuity = better chance for making overall sense of the flow).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cwillum The tweaked suggestion sounds good to me, but instead of server request can it simply be request?

Judging by item 1, the word Credentials is used generically to mean what's needed to confer access so its accurate to say that credentials must be included on every request.

For most of the backends, Username + Password will be used for the very first request so its accurate to say the credentials are included in the request. In many cases, subsequent requests will use an access token (JWT) to prevent the need of passing username + password on every request.

In item 1:

the credentials are stored within the token itself

When I first read this it sounded like password info was embedded in the token, but that's not the case. The username (subject_key) and roles (roles_key) are embedded in the token.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RE: "... but instead of server request can it simply be request?"
Definitely. I'm probably unnecessarily splitting hairs with some of these proposed changes to wording. But it's helpful to refine along the way. Thanks for your patience.


The plugin supports chaining backends in `config/opensearch-security/config.yml`. If more than one backend is present, the plugin tries to authenticate the user sequentially against each until one succeeds. A common use case is to combine the internal user database of the security plugin with LDAP/Active Directory.

3. After a backend verifies the user's credentials, the plugin collects any backend roles. These roles can be arbitrary strings in the internal user database, but in most cases, these backend roles come from LDAP/Active Directory.
3. After a backend verifies the user's credentials, the plugin collects any backend roles. These roles can be arbitrary strings in the internal user database, roles retrieved from the LDAP/Active Directory server, or roles that are kept as attributes with the SAML protocol.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extraction of backend roles is applicable for all backends except for basic auth with the internal user database. LDAP is a bit exceptional because authz of the security plugin's config.yml needs to be configured to specify how roles should be extracted from the directory service.

For the internal user database, roles are determined by roles that the user is mapped to within opensearch. With an external IdP, a cluster admin must map backend roles to roles in OpenSearch and users will transitively get OpenSearch roles based on the roles mapping. i.e. In LDAP I may be in the My Org Developers group, and in opensearch there could be a role named developers which has a certain set of permissions. The cluster admin would need to map My Org Developers to the developers role to map the external group to the internal role within OpenSearch.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cwperks I tried to sum this up while keeping it general.
After a backend verifies the user's credentials, the plugin collects any [backend roles]({{site.url}}{{site.baseurl}}/security-plugin/access-control/index/#concepts). The authentication provider determines the way these roles are retrieved. For example, LDAP extracts backend roles from its directory service based on their mappings to roles in OpenSearch, while SAML stores the roles as attributes. When basic authentication is used, the internal user database refers to role mappings configured in OpenSearch.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good to me


4. After the user is authenticated and any backend roles are retrieved, the security plugin uses the role mapping to assign security roles to the user.

Expand Down
Loading