Skip to content

x-pack/winlogbeat: fix Kerberos ticket StatusDescription case-sensitivity - #51681

Merged
mergify[bot] merged 3 commits into
elastic:mainfrom
brian-mckinney:fix/kerberos-status-code-case-sensitivity
Jul 2, 2026
Merged

x-pack/winlogbeat: fix Kerberos ticket StatusDescription case-sensitivity#51681
mergify[bot] merged 3 commits into
elastic:mainfrom
brian-mckinney:fix/kerberos-status-code-case-sensitivity

Conversation

@brian-mckinney

Copy link
Copy Markdown
Contributor

Summary

  • In the Security module's ingest pipeline, winlog.event_data.Status is matched case-sensitively against the Kerberos status code lookup table. Every key with a hex letter is upper case (e.g. 0x1B), so a lower-case value like 0x1b fails to match and StatusDescription is left null.
  • Normalizes the lookup with .toUpperCase(), mirroring how the neighboring TicketEncryptionType processor already normalizes case.
  • Adds a changelog fragment.

Reported by a customer in https://github.com/elastic/sdh-beats/issues/7310. The same processor logic is duplicated in elastic/integrations (system and windows packages); a companion fix is up at elastic/integrations#19919.

Test plan

  • Verify pipeline simulate with a sample 4769 event where Status is 0x1b (lower case) now populates StatusDescription as KDC_ERR_MUST_USE_USER2USER.
  • Confirm existing pipeline/golden-file tests still pass.

Note: I was not able to add a new golden-file regression test for the lower-case case, since the existing tests in x-pack/winlogbeat/module/security/test/testdata/ are driven by binary .evtx fixtures that I don't have tooling to generate here.

…line

winlog.event_data.Status is matched case-sensitively against a lookup
table whose hex keys are all upper case (e.g. 0x1B), so a lower-case
value like 0x1b silently fails to resolve StatusDescription. Normalize
the lookup with toUpperCase(), mirroring how TicketEncryptionType is
already normalized a few processors above.

Reported in elastic/sdh-beats#7310
@brian-mckinney
brian-mckinney requested a review from a team as a code owner July 1, 2026 19:45
@botelastic botelastic Bot added the needs_team Indicates that the issue/PR needs a Team:* label label Jul 1, 2026
@botelastic

botelastic Bot commented Jul 1, 2026

Copy link
Copy Markdown

This pull request doesn't have a Team:<team> label.

@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

🤖 GitHub comments

Just comment with:

  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)
  • /test : Run the Buildkite pipeline.

@mergify

mergify Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

This pull request does not have a backport label.
If this is a bug or security fix, could you label this PR @brian-mckinney? 🙏.
For such, you'll need to label your PR with:

  • The upcoming major version of the Elastic Stack
  • The upcoming minor version of the Elastic Stack (if you're not pushing a breaking change)

To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-8./d is the label to automatically backport to the 8./d branch. /d is the digit
  • backport-active-all is the label that automatically backports to all active branches.
  • backport-active-8 is the label that automatically backports to all active minor branches for the 8 major.
  • backport-active-9 is the label that automatically backports to all active minor branches for the 9 major.

@coderabbitai

coderabbitai Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Enterprise

Run ID: 50028923-1148-49a7-814e-a011105541d9

📥 Commits

Reviewing files that changed from the base of the PR and between 5fdc53c and 7a77e7b.

📒 Files selected for processing (1)
  • x-pack/winlogbeat/module/security/ingest/security_standard.yml
🚧 Files skipped from review as they are similar to previous changes (1)
  • x-pack/winlogbeat/module/security/ingest/security_standard.yml

📝 Walkthrough

Walkthrough

This change updates the winlogbeat Security ingest pipeline so Kerberos ticket status descriptions are looked up using a normalized Status value instead of the raw field. It also adds a changelog fragment documenting the bug fix for lower-case status handling in winlogbeat.

Changes

Related issues: 1782933214

Related PRs: None provided

Suggested labels: bug-fix, winlogbeat, changelog

Suggested reviewers: winlogbeat module maintainers

Sequence Diagram(s)

Not applicable.

Poem:
A status came in lowercase,
The lookup lost its place.
Now normalized keys align,
And Kerberos descriptions shine.

🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • 🛠️ Update Documentation

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@x-pack/winlogbeat/module/security/ingest/security_standard.yml`:
- Line 1056: The StatusDescription lookup in the security_standard ingest script
is using `ctx.winlog.event_data.Status.toUpperCase()`, which changes the `0x`
prefix and prevents matching the `params` keys. Update the `StatusDescription`
assignment to normalize the key the same way as the existing
`TicketEncryptionType` handling in this pipeline, or explicitly preserve the
`0x` prefix while uppercasing only the suffix, so the lookup resolves correctly.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Enterprise

Run ID: f1c575e9-0320-441c-af64-34581a60a33e

📥 Commits

Reviewing files that changed from the base of the PR and between 5acbbac and 5fdc53c.

📒 Files selected for processing (2)
  • changelog/fragments/1782933214-fix-kerberos-status-description-case-sensitivity.yaml
  • x-pack/winlogbeat/module/security/ingest/security_standard.yml

Comment thread x-pack/winlogbeat/module/security/ingest/security_standard.yml Outdated
The previous fix uppercased the entire Status string, turning "0x1b"
into "0X1B" and "0x0" into "0X0" -- neither matches the params table,
whose keys use a lowercase "0x" prefix. Preserve the prefix and
uppercase only the hex digits after it.
@mergify

mergify Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

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

@mergify

mergify Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Merge Queue Status

This pull request spent 47 minutes 25 seconds in the queue, including 46 minutes 28 seconds running CI.

Required conditions to merge

@mergify mergify Bot added the queued label Jul 2, 2026
mergify Bot added a commit that referenced this pull request Jul 2, 2026
@mergify
mergify Bot merged commit 635cd69 into elastic:main Jul 2, 2026
24 checks passed
@mergify mergify Bot removed the queued label Jul 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs_team Indicates that the issue/PR needs a Team:* label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants