Add user documents to cloud_asset integration for entity store namespace routing - #426
Open
CAWilson94 wants to merge 2 commits into
Open
Add user documents to cloud_asset integration for entity store namespace routing#426CAWilson94 wants to merge 2 commits into
CAWilson94 wants to merge 2 commits into
Conversation
…ce routing Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends the cloud_asset_inventory integration to emit additional “user-centric” Cloud Asset Discovery documents per employee and cloud provider, intended for Kibana entity-store user extraction/routing. It also refines a few org-data type definitions for clarity and to support the new event shape.
Changes:
- Emit per-employee, per-provider Cloud Asset “user” documents with
event.module: "asset_discovery"to enable entity-store extraction. - Add
CloudProvider/Employeetypings and makeCloudAssetDocument.event.moduleoptional to support mixed asset vs. user-discovery documents. - Reformat a couple of union types in
types.tsfor readability.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/commands/org_data/types.ts |
Updates type definitions (union formatting; CloudAssetDocument.event.module now optional). |
src/commands/org_data/integrations/cloud_asset_integration.ts |
Generates additional user-centric cloud asset documents across providers for entity-store routing. |
| // Generate user-centric Cloud Asset Discovery documents so the Kibana | ||
| // entity store can extract users into per-provider namespaces (aws, gcp, | ||
| // entra_id). These require event.module: "asset_discovery" and a user.name. | ||
| const providers: CloudProvider[] = ['aws', 'gcp', 'azure']; |
Comment on lines
+265
to
+269
| project: { | ||
| id: account?.id, | ||
| name: account?.name, | ||
| }, | ||
| }), |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The
cloud_assetintegration only generated infrastructure docs (EC2 instances etc.) — no user fields, noevent.module, so the Kibana entity store never extracted users from it.This adds one user doc per employee per provider (aws, gcp, azure) with the fields the entity store requires:
event.kind: "asset"+event.module: "asset_discovery"cloud.provider+user.name/user.id/user.emailResult: running
yarn start org-data --integrations cloud_assetnow produces users inaws,gcp, andentra_idnamespaces instead of everything collapsing into asset_discovery.Also reformats two union types in
types.tsfor readability.