Repository navigation
[auditd] Fix missing ECS user/group fields for IAM - #20238
Conversation
✅ Elastic Docs Style Checker (Vale)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. |
This comment has been minimized.
This comment has been minimized.
TL;DRThe Remediation
Investigation detailsRoot CauseThe PR commit introduces the Evidence
Verification
What is this? | From workflow: PR Buildkite Detective Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not. |
|
Pinging @elastic/sec-linux-platform (Team:Security-Linux Platform) |
1895c50 to
08c1f8b
Compare
08c1f8b to
9eedc03
Compare
Extends the copy directives for ADD_USER, DEL_USER, ADD_GROUP, DEL_GROUP, USER_CHAUTHTOK, USER_LOGOUT, USER_START, and ACCT_LOCK to also source from the enriched uppercase fields (AUID, UID, ID) that the kernel appends as key=value pairs after the main event body. When the log line uses the Unit Separator (U+001D) as the delimiter, the enriched fields are KV-parsed correctly into auditd.log.AUID / .UID / .ID, but the copy directives only referenced lowercase counterparts (auid, uid, id), leaving user.name, user.effective.name, user.target.name, and group.name unpopulated. Also adds a gsub step to normalise the malformed format where res=success is concatenated directly with the next uppercase field (res=successUID="root") — a missing delimiter that otherwise prevents UID from being extracted and sets event.outcome to unknown. Filters the placeholder values "unset" and "?" so they are never promoted to .name fields. Adds auditd.log.ID to the field definitions.
107f8ca to
d7ecbde
Compare
|
looks like UNLOCK also needs a copy directive like LOCK: SummaryThe PR correctly fixes the root cause: for modern auditd with U+001D enrichment, the copy directives in FindingsSignificant
ACCT_UNLOCK:
- event:
action:
- unlocked-account
category:
- iam
type:
- user
- info
Minor
These two types have copy directives but they reference only
GRP_MGMT:
- copy:
- from: [auid]
to: user
- from: [uid]
to: group # uid (process owner, typically 0/root) mapped to group field
- from: [uid]
to: user.effective
VerdictREQUEST_CHANGES — the |
Review feedback: ACCT_UNLOCK had the same missing copy directives as ACCT_LOCK before this fix, so unlock events also dropped user.name, user.effective.name, and user.target.name under the enriched (U+001D) format. Mirror the ACCT_LOCK directives and cover it in the pipeline tests.
|
|
✅ All changelog entries have the correct PR link. |
🚀 Benchmarks reportTo see the full report comment with |
💚 Build Succeeded
History
|
Proposed commit message
WHAT: Extended the IAM event type copy directives (ADD_USER, DEL_USER, ADD_GROUP, DEL_GROUP, USER_CHAUTHTOK, USER_LOGOUT, USER_START, ACCT_LOCK) to source ECS name fields from the enriched uppercase counterparts (AUID, UID, ID) in addition to the existing lowercase numeric fields. When auditd appends enriched context using the Unit Separator (U+001D, \x1d) as delimiter, the KV processor correctly extracts auditd.log.AUID, .UID, and .ID, but the copy directives never read them — so user.name, user.effective.name, user.target.name, and group.name were silently absent while the numeric user.id / user.effective.id fields were present.
Also added two gsub processors in raw.yml to normalize the malformed format where res=success is directly concatenated with a following uppercase KV key (res=successUID="root"), which previously caused UID not to be extracted and event.outcome to be set to unknown. Added placeholder filtering ("unset", "?") in the copy script. Added auditd.log.ID to the field definitions.
WHY: Customer reported that a number of critical Elastic Security detection rules were silently failing because user.name and related fields were not populated for these IAM event types. The root cause is that modern auditd (and auditd on SELinux systems) commonly uses the \x1d delimiter format, and all affected customers running 9.x agent versions would hit this issue.
Checklist
Author's Checklist
How to test this PR locally
The 9 new entries at the end of test-auditd-useradd.log cover all 8 affected event types. Inspect test-auditd-useradd.log-expected.json events 8–16 and confirm user.name, user.effective.name, user.target.name, and group.name are populated.
Related issues