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

[Meta] Use kibana_system to write to .fleet-* indices #120090

Closed
14 of 16 tasks
joshdover opened this issue Dec 1, 2021 · 6 comments · Fixed by #120597
Closed
14 of 16 tasks

[Meta] Use kibana_system to write to .fleet-* indices #120090

joshdover opened this issue Dec 1, 2021 · 6 comments · Fixed by #120597
Assignees
Labels
Meta Team:Fleet Team label for Observability Data Collection Fleet team Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. v8.0.0 v8.1.0

Comments

@joshdover
Copy link
Contributor

joshdover commented Dec 1, 2021

We are considering not allowing superuser to write Fleet's .fleet-* system indices in a future 8.x release. Only the kibana_system (internal user) will be able to write to these indices. This requires that we update all places where we are writing to these indices to use kibana_system and add any necessary, explicit authz checks. These authz checks should be checking against the context.fleet.authz.fleet.all property added in #119199.

@kevinlog I believe the only product-facing impact remaining is the .fleet-actions write being done in the isolation endpoint. It seems this resolver_generator_script is a dev tool that we could fix out of band. Would you agree?

@joshdover joshdover added Meta Team:Fleet Team label for Observability Data Collection Fleet team Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. labels Dec 1, 2021
@joshdover joshdover self-assigned this Dec 1, 2021
@elasticmachine
Copy link
Contributor

Pinging @elastic/fleet (Team:Fleet)

@elasticmachine
Copy link
Contributor

Pinging @elastic/security-solution (Team: SecuritySolution)

@joshdover
Copy link
Contributor Author

@ashokaditya I'd like to open a PR for 8.0 that switches this ES call over to always use the internal user:

fleetActionIndexResult = await esClient.index<EndpointAction>({
index: AGENT_ACTIONS_INDEX,
body: {
...doc.EndpointActions,
'@timestamp': doc['@timestamp'],
agents,
timeout: 300, // 5 minutes
user_id: doc.user.id,
},
});

This will help prevent issues where the "Isolate host" button would when Elasticsearch is upgraded to 8.1 (the version where superuser will not have write access to this index) but Kibana hasn't yet been upgraded. Since we'll be switching over to use the internal user, we need to ensure the end-user making the request to Kibana should have the ability to create these actions. What authz check should be added to verify this user should have access to this action or can I rely on the existing checks?

@kevinlog
Copy link
Contributor

kevinlog commented Dec 6, 2021

What authz check should be added to verify this user should have access to this action or can I rely on the existing checks?

@joshdover I believe you can rely on the existing checks. If the user is a superuser or has all permissions on fleet, then they should be able to create a Fleet action/Isolate hosts, etc.

@paul-tavares @ashokaditya - let me know if that makes sense

@paul-tavares
Copy link
Contributor

Yes, this makes sense to me. A user should have full access to fleet in order to create actions - at least from our Endpoint perspective. @joshdover you should also get some feedback from the OSQuery team - I'm pretty sure they also use this index.

cc/ @pzl since he did the initial implementation of isolation support

@joshdover
Copy link
Contributor Author

Thanks, @paul-tavares. I took a look at the OSQuery code and they're using internal user for all writes so I don't think there's any issue there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Meta Team:Fleet Team label for Observability Data Collection Fleet team Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. v8.0.0 v8.1.0
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants