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

'Set Security User' processor overwrites target field #51428

Closed
peterpramb opened this issue Jan 24, 2020 · 2 comments · Fixed by #51454
Closed

'Set Security User' processor overwrites target field #51428

peterpramb opened this issue Jan 24, 2020 · 2 comments · Fixed by #51454
Assignees
Labels
:Data Management/Ingest Node Execution or management of Ingest Pipelines including GeoIP

Comments

@peterpramb
Copy link

peterpramb commented Jan 24, 2020

Elasticsearch version:
Version: 7.5.1, Build: default/tar/3ae9ac9a93c95bd0cdc054951cf95d88e1e18d96/2019-12-16T22:57:37.835892Z, JVM: 11.0.5

JVM version:
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.5+10, mixed mode)

OS version:
Linux 3.10.0-1062.1.2.el7.x86_64 #1 SMP Mon Sep 16 14:19:51 EDT 2019 x86_64 x86_64 x86_64 GNU/Linux

Description of the problem including expected versus actual behavior:
The set_security_user processor simply overwrites an already existing target field provided in field instead of merging it with existing data and only overwriting the fields specified in properties.

I'm not sure if this is a bug or works as intended, but at least the documentation should then make clear that an existing field's data is lost when using this processor.

Steps to reproduce:

  1. Simulate pipeline
POST /_ingest/pipeline/_simulate?verbose=true
{
  "docs": [
    {
      "_index": "gh-51428",
      "_source": {
        "user" : {
          "id": "123",
          "name": "testuser",
          "email": "test@user"
        }
      }
    }
  ],
  "pipeline": {
    "processors": [
      {
        "set_security_user": {
          "field": "user",
          "properties": [
            "username"
          ]
        }
      }
    ]
  }
}
  1. Result
{
  "docs" : [
    {
      "processor_results" : [
        {
          "doc" : {
            "_index" : "gh-51428",
            "_type" : "_doc",
            "_id" : "_id",
            "_source" : {
              "user" : {
                "username" : "someuser"
              }
            },
            "_ingest" : {
              "timestamp" : "2020-01-24T15:55:40.964116Z"
            }
          }
        }
      ]
    }
  ]
}
@peterpramb
Copy link
Author

peterpramb commented Jan 24, 2020

Especially this relevant part from Table 60. Set Security User Options:

field: The field to store the user information into.
properties: Controls what user related properties are added to the field.

@romseygeek romseygeek added the :Data Management/Ingest Node Execution or management of Ingest Pipelines including GeoIP label Jan 24, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-features (:Core/Features/Ingest)

@danhermann danhermann self-assigned this Jan 24, 2020
probakowski added a commit to probakowski/elasticsearch that referenced this issue Jan 24, 2020
This change fix problem with `SetSecurityUserProcessor` which was overwriting
whole target field and not only fields really filled by the processor.

Closes elastic#51428
probakowski added a commit that referenced this issue Jan 27, 2020
* Don't overwrite target field with SetSecurityUserProcessor

This change fix problem with `SetSecurityUserProcessor` which was overwriting
whole target field and not only fields really filled by the processor.

Closes #51428

* Unused imports removed
probakowski added a commit to probakowski/elasticsearch that referenced this issue Jan 27, 2020
…1454)

* Don't overwrite target field with SetSecurityUserProcessor

This change fix problem with `SetSecurityUserProcessor` which was overwriting
whole target field and not only fields really filled by the processor.

Closes elastic#51428

* Unused imports removed
probakowski added a commit that referenced this issue Jan 28, 2020
…51506)

* Don't overwrite target field with SetSecurityUserProcessor

This change fix problem with `SetSecurityUserProcessor` which was overwriting
whole target field and not only fields really filled by the processor.

Closes #51428

* Unused imports removed
probakowski added a commit that referenced this issue Jan 28, 2020
…51507)

* Don't overwrite target field with SetSecurityUserProcessor

This change fix problem with `SetSecurityUserProcessor` which was overwriting
whole target field and not only fields really filled by the processor.

Closes #51428

* Unused imports removed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Data Management/Ingest Node Execution or management of Ingest Pipelines including GeoIP
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants