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

[Fleet] Custom permissions for connector package #192081

Merged

Conversation

jedrazb
Copy link
Member

@jedrazb jedrazb commented Sep 4, 2024

Summary

Defines custom permissions for connector package.

Note: Wait with merging until elastic/elasticsearch#112556 is merged

Checklist

Delete any items that are not applicable to this PR.

  • tested e2e with local ES, fleet server and connectors package

@jedrazb
Copy link
Member Author

jedrazb commented Sep 11, 2024

@elasticmachine merge upstream

@jedrazb jedrazb changed the title [WIP] Connector-specific agent permissions [Fleet] Custom permissions for connector package Sep 11, 2024
@jedrazb jedrazb marked this pull request as ready for review September 11, 2024 13:13
@jedrazb jedrazb requested a review from a team as a code owner September 11, 2024 13:13
@jedrazb jedrazb added release_note:skip Skip the PR/issue when compiling release notes Team:Fleet Team label for Observability Data Collection Fleet team Team:Search labels Sep 11, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/fleet (Team:Fleet)

cluster: ['manage_connector'],
indices: [
{
names: ['traces-*', 'logs-*', 'metrics-*'],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not familiar with the connector but does it need to write to all of those logs, metrics, traces datastreams?

Copy link
Member Author

@jedrazb jedrazb Sep 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The connector component doesn't need to write to those indices.

IIRC when I was testing locally, I think that I could only access the connector component logs in Fleet UI after adding this to permissions. So, I think it does need to write to logs-* at least (could I be wrong here?). I'm not sure about traces-* and metrics-* honestly.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think logs will be send by elastic-agent if monitoring is enabled for the agent policy, this how it works for other components, so unless there is a specific need I think we probably not need those permissions

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nchaulet Actually after removing this bit we are no longer able to receive component-level logs, even with system logs + metrics collection enabled, I'm leaning towards adding:

{
  names: ['logs-elastic_agent*'],
  privileges: ['auto_configure', 'create_doc']
}

@artem-shelkovnikov
Copy link
Member

cc @seanstory

Co-authored-by: Artem Shelkovnikov <lavatroublebubble@gmail.com>
Copy link
Member

@nchaulet nchaulet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀

@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

Metrics [docs]

✅ unchanged

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@seanstory seanstory merged commit 911db9a into elastic:main Sep 17, 2024
24 checks passed
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Sep 17, 2024
markov00 pushed a commit to markov00/kibana that referenced this pull request Sep 18, 2024
## Summary

Defines custom permissions for connector package. 

Note: Wait with merging until
elastic/elasticsearch#112556 is merged


### Checklist

Delete any items that are not applicable to this PR.

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

+ tested e2e with local ES, fleet server and connectors package

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Sean Story <sean.j.story@gmail.com>
Co-authored-by: Artem Shelkovnikov <lavatroublebubble@gmail.com>
Co-authored-by: Artem Shelkovnikov <artem.shelkovnikov@elastic.co>
@jbudz
Copy link
Member

jbudz commented Sep 20, 2024

@seanstory can you check if this needs to be backported to 8.x?

@seanstory
Copy link
Member

It does not

jedrazb added a commit that referenced this pull request Sep 23, 2024
## Summary

Defines custom permissions for connector package.
- adds `view_index_metadata` permission
- adds permission to `logs-elastic_agent*` index in order to allow to
collect component logs
- see
#192081 (comment)

### Checklist


[Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
tested e2e with local ES, fleet server and connectors package

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting release_note:skip Skip the PR/issue when compiling release notes Team:Fleet Team label for Observability Data Collection Fleet team Team:Search v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants