From 9896bbe9180a494877afb6f5bf998bc784110d8d Mon Sep 17 00:00:00 2001 From: Jake Landis Date: Mon, 29 Oct 2018 11:08:35 -0500 Subject: [PATCH 1/6] ingest: raise visibility of ingest plugin documentation part of #33188 --- docs/plugins/ingest.asciidoc | 9 +++++++++ docs/reference/ingest/ingest-node.asciidoc | 7 +++++++ 2 files changed, 16 insertions(+) diff --git a/docs/plugins/ingest.asciidoc b/docs/plugins/ingest.asciidoc index fa316c3862fb1..175141da056db 100644 --- a/docs/plugins/ingest.asciidoc +++ b/docs/plugins/ingest.asciidoc @@ -25,6 +25,15 @@ under the CCA-ShareAlike 3.0 license. For more details see, http://dev.maxmind.c A processor that extracts details from the User-Agent header value. +[float] +=== Security Ingest Plugin + +{stack-ov}/field-and-document-access-control.html#set-security-user-processor[set_security_user]:: + +A processor that attaches user-related details +(such as `username`, `roles`, `email`, `full_name`, and `metadata`) +from the current authenticated user to the current document. + [float] === Community contributed ingest plugins diff --git a/docs/reference/ingest/ingest-node.asciidoc b/docs/reference/ingest/ingest-node.asciidoc index eeb914facc2c6..ec8aa114ed9a2 100644 --- a/docs/reference/ingest/ingest-node.asciidoc +++ b/docs/reference/ingest/ingest-node.asciidoc @@ -2541,3 +2541,10 @@ URL-decodes a string } -------------------------------------------------- // NOTCONSOLE + +[[plugin-processors]] +== Plugin Processors + +Ingest processors may be installed as an Elasticsearch {plugins}/intro.html[plugin]. + +Ingest plugins documentation can be found {plugins}/ingest.html[here]. \ No newline at end of file From f9edeafc0ef6e2b76af6ec789b7c23811ebc6250 Mon Sep 17 00:00:00 2001 From: Jake Landis Date: Tue, 30 Oct 2018 11:56:24 -0500 Subject: [PATCH 2/6] move the set security user processor to the main documentation --- docs/plugins/ingest.asciidoc | 9 ---- docs/reference/ingest/ingest-node.asciidoc | 37 ++++++++++++++++ .../authorization/set-security-user.asciidoc | 43 ++----------------- 3 files changed, 41 insertions(+), 48 deletions(-) diff --git a/docs/plugins/ingest.asciidoc b/docs/plugins/ingest.asciidoc index 175141da056db..fa316c3862fb1 100644 --- a/docs/plugins/ingest.asciidoc +++ b/docs/plugins/ingest.asciidoc @@ -25,15 +25,6 @@ under the CCA-ShareAlike 3.0 license. For more details see, http://dev.maxmind.c A processor that extracts details from the User-Agent header value. -[float] -=== Security Ingest Plugin - -{stack-ov}/field-and-document-access-control.html#set-security-user-processor[set_security_user]:: - -A processor that attaches user-related details -(such as `username`, `roles`, `email`, `full_name`, and `metadata`) -from the current authenticated user to the current document. - [float] === Community contributed ingest plugins diff --git a/docs/reference/ingest/ingest-node.asciidoc b/docs/reference/ingest/ingest-node.asciidoc index ec8aa114ed9a2..96303997ef03d 100644 --- a/docs/reference/ingest/ingest-node.asciidoc +++ b/docs/reference/ingest/ingest-node.asciidoc @@ -2414,6 +2414,43 @@ its value will be replaced with the provided one. -------------------------------------------------- // NOTCONSOLE + +[[ingest-node-set-security-user-processor]] +=== Set Security User Processor +Sets user-related details (such as `username`, `roles`, `email`, `full_name` +and `metadata` ) from the current +authenticated user to the current document by pre-processing the ingest. + +IMPORTANT: Requires an authenticated user for the index request. + +[[set-security-user-options]] +.Set Security User Options +[options="header"] +|====== +| Name | Required | Default | Description +| `field` | yes | - | The field to store the user information into. +| `properties` | no | [`username`, `roles`, `email`, `full_name`, `metadata`] | Controls what user related properties are added to the `field`. +|====== +//TODO: ensure common options are included once PR 35091 is merged. + +The following example adds all user details for the current authenticated user +to the `user` field for all documents that are processed by this pipeline: + +[source,js] +-------------------------------------------------- +{ + "processors" : [ + { + "set_security_user": { + "field": "user" + } + } + ] +} +-------------------------------------------------- +// NOTCONSOLE + + [[split-processor]] === Split Processor Splits a field into an array using a separator character. Only works on string fields. diff --git a/x-pack/docs/en/security/authorization/set-security-user.asciidoc b/x-pack/docs/en/security/authorization/set-security-user.asciidoc index 92b9ae275aec8..6add403693e0c 100644 --- a/x-pack/docs/en/security/authorization/set-security-user.asciidoc +++ b/x-pack/docs/en/security/authorization/set-security-user.asciidoc @@ -9,53 +9,18 @@ To guarantee that a user reads only their own documents, it makes sense to set u document level security. In this scenario, each document must have the username or role name associated with it, so that this information can be used by the role query for document level security. This is a situation where the -`set_security_user` ingest processor can help. +{ref}/ingest-node-set-security-user-processor.html[Set Security User Processor] ingest processor can help. NOTE: Document level security doesn't apply to write APIs. You must use unique ids for each user that uses the same index, otherwise they might overwrite other users' documents. The ingest processor just adds properties for the current authenticated user to the documents that are being indexed. -The `set_security_user` processor attaches user-related details (such as +{ref}/ingest-node-set-security-user-processor.html[Set Security User Processor] processor attaches user-related details (such as `username`, `roles`, `email`, `full_name` and `metadata` ) from the current authenticated user to the current document by pre-processing the ingest. When you index data with an ingest pipeline, user details are automatically attached -to the document. For example: +to the document. -[source,js] --------------------------------------------------- -PUT shared-logs/log/1?pipeline=my_pipeline_id -{ - ... -} --------------------------------------------------- -// NOTCONSOLE +For more information see {ref}/ingest.html[ingest node] and {ref}/ingest-node-set-security-user-processor.html[Set Security User Processor]. -For more information about setting up a pipeline and other processors, see -{ref}/ingest.html[ingest node]. - -[[set-security-user-options]] -.Set Security User Options -[options="header"] -|====== -| Name | Required | Default | Description -| `field` | yes | - | The field to store the user information into. -| `properties` | no | [`username`, `roles`, `email`, `full_name`, `metadata`] | Controls what user related properties are added to the `field`. -|====== - -The following example adds all user details for the current authenticated user -to the `user` field for all documents that are processed by this pipeline: - -[source,js] --------------------------------------------------- -{ - "processors" : [ - { - "set_security_user": { - "field": "user" - } - } - ] -} --------------------------------------------------- -// NOTCONSOLE \ No newline at end of file From 96bedbe549075932d590171dee7e691497b08d72 Mon Sep 17 00:00:00 2001 From: Lisa Cawley Date: Tue, 30 Oct 2018 16:34:00 -0500 Subject: [PATCH 3/6] Update x-pack/docs/en/security/authorization/set-security-user.asciidoc Co-Authored-By: jakelandis --- .../docs/en/security/authorization/set-security-user.asciidoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/docs/en/security/authorization/set-security-user.asciidoc b/x-pack/docs/en/security/authorization/set-security-user.asciidoc index 6add403693e0c..ba13da0b9b43e 100644 --- a/x-pack/docs/en/security/authorization/set-security-user.asciidoc +++ b/x-pack/docs/en/security/authorization/set-security-user.asciidoc @@ -16,7 +16,7 @@ ids for each user that uses the same index, otherwise they might overwrite other users' documents. The ingest processor just adds properties for the current authenticated user to the documents that are being indexed. -{ref}/ingest-node-set-security-user-processor.html[Set Security User Processor] processor attaches user-related details (such as +The {ref}/ingest-node-set-security-user-processor.html[set security user processor] attaches user-related details (such as `username`, `roles`, `email`, `full_name` and `metadata` ) from the current authenticated user to the current document by pre-processing the ingest. When you index data with an ingest pipeline, user details are automatically attached From 3ca64bae92c01d0b22e583cd1bb6701699f37517 Mon Sep 17 00:00:00 2001 From: Lisa Cawley Date: Tue, 30 Oct 2018 16:34:07 -0500 Subject: [PATCH 4/6] Update x-pack/docs/en/security/authorization/set-security-user.asciidoc Co-Authored-By: jakelandis --- .../docs/en/security/authorization/set-security-user.asciidoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/docs/en/security/authorization/set-security-user.asciidoc b/x-pack/docs/en/security/authorization/set-security-user.asciidoc index ba13da0b9b43e..c0f28ec0465e8 100644 --- a/x-pack/docs/en/security/authorization/set-security-user.asciidoc +++ b/x-pack/docs/en/security/authorization/set-security-user.asciidoc @@ -22,5 +22,5 @@ authenticated user to the current document by pre-processing the ingest. When you index data with an ingest pipeline, user details are automatically attached to the document. -For more information see {ref}/ingest.html[ingest node] and {ref}/ingest-node-set-security-user-processor.html[Set Security User Processor]. +For more information see {ref}/ingest.html[Ingest node] and {ref}/ingest-node-set-security-user-processor.html[Set security user processor]. From 34134e30ac926e4a1e3a16b16613f01414d38a96 Mon Sep 17 00:00:00 2001 From: Jake Landis Date: Wed, 31 Oct 2018 08:56:28 -0500 Subject: [PATCH 5/6] review update: remove TOC entry for plugin processors --- docs/reference/ingest/ingest-node.asciidoc | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/docs/reference/ingest/ingest-node.asciidoc b/docs/reference/ingest/ingest-node.asciidoc index 96303997ef03d..54f066676cbaf 100644 --- a/docs/reference/ingest/ingest-node.asciidoc +++ b/docs/reference/ingest/ingest-node.asciidoc @@ -764,6 +764,12 @@ A node will not start if either of these plugins are not available. The <> can be used to fetch ingest usage statistics, globally and on a per pipeline basis. Useful to find out which pipelines are used the most or spent the most time on preprocessing. +[float] +=== Ingest Processor Plugins + +Additional ingest processors can be implemented and installed as Elasticsearch {plugins}/intro.html[plugins]. +See {plugins}/ingest.html[Ingest plugins] for information about the available ingest plugins. + [[append-processor]] === Append Processor Appends one or more values to an existing array if the field already exists and it is an array. @@ -2578,10 +2584,3 @@ URL-decodes a string } -------------------------------------------------- // NOTCONSOLE - -[[plugin-processors]] -== Plugin Processors - -Ingest processors may be installed as an Elasticsearch {plugins}/intro.html[plugin]. - -Ingest plugins documentation can be found {plugins}/ingest.html[here]. \ No newline at end of file From 8911eb1bef98ae1db20c4397ed162a5eebe47643 Mon Sep 17 00:00:00 2001 From: Jake Landis Date: Thu, 1 Nov 2018 13:32:37 -0500 Subject: [PATCH 6/6] remove TODO and add common options now that PR 35091 is merged --- docs/reference/ingest/ingest-node.asciidoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/reference/ingest/ingest-node.asciidoc b/docs/reference/ingest/ingest-node.asciidoc index 7badf2963b57c..070892d6f02e7 100644 --- a/docs/reference/ingest/ingest-node.asciidoc +++ b/docs/reference/ingest/ingest-node.asciidoc @@ -2462,8 +2462,8 @@ IMPORTANT: Requires an authenticated user for the index request. | Name | Required | Default | Description | `field` | yes | - | The field to store the user information into. | `properties` | no | [`username`, `roles`, `email`, `full_name`, `metadata`] | Controls what user related properties are added to the `field`. +include::ingest-node-common-processor.asciidoc[] |====== -//TODO: ensure common options are included once PR 35091 is merged. The following example adds all user details for the current authenticated user to the `user` field for all documents that are processed by this pipeline: