OpenSearch/x-pack/docs/en/rest-api/security
Yogesh Gaikwad b6d1d2e6ec
Add 'create_doc' index privilege (#45806) (#47645)
Use case:
User with `create_doc` index privilege will be allowed to only index new documents
either via Index API or Bulk API.

There are two cases that we need to think:
- **User indexing a new document without specifying an Id.**
   For this ES auto generates an Id and now ES version 7.5.0 onwards defaults to `op_type` `create` we just need to authorize on the `op_type`.
- **User indexing a new document with an Id.**
   This is problematic as we do not know whether a document with Id exists or not.
   If the `op_type` is `create` then we can assume the user is trying to add a document, if it exists it is going to throw an error from the index engine.

Given these both cases, we can safely authorize based on the `op_type` value. If the value is `create` then the user with `create_doc` privilege is authorized to index new documents.

In the `AuthorizationService` when authorizing a bulk request, we check the implied action.
This code changes that to append the `:op_type/index` or `:op_type/create`
to indicate the implied index action.
2019-10-07 23:58:44 +11:00
..
authenticate.asciidoc [DOCS] Update snippets in security APIs (#46191) (#46401) 2019-09-05 11:12:39 -07:00
change-password.asciidoc [DOCS] Update snippets in security APIs (#46191) (#46401) 2019-09-05 11:12:39 -07:00
clear-cache.asciidoc [DOCS] Update snippets in security APIs (#46191) (#46401) 2019-09-05 11:12:39 -07:00
clear-roles-cache.asciidoc [DOCS] Update snippets in security APIs (#46191) (#46401) 2019-09-05 11:12:39 -07:00
create-api-keys.asciidoc Enhance docs for create api keys created when role descriptor not specified (#46897) 2019-09-30 12:15:29 +10:00
create-role-mappings.asciidoc [DOCS] Replace "// TESTRESPONSE" magic comments with "[source,console-result] (#46295) (#46418) 2019-09-06 09:22:08 -04:00
create-roles.asciidoc File based role definition documentation additions (#46304) (#47085) 2019-09-25 13:52:05 +03:00
create-users.asciidoc [DOCS] Replace "// TESTRESPONSE" magic comments with "[source,console-result] (#46295) (#46418) 2019-09-06 09:22:08 -04:00
delegate-pki-authentication.asciidoc [DOCS] Update snippets in security APIs (#46191) (#46401) 2019-09-05 11:12:39 -07:00
delete-app-privileges.asciidoc [DOCS] Replace "// TESTRESPONSE" magic comments with "[source,console-result] (#46295) (#46418) 2019-09-06 09:22:08 -04:00
delete-role-mappings.asciidoc [DOCS] Update snippets in security APIs (#46191) (#46401) 2019-09-05 11:12:39 -07:00
delete-roles.asciidoc File based role definition documentation additions (#46304) (#47085) 2019-09-25 13:52:05 +03:00
delete-users.asciidoc [DOCS] Update snippets in security APIs (#46191) (#46401) 2019-09-05 11:12:39 -07:00
disable-users.asciidoc [DOCS] Update snippets in security APIs (#46191) (#46401) 2019-09-05 11:12:39 -07:00
enable-users.asciidoc [DOCS] Update snippets in security APIs (#46191) (#46401) 2019-09-05 11:12:39 -07:00
get-api-keys.asciidoc Add support to retrieve all API keys if user has privilege (#47274) (#47641) 2019-10-07 23:58:21 +11:00
get-app-privileges.asciidoc [DOCS] Update snippets in security APIs (#46191) (#46401) 2019-09-05 11:12:39 -07:00
get-builtin-privileges.asciidoc Add 'create_doc' index privilege (#45806) (#47645) 2019-10-07 23:58:44 +11:00
get-role-mappings.asciidoc [DOCS] Update snippets in security APIs (#46191) (#46401) 2019-09-05 11:12:39 -07:00
get-roles.asciidoc File based role definition documentation additions (#46304) (#47085) 2019-09-25 13:52:05 +03:00
get-tokens.asciidoc [DOCS] Update snippets in security APIs (#46191) (#46401) 2019-09-05 11:12:39 -07:00
get-users.asciidoc [DOCS] Update snippets in security APIs (#46191) (#46401) 2019-09-05 11:12:39 -07:00
has-privileges.asciidoc [DOCS] Update snippets in security APIs (#46191) (#46401) 2019-09-05 11:12:39 -07:00
invalidate-api-keys.asciidoc [DOCS] Update snippets in security APIs (#46191) (#46401) 2019-09-05 11:12:39 -07:00
invalidate-tokens.asciidoc [DOCS] Update snippets in security APIs (#46191) (#46401) 2019-09-05 11:12:39 -07:00
oidc-authenticate-api.asciidoc [DOCS] Update snippets in security APIs (#46191) (#46401) 2019-09-05 11:12:39 -07:00
oidc-logout-api.asciidoc [DOCS] Update snippets in security APIs (#46191) (#46401) 2019-09-05 11:12:39 -07:00
oidc-prepare-authentication-api.asciidoc [DOCS] Update snippets in security APIs (#46191) (#46401) 2019-09-05 11:12:39 -07:00
put-app-privileges.asciidoc [DOCS] Replace "// TESTRESPONSE" magic comments with "[source,console-result] (#46295) (#46418) 2019-09-06 09:22:08 -04:00
role-mapping-resources.asciidoc [DOCS] Replace "// CONSOLE" comments with [source,console] (#46679) 2019-09-13 11:44:54 -04:00
ssl.asciidoc [DOCS] Update snippets in security APIs (#46191) (#46401) 2019-09-05 11:12:39 -07:00