[Fleet] Enrich agent with agent policies #202228
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Proof of concept of enrich agent with agent policies data (policy name, package_policies, ...) This allow to search agents by their agent policies property.
Need that elasticsearch PR to create related mappings. ingest pipeline and give more permissions.
Implementation details
To be able to implement that feature I introduced:
.fleet-agent-policies-metadata
a new index that contains the agent policy data we went to add to agents, that index is populated indeployPolicies
the same place that populate.fleet-policies
on every agent or package policy updatefleet-agents-enrich-agent-policies
a new enrich policy that use.fleet-agent-policies-metadata
to create the enrich indexfleet-agents@enrich-agent-policies-pipeline
that use the enrich policy to populate theagent_policy
field on the agent.When a user deploy a policy (after a package or an agent policy update) in addition to create the existing
.fleet-policies
document, we now:.fleet-agent-policies-metadata
How to run locally?
Run es from source PR need openjdk@21
Enable the feature flag in your
kibana.dev.yml
Questions? Next steps