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

Add connector permissions to fleet server service account #112556

Merged
merged 10 commits into from
Sep 17, 2024

Conversation

jedrazb
Copy link
Member

@jedrazb jedrazb commented Sep 5, 2024

Changes

Add permissions to fleet-server service account to enable running elastic/connectors as an integration.

Fleet service service account owns and generates api keys that are used by integrations (components) enrolled in fleet. Connectors are (soon) an integrations that can be deployed in agentless to offer Elastic-managed ingestion story.

There is a corresponding PR in kibana that would grant custom permissions to the elastic_connectors package: elastic/kibana#192081

Explanation of added permission

  • manage_connector role cluster:admin/xpack/connector/* - connector service needs to be able to read and write from internal connector indices, there is an ongoing effort to move to this role for connector APIs (see this PR for reference)
  • Index level permission to .elastic-connectors* - this is how we currently manage access to internal connector indices, we need read, write and manage access (for refresh operation), this maps to how this is set up in enterprise-search-server service account
  • Index level permission to data index
    • Connectors can sync data to indices prefixed with content-*, user can decide on the index name. This corresponds to search- prefix from enterprise-search-server
    • .search-acl-filter-* - this is a required (and hardcoded in few places) prefix for index storing data related to document-level security logic. If connector index name is e.g. content-google-drive, its corresponding ACL index will be: .search-acl-filter-content-google-drive

in enterprise-search-server we defined index-level permissions to be read,write,manage, we can be more granual with "read", "write","monitor","create_index","auto_configure","maintenance" (this would at least prevent deletion of the index)

@jedrazb jedrazb added :Security/Authorization Roles, Privileges, DLS/FLS, RBAC/ABAC :SearchOrg/Extract&Transform Label for the Search E&T team Team:Security Meta label for security team Team:Fleet Team:SearchOrg Meta label for the Search Org (Enterprise Search) >non-issue labels Sep 11, 2024
@jedrazb
Copy link
Member Author

jedrazb commented Sep 11, 2024

@elasticmachine merge upstream

@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-security (Team:Security)

@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/ingestion-team (Team:Search - Extract & Transform)

@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/ent-search-eng (Team:SearchOrg)

Copy link
Member

@seanstory seanstory left a comment

Choose a reason for hiding this comment

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

LGTM from the Search team side.

@jakelandis pointed out that we don't need connector secrets, which is the only difference between these too. We don't have a pretty name for the narrower permissions, but we don't need one here.

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

buildkite test this

seanstory added a commit to elastic/kibana that referenced this pull request Sep 17, 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>
@seanstory
Copy link
Member

@elasticmachine merge upstream

@seanstory
Copy link
Member

Bump @elastic/fleet , would love to get a cursory review from one of y'all before we merge this.

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 🚀

@seanstory seanstory merged commit b0b9b1f into elastic:main Sep 17, 2024
20 checks passed
javanna pushed a commit to javanna/elasticsearch that referenced this pull request Sep 18, 2024
…2556)

* Add connector permissions to fleet server service account

* [Security] Add permissions to manage connectors for fleet-server service account

* Fix tests

* Fix tests

* Fix typ again (tm)

* switch to connector/* vs manage_connectors

@jakelandis pointed out that we don't need connector secrets, which is the only difference between these too. We don't have a pretty name for the narrower permissions, but we don't need one here.

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

---------

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>non-issue :SearchOrg/Extract&Transform Label for the Search E&T team :Security/Authorization Roles, Privileges, DLS/FLS, RBAC/ABAC Team:Fleet Team:Search - Extract & Transform Team:SearchOrg Meta label for the Search Org (Enterprise Search) Team:Security Meta label for security team v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants