Skip to content

EntityAnalytics Entra ID: add support for ECS entity fields - #18621

Merged
chemamartinez merged 21 commits into
elastic:mainfrom
chemamartinez:18292-entityanalytics_entraid-entity-fields
Jun 3, 2026
Merged

EntityAnalytics Entra ID: add support for ECS entity fields#18621
chemamartinez merged 21 commits into
elastic:mainfrom
chemamartinez:18292-entityanalytics_entraid-entity-fields

Conversation

@chemamartinez

@chemamartinez chemamartinez commented Apr 23, 2026

Copy link
Copy Markdown
Contributor

Proposed commit message

Adds ECS entity field support to the Microsoft Entra ID Entity Analytics
integration for both the entity and device data streams.

Maps device managed status, last sign-in activity, owner relationships,
user manager relationships, sign-in activity, app role permissions,
direct reports, and MFA status to host.entity.* and user.entity.* fields:

- host.entity.attributes.managed from the isManaged device property.
  Only populated when the existing intune_managed_devices option is
  enabled, as this field requires the DeviceManagementManagedDevices.Read.All
  permission and an active Intune licence.
- host.entity.lifecycle.last_activity from approximateLastSignInDateTime device property.
- user.entity.lifecycle.last_activity from signInActivity.lastSignInDateTime. Requires the
  new user_sign_in_activity option, which adds signInActivity to the $select parameter
  on the users delta query.
- user.entity.attributes.permissions from the appRoleDisplayName of each app role assignment.
  Requires the new user_app_role_assignments option, which adds appRoleAssignments to
  the $expand parameter on the users delta query.
- user.entity.relationships.supervises (user_id, username, email) from the user's direct reports.
  Requires the new user_direct_reports option, which adds directReports to the $expand
  parameter on the users delta query. Note: Microsoft Graph limits this expansion to 20 objects per query.
- user.entity.attributes.mfa_enabled set to true when isMfaRegistered is true in the
  MFA registration details. Requires the new enrich_with_mfa option, which calls
  GET /reports/authenticationMethods/userRegistrationDetails once per sync/update cycle
  and merges results by user ID. Also requires the AuditLog.Read.All application permission
  in Azure in addition to existing permissions. Requires Kibana 9.4.0+.

Test sample are AI-generated logs with random data.

Warning

It cannot be merged until 9.4.0 is released.

Checklist

  • I have reviewed tips for building integrations and this pull request is aligned with them.
  • I have verified that all data streams collect metrics or logs.
  • I have added an entry to my package's changelog.yml file.
  • I have verified that Kibana version constraints are current according to guidelines.
  • I have verified that any added dashboard complies with Kibana's Dashboard good practices

Related issues

@chemamartinez chemamartinez self-assigned this Apr 23, 2026
@chemamartinez chemamartinez added enhancement New feature or request Integration:entityanalytics_entra_id Microsoft Entra ID Entity Analytics Team:Security-Service Integrations Security Service Integrations team [elastic/security-service-integrations] labels Apr 23, 2026
@github-actions

github-actions Bot commented Apr 23, 2026

Copy link
Copy Markdown
Contributor

✅ Vale Linting Results

No issues found on modified lines!


The Vale linter checks documentation changes against the Elastic Docs style guide.

To use Vale locally or report issues, refer to Elastic style guide for Vale.

Comment thread packages/entityanalytics_entra_id/changelog.yml Outdated
Comment thread packages/entityanalytics_entra_id/changelog.yml Outdated
@andrewkroh andrewkroh added the documentation Improvements or additions to documentation. Applied to PRs that modify *.md files. label Apr 23, 2026
@chemamartinez
chemamartinez marked this pull request as ready for review April 23, 2026 17:06
@chemamartinez
chemamartinez requested a review from a team as a code owner April 23, 2026 17:06
@elasticmachine

Copy link
Copy Markdown

Pinging @elastic/security-service-integrations (Team:Security-Service Integrations)

@elastic-vault-github-plugin-prod

elastic-vault-github-plugin-prod Bot commented Apr 23, 2026

Copy link
Copy Markdown
Contributor

🚀 Benchmarks report

To see the full report comment with /test benchmark fullreport

for (def owner : ctx.device.registered_owners) {
def entry = new HashMap();
def userObj = new HashMap();
if (owner?.id != null) userObj.put("id", owner.id);

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.

We can short circuit this by checking owner == null and continuing if it is.

Prefer not to use un-braced if.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This entire processor has been removed at 5a42108.

Comment on lines +557 to +559
if (ctx.user == null) ctx.user = new HashMap();
if (ctx.user.entity == null) ctx.user.entity = new HashMap();
if (ctx.user.entity.relationships == null) ctx.user.entity.relationships = new HashMap();

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.

Suggested change
if (ctx.user == null) ctx.user = new HashMap();
if (ctx.user.entity == null) ctx.user.entity = new HashMap();
if (ctx.user.entity.relationships == null) ctx.user.entity.relationships = new HashMap();
ctx.user = ctx.user ?: [:];
ctx.user.entity = ctx.user.entity ?: [:];
ctx.user.entity.relationships = ctx.user.entity.relationships ?: [:];

(similar above)

source: |
def supervises = new ArrayList();
for (def report : ctx.entityanalytics_entra_id.user.direct_reports) {
def entry = new HashMap();

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.

Similar comments here and below.

@efd6

efd6 commented Apr 28, 2026

Copy link
Copy Markdown
Contributor

The origin of the test inputs should be described in the commit message.

@chemamartinez
chemamartinez requested a review from efd6 April 30, 2026 17:08
@efd6

efd6 commented May 1, 2026

Copy link
Copy Markdown
Contributor

/test

@github-actions

This comment has been minimized.

@github-actions

github-actions Bot commented May 5, 2026

Copy link
Copy Markdown
Contributor

TL;DR

The failed Buildkite job is a docs/fields consistency failure, not a runtime pipeline bug. The PR moved supervisor email to user.entity.relationships.supervises.user.email, but packages/entityanalytics_entra_id/docs/README.md still documents the old field path.

Remediation

  • Regenerate and commit the package README docs for this package (or directly update the stale field row) so it matches current field definitions.
  • Re-run the package check step (.buildkite/scripts/test_one_package.sh packages/entityanalytics_entra_id ...) after the docs update.
Investigation details

Root Cause

ecs.yml was updated to define user.entity.relationships.supervises.user.email, and the ingest pipeline/test fixture were updated accordingly, but the checked-in docs table still contains user.entity.relationships.supervises.email.

  • packages/entityanalytics_entra_id/data_stream/entity/fields/ecs.yml:133-142
    • removed email
    • added user.email
  • packages/entityanalytics_entra_id/data_stream/entity/elasticsearch/ingest_pipeline/user.yml:246-250
    • moved report.mail into entry.user.email
  • packages/entityanalytics_entra_id/docs/README.md:373
    • still lists user.entity.relationships.supervises.email

Evidence

README.md is outdated. Rebuild the package with 'elastic-package build'
--- want
+++ got
@@ -372,3 +372,3 @@
-| user.entity.relationships.supervises.email |  | keyword |
+| user.entity.relationships.supervises.user.email |  | keyword |
Error: checking package failed: checking readme files are up-to-date failed: files do not match

Verification

  • Not run locally in this environment; diagnosis is based on the Buildkite failure log plus PR commit diff (52ad36c9e8).

Follow-up

After regenerating docs, check for any other renamed nested relationship fields to avoid repeated README drift failures in subsequent PRs.

Note

🔒 Integrity filter blocked 2 items

The following items were blocked because they don't meet the GitHub integrity level.

To allow these resources, lower min-integrity in your GitHub frontmatter:

tools:
  github:
    min-integrity: approved  # merged | approved | unapproved | none

What is this? | From workflow: PR Buildkite Detective

Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.

@chemamartinez
chemamartinez requested a review from a team as a code owner May 28, 2026 17:24
@elasticmachine

Copy link
Copy Markdown

💚 Build Succeeded

History

cc @chemamartinez

@alexreal1314

Copy link
Copy Markdown
Contributor

@chemamartinez I don't see as part of this pr assignment of user.entity.relationships.administers, is it something we can't infer on the integration level?

@chemamartinez

Copy link
Copy Markdown
Contributor Author

@alexreal1314 for this integration, it was populated at first but that change was reverted at 5a42108, as the most similar field at the source was the owner of the entity. After some discussions, we decided to revert it as the field specifies only administration relationships (not ownership) should be included here.

@chemamartinez
chemamartinez merged commit 375db4e into elastic:main Jun 3, 2026
10 checks passed
@elastic-vault-github-plugin-prod

Copy link
Copy Markdown
Contributor

Package entityanalytics_entra_id - 1.10.0 containing this change is available at https://epr.elastic.co/package/entityanalytics_entra_id/1.10.0/

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

Labels

documentation Improvements or additions to documentation. Applied to PRs that modify *.md files. enhancement New feature or request Integration:entityanalytics_entra_id Microsoft Entra ID Entity Analytics Team:Security-Service Integrations Security Service Integrations team [elastic/security-service-integrations]

5 participants