-
Notifications
You must be signed in to change notification settings - Fork 507
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
Changes from 9 commits
92f9206
bace052
1cda7f8
6dbed13
a318c0a
9e8fd8d
cf38680
e7340c2
bbcb3bb
7d6f7c6
e54b013
05500af
2a663c2
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 |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
layout: default | ||
title: API | ||
parent: Access control | ||
nav_order: 90 | ||
nav_order: 120 | ||
--- | ||
|
||
# API | ||
|
@@ -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. | ||
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. Is there any automation in place to warn against the use of specific version urls? 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. 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} | ||
|
@@ -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.} | ||
|
@@ -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"}]' | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
layout: default | ||
title: Field-level security | ||
parent: Access control | ||
nav_order: 11 | ||
nav_order: 90 | ||
--- | ||
|
||
# Field-level security | ||
|
@@ -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). | ||
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. Why the addition of an extra slash when reference an ID on the API page? 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. 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 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
layout: default | ||
title: Permissions | ||
parent: Access control | ||
nav_order: 50 | ||
nav_order: 110 | ||
--- | ||
|
||
# Permissions | ||
|
@@ -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 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: | ||
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. Should p be capital as in 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. It looks like the internet generally uses lower case to name this principle. I think it should be OK. |
||
|
||
```json | ||
GET _cat/shards?v | ||
|
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. | ||
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. Thoughts on: 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. 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. 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, 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. | ||
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. 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.
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?
This change you are presenting in this PR looks good to me, but stuff to keep in mind. 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. 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?
@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). 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. @cwillum The tweaked suggestion sounds good to me, but instead of 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:
When I first read this it sounded like password info was embedded in the token, but that's not the case. The username ( 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. RE: "... but instead of server request can it simply be request?" |
||
|
||
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. | ||
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. Extraction of backend roles is applicable for all backends except for basic auth with the internal user database. LDAP is a bit exceptional because 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 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. @cwperks I tried to sum this up while keeping it general. 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. 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. | ||
|
||
|
There was a problem hiding this comment.
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?There was a problem hiding this comment.
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.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. It helps.