enhancement: add option to enrich user info for Kolide.device integration#20143
enhancement: add option to enrich user info for Kolide.device integration#20143hnguyen-coreweave wants to merge 5 commits into
Conversation
|
💚 CLA has been signed |
ReviewersBuildkite won't run for external contributors automatically; you need to add a comment:
NOTE: https://github.com/elastic/integrations/blob/main/.buildkite/pull-requests.json contains all those details. |
|
/test |
|
@vinit-chauhan would you mind reviewing this one please? Thanks for the contribution @hnguyen-coreweave! |
|
Pinging @elastic/integration-experience (Team:Integration-Experience) |
c14d922 to
dbb156c
Compare
|
Thanks @hnguyen-coreweave for the PR! A couple of things came up on my mind looking at the PR:
There's also an open PR (#20108) that adds a dedicated people data stream, which collects the same user detail independently without the per-device call pattern or the fingerprint issue above — worth checking if that covers what you need here. If you still want owner details attached directly to device events, that's doable separately — Elasticsearch's enrich processor can join people data onto device docs at ingest time via a custom pipeline (logs-kolide.device@custom), keyed on the owner id. |
|
No issues across the latest commits dbb156c. Review summaryIssues found across earlier commits 8b5206c — 3 medium
🤖 AI-Generated Review | Vera Review Bot | 📚 Knowledge base: integration-skills
|
Thanks Vinit for reviewing the PR.
this point is valid and was the biggest item that made me hesitant to submit the PR. But this is what got me thinking of making this an option that user can chose to opt-in/out Good call on the slient fallback tho 100%
I might need help on this if we decide to pursue this route The _enrich processor is certainly an option but the enrich policy needs to be manually called to get refreshed, unless things have changed since the last time I used it a few years ago. I wonder if there is something that can help ease the pain of having to manually refresh the enrich policy? |
|
|
|
Hey @hnguyen-coreweave, thanks for your thoughtful response. Regarding the enrichment policy refresh, you could create a transform on the people index (introduced in v0.2.0) that maintains the latest state and updates on a set interval, such as every 5 minutes. Additionally, you could implement a watcher that triggers a POST to /_enrich/policy//_execute on a schedule to automatically rebuild the enrichment snapshot. |
|
@hnguyen-coreweave - This PR has merge conflicts with the base branch. Please resolve them. |
|
Vinit, That is fair. I will wait for you PR to be merged then and follow the recomended pattern above. Thanks for looking at the PR. Also I am talking to kolide directly and see if they can bake in the user information in the |
Proposed commit message
Enhancement: add optional user enrichment for the Kolide device data stream.
This change introduces an opt-in setting,
enable_user_enrichment, for thekolide.deviceCEL stream. When enabled, the CEL program usesregistered_owner_info.linkfrom each/devicesrecord to request additional owner details from Kolide's/people/<id>endpoint and merges that response intoregistered_owner_infobefore publishing the event.The ingest pipeline is updated to map enriched owner fields into ECS where present:
json.registered_owner_info.email->user.emailjson.registered_owner_info.name->user.nameIf enrichment is disabled (default) or the owner lookup fails, processing falls back to the original device payload. Package version is bumped to
0.1.3, with a matching changelog entry.With the additional user information, elastic users now can use this kolide event stream to generate a lookup table/index that can help lookup the username to devices and vice versa
Checklist
changelog.ymlfile.Author's Checklist
enable_user_enrichmentstream variable inpackages/kolide/data_stream/device/manifest.yml.packages/kolide/data_stream/device/agent/stream/cel.yml.hbsto perform conditional owner enrichment.packages/kolide/data_stream/device/elasticsearch/ingest_pipeline/default.ymlto setuser.emailanduser.name.0.1.3inpackages/kolide/manifest.yml.packages/kolide/changelog.yml.How to test this PR locally
elastic-package formatelastic-package test pipeline -v --data-streams device --package kolidekolide.device.registered_owner_info.*user.emailuser.nameenable_user_enrichment:false: no extra owner lookup requests are made.true: owner data is merged whenregistered_owner_info.linkis present.Related issues
Screenshots
N/A