Skip to content

[auditd] Map enriched UID/AUID fields - #20237

Merged
nicholasberlin merged 1 commit into
mainfrom
fix/auditd-enriched-user-name-fields
Jul 22, 2026
Merged

nicholasberlin merged 1 commit into
mainfrom
fix/auditd-enriched-user-name-fields

Conversation

@nicholasberlin

Copy link
Copy Markdown
Contributor

Proposed commit message

WHAT: Map the enriched auditd username/group fields (UID, GID, EUID, EGID, FSUID, FSGID, SUID, SGID, AUID, AGID) that appear as key=value suffixes on kernel audit records (e.g. UID="root" AUID="unset") to their corresponding ECS user.* name fields. The mapping uses set processors with override: false so pre-existing values are never clobbered, and skips placeholder values ("unset", "?") that carry no meaningful identity. All mapped names are also appended to related.user for cross-referencing.

WHY: The auditd enriched format already maps the numeric ID fields (e.g. user.id, user.audit.id) from type=SYSCALL records, but the human-readable name counterparts were left unmapped. This meant searches and alerts built on user.name or related.user would miss events where only the enriched format was available, making the integration inconsistent compared to the go-libaudit preparsed path which does populate these fields.

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

Author's Checklist

  • Pipeline test regenerated with elastic-package test pipeline --generate and expected output reviewed

How to test this PR locally

cd packages/auditd
elastic-package stack up -d --services=elasticsearch
elastic-package test pipeline
elastic-package stack down

Related issues

@nicholasberlin
nicholasberlin requested a review from a team as a code owner July 20, 2026 18:25
@nicholasberlin nicholasberlin added the bug Something isn't working, use only for issues label Jul 20, 2026
@github-actions

github-actions Bot commented Jul 20, 2026 •

Copy link
Copy Markdown
Contributor

Elastic Docs Style Checker (Vale)

Summary: 1 warning found

⚠️ Warnings (1): Fix when the suggestion improves clarity or correctness.
File Line Rule Message
packages/auditd/changelog.yml 4 Elastic.Latinisms Latin terms and abbreviations are a common source of confusion. Use 'and so on' instead of 'etc'.

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.

@nicholasberlin
nicholasberlin force-pushed the fix/auditd-enriched-user-name-fields branch from 5d7262e to 8210b2b Compare July 20, 2026 18:31
@github-actions

This comment has been minimized.

@github-actions

Copy link
Copy Markdown
Contributor

TL;DR

The auditd package check failed because the committed generated packages/auditd/docs/README.md is stale. The PR adds related.user and user.group.name in packages/auditd/data_stream/log/fields/ecs.yml, but those exported-field rows are missing from the generated README.

Remediation

  • From packages/auditd, run elastic-package build to regenerate the package documentation.
  • Commit the resulting packages/auditd/docs/README.md update, including the related.user and user.group.name rows.
  • Re-run the Check integrations auditd package check.
Investigation details

Root Cause

The PR adds the ECS field definitions related.user and user.group.name in packages/auditd/data_stream/log/fields/ecs.yml and uses them in the ingest pipeline. The generated documentation was not rebuilt, so CI detects a mismatch between the generated README and its source metadata.

Evidence

  • Build: https://buildkite.com/elastic/integrations/builds/46292
  • Job/step: Check integrations auditd
  • Key log excerpt: README.md is outdated. Rebuild the package with elastic-package build; the diff shows missing related.user and user.group.name rows, followed by checking readme files are up-to-date failed.
  • PR source: packages/auditd/data_stream/log/fields/ecs.yml contains both new fields, while packages/auditd/docs/README.md does not.

Verification

  • Not run; this is a read-only CI diagnosis based on the failed Buildkite log and PR contents.

What is this? | From workflow: PR Buildkite Detective

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

@nicholasberlin nicholasberlin added bugfix Pull request that fixes a bug issue and removed bug Something isn't working, use only for issues labels Jul 20, 2026
@@ -1,4 +1,9 @@
# later versions go on top
- version: "3.23.1"

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 conflicts with #20237, update this or that depending on merge order.

@nicholasberlin
nicholasberlin force-pushed the fix/auditd-enriched-user-name-fields branch from 8210b2b to 060d127 Compare July 20, 2026 19:25
@andrewkroh andrewkroh added Integration:auditd Auditd Logs Team:Security-Linux Platform Linux Platform Security team [elastic/sec-linux-platform] labels Jul 20, 2026
@infra-vault-gh-plugin-prod

Copy link
Copy Markdown

Pinging @elastic/sec-linux-platform (Team:Security-Linux Platform)

@nicholasberlin
nicholasberlin force-pushed the fix/auditd-enriched-user-name-fields branch from 060d127 to 22a4b95 Compare July 21, 2026 12:09
SERVICE_STOP and other enriched events expose usernames as UID="root"
but only numeric ids were mapped, leaving user.name unset.
@nicholasberlin
nicholasberlin force-pushed the fix/auditd-enriched-user-name-fields branch from 22a4b95 to 6ea4ae8 Compare July 21, 2026 12:09
@elastic-vault-github-plugin-prod

Copy link
Copy Markdown
Contributor

✅ All changelog entries have the correct PR link.

@infra-vault-gh-plugin-prod

Copy link
Copy Markdown

💚 Build Succeeded

History

@andrewkroh andrewkroh added the documentation Improvements or additions to documentation. Applied to PRs that modify *.md files. label Jul 21, 2026
@mergify

mergify Bot commented Jul 22, 2026 •

Copy link
Copy Markdown
Contributor

Queued — the merge queue status continues in this comment ↓.

@nicholasberlin
nicholasberlin merged commit da13a70 into main Jul 22, 2026
9 of 10 checks passed
@nicholasberlin
nicholasberlin deleted the fix/auditd-enriched-user-name-fields branch July 22, 2026 14:13
@mergify

mergify Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • 🟠 Waiting for queue conditions
  • ⏳ Enter queue
  • ⏳ Run checks
  • ⏳ Merge
Required conditions to enter a queue
  • -closed [📌 queue requirement]
  • -conflict [📌 queue requirement]
  • -draft [📌 queue requirement]
  • any of [📌 queue -> configuration change requirements]:
    • -mergify-configuration-changed
    • check-success = Configuration changed
  • any of [🔀 queue conditions]:
    • all of [📌 queue conditions of queue rule default]:
      • github-review-approved [🛡 GitHub branch protection] (documentation)
      • github-review-approved [🛡 GitHub repository ruleset rule [org] Require a PR for Renovate] (documentation)
      • github-review-approved [🛡 GitHub repository ruleset rule [org] Require a PR] (documentation)
      • github-review-decision = APPROVED [🛡 GitHub branch protection] (documentation)
      • any of [🛡 GitHub branch protection]:
        • check-success = CLA
        • check-neutral = CLA
        • check-skipped = CLA
      • any of [🛡 GitHub branch protection]:
        • check-success = buildkite/integrations
        • check-neutral = buildkite/integrations
        • check-skipped = buildkite/integrations

@mergify

mergify Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

queue

☑️ The pull request has been merged manually

Details

The pull request has been merged manually at da13a70

nicholasberlin added a commit that referenced this pull request Jul 22, 2026
PR #20237 (merged to main after this branch's expected file was
generated) maps the enriched AUID value to user.audit.name and
related.user. Regenerated test-auditd-useradd.log-expected.json so the
expected output includes those fields.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Pull request that fixes a bug issue documentation Improvements or additions to documentation. Applied to PRs that modify *.md files. Integration:auditd Auditd Logs Team:Security-Linux Platform Linux Platform Security team [elastic/sec-linux-platform]

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Auditd Logs]: User-related ECS fields (user.name, user.effective.name, related.user) are not populated for SERVICE_STOP events

3 participants