Skip to content

Add user documents to cloud_asset integration for entity store namespace routing - #426

Open
CAWilson94 wants to merge 2 commits into
elastic:mainfrom
CAWilson94:cloud-asset-discovery
Open

Add user documents to cloud_asset integration for entity store namespace routing#426
CAWilson94 wants to merge 2 commits into
elastic:mainfrom
CAWilson94:cloud-asset-discovery

Conversation

@CAWilson94

@CAWilson94 CAWilson94 commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

The cloud_asset integration only generated infrastructure docs (EC2 instances etc.) — no user fields, no event.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.email

Result: running yarn start org-data --integrations cloud_asset now produces users in aws, gcp, and entra_id namespaces instead of everything collapsing into asset_discovery.

Also reformats two union types in types.ts for readability.

…ce routing

Co-authored-by: Cursor <cursoragent@cursor.com>
Copilot AI review requested due to automatic review settings July 16, 2026 11:00
@CAWilson94
CAWilson94 requested a review from a team as a code owner July 16, 2026 11:00
@CAWilson94
CAWilson94 requested a review from romulets July 16, 2026 11:00
@CAWilson94 CAWilson94 changed the title cloud_asset: emit user-centric Cloud Asset Discovery docs for namespa… Add user documents to cloud_asset integration for entity store namespace routing Jul 16, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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/Employee typings and make CloudAssetDocument.event.module optional to support mixed asset vs. user-discovery documents.
  • Reformat a couple of union types in types.ts for 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,
},
}),
@CAWilson94
CAWilson94 requested review from Copilot and removed request for alexreal1314 July 16, 2026 11:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Comment thread src/commands/org_data/integrations/cloud_asset_integration.ts Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

@opauloh opauloh left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

great addition!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants