Skip to content

[Fleet] Custom permissions for connector package#192081

Merged
seanstory merged 9 commits intoelastic:mainfrom
jedrazb:support-elastic-connectors-agent-permissions
Sep 17, 2024
Merged

[Fleet] Custom permissions for connector package#192081
seanstory merged 9 commits intoelastic:mainfrom
jedrazb:support-elastic-connectors-agent-permissions

Conversation

@jedrazb
Copy link
Copy Markdown
Contributor

@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
Copy Markdown
Contributor 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
Copy Markdown
Contributor

Pinging @elastic/fleet (Team:Fleet)

@kpollich kpollich requested a review from nchaulet September 11, 2024 13:24
cluster: ['manage_connector'],
indices: [
{
names: ['traces-*', 'logs-*', 'metrics-*'],
Copy link
Copy Markdown
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
Copy Markdown
Contributor 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
Copy Markdown
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
Copy Markdown
Contributor 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
Copy Markdown
Member

cc @seanstory

Co-authored-by: Artem Shelkovnikov <lavatroublebubble@gmail.com>
Copy link
Copy Markdown
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
Copy Markdown

💛 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
@kibanamachine kibanamachine added the backport:skip This PR does not require backporting label Sep 17, 2024
@jbudz
Copy link
Copy Markdown
Contributor

jbudz commented Sep 20, 2024

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

@seanstory
Copy link
Copy Markdown
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 PR 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