-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Put data stream so there is no need for additional permissions #31048
Conversation
This pull request does not have a backport label. Could you fix it @kvch? 🙏
NOTE: |
Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane) |
With this change we would still attempt to create the datastream with the user used for publishing events, does that safely do nothing if the datastream already exists and the user used for publishing lacks the permissions that would be required? How did we test this? Is there an automated test we can write for this use case where the setup user has more permissions that the user used for publishing to ES? |
No, we only attempt to create the data stream, if the template is loaded. Given that during setup both the index template and the data stream is loaded, Beats will not try to load the data stream during publishing.
In libbeat we test everything without enabling security in Elasticsearch. In the past we relied on manual testing for these use cases. I am fine with adding more tests, but given that it requires a bit more work to create the environment for such tests, I would prefer to do it in a follow up PR. |
Fine with me, we should add some tests for this but it can be done as a follow up as long we do a manual check that this works as well. |
This pull request is now in conflicts. Could you fix it? 🙏
|
…a-stream-on-setup
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.
Let's make sure we have a test case where we ensure we don't delete a data stream that already exists.
Co-authored-by: Craig MacKenzie <craig.mackenzie@elastic.co>
…a-stream-on-setup
Added labels to backport into 8.2 since this is a bug fix (and was created just before the 8.2 feature freeze). Skipping 8.1 as there currently aren't any more planned 8.1 releases |
…ic#31048) ## What does this PR do? This PR adds a new step to loading templates. Now not only the template is loaded, but the data stream is created as well. Given that users might load templates from JSON file that are not data streams, I added a new option called `setup.template.json.data_stream`. It has to be set, if the JSON template is a data stream. ## Why is it important? Without this change users needed more permissions to publish events. Now `create_doc` priviledge is enough to publish events to the data stream. Closes elastic#30647 Closes elastic#30567
## What does this PR do? This PR adds a new step to loading templates. Now not only the template is loaded, but the data stream is created as well. Given that users might load templates from JSON file that are not data streams, I added a new option called `setup.template.json.data_stream`. It has to be set, if the JSON template is a data stream. ## Why is it important? Without this change users needed more permissions to publish events. Now `create_doc` priviledge is enough to publish events to the data stream. Closes #30647 Closes #30567 (cherry picked from commit 5cdb312)
… (#31180) ## What does this PR do? This PR adds a new step to loading templates. Now not only the template is loaded, but the data stream is created as well. Given that users might load templates from JSON file that are not data streams, I added a new option called `setup.template.json.data_stream`. It has to be set, if the JSON template is a data stream. ## Why is it important? Without this change users needed more permissions to publish events. Now `create_doc` priviledge is enough to publish events to the data stream. Closes #30647 Closes #30567 (cherry picked from commit 5cdb312) Co-authored-by: Noémi Ványi <kvch@users.noreply.github.com>
Let's backport to 8.1 in case we end up doing another 8.1.x release. |
## What does this PR do? This PR adds a new step to loading templates. Now not only the template is loaded, but the data stream is created as well. Given that users might load templates from JSON file that are not data streams, I added a new option called `setup.template.json.data_stream`. It has to be set, if the JSON template is a data stream. ## Why is it important? Without this change users needed more permissions to publish events. Now `create_doc` priviledge is enough to publish events to the data stream. Closes #30647 Closes #30567 (cherry picked from commit 5cdb312)
… (#31186) ## What does this PR do? This PR adds a new step to loading templates. Now not only the template is loaded, but the data stream is created as well. Given that users might load templates from JSON file that are not data streams, I added a new option called `setup.template.json.data_stream`. It has to be set, if the JSON template is a data stream. ## Why is it important? Without this change users needed more permissions to publish events. Now `create_doc` priviledge is enough to publish events to the data stream. Closes #30647 Closes #30567 (cherry picked from commit 5cdb312) Co-authored-by: Noémi Ványi <kvch@users.noreply.github.com>
…ic#31048) ## What does this PR do? This PR adds a new step to loading templates. Now not only the template is loaded, but the data stream is created as well. Given that users might load templates from JSON file that are not data streams, I added a new option called `setup.template.json.data_stream`. It has to be set, if the JSON template is a data stream. ## Why is it important? Without this change users needed more permissions to publish events. Now `create_doc` priviledge is enough to publish events to the data stream. Closes elastic#30647 Closes elastic#30567
## What does this PR do? This PR adds a new step to loading templates. Now not only the template is loaded, but the data stream is created as well. Given that users might load templates from JSON file that are not data streams, I added a new option called `setup.template.json.data_stream`. It has to be set, if the JSON template is a data stream. ## Why is it important? Without this change users needed more permissions to publish events. Now `create_doc` priviledge is enough to publish events to the data stream. Closes #30647 Closes #30567
What does this PR do?
This PR adds a new step to loading templates. Now not only the template is loaded, but the data stream is created as well. Given that users might load templates from JSON file that are not data streams, I added a new option called
setup.template.json.data_stream
. It has to be set, if the JSON template is a data stream.Why is it important?
Without this change users needed more permissions to publish events. Now
create_doc
priviledge is enough to publish events to the data stream.Checklist
CHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.Related issues
Closes #30647
Closes #30567