Skip to content

[receiver/windowseventlog] Add SID resolution feature#45878

Merged
atoulme merged 28 commits intoopen-telemetry:mainfrom
observIQ:gpattison/PIPE-563-resolve-sids
Mar 6, 2026
Merged

[receiver/windowseventlog] Add SID resolution feature#45878
atoulme merged 28 commits intoopen-telemetry:mainfrom
observIQ:gpattison/PIPE-563-resolve-sids

Conversation

@postnati
Copy link
Copy Markdown
Contributor

@postnati postnati commented Feb 4, 2026

Description

Adds automatic Security Identifier (SID) resolution to the Windows Event Log Receiver. This enhancement resolves Windows SIDs to human-readable user and group names using the Windows LSA API, making Windows event logs significantly more usable for security operations.

Link to tracking issue

Fixes #45875

Testing

Comprehensive unit tests added covering:

  • Cache operations (Get, Set, Close)
  • Well-known SID resolution (45+ built-in mappings)
  • Invalid SID handling
  • SID field detection logic
  • End-to-end enrichment scenarios
  • Platform-specific builds (Windows/non-Windows)

Documentation

Added comprehensive documentation to README.md, including:

  • Complete configuration options and defaults
  • Before/after examples with real SID resolution
  • Performance characteristics and benchmarks
  • Troubleshooting guide
  • Well-known SIDs reference
  • Configuration example files in testdata/

Documentation Files:

  • receiver/windowseventlogreceiver/README.md - Updated with SID information
  • receiver/windowseventlogreceiver/testdata/README.md - Complete setup guide
  • receiver/windowseventlogreceiver/testdata/collector-config-example.yaml - Example config

@postnati postnati requested review from a team and pjanotti as code owners February 4, 2026 19:15
@linux-foundation-easycla
Copy link
Copy Markdown

linux-foundation-easycla bot commented Feb 4, 2026

CLA Signed

The committers listed above are authorized under a signed CLA.

@github-actions github-actions bot added the first-time contributor PRs made by new contributors label Feb 4, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 4, 2026

Welcome, contributor! Thank you for your contribution to opentelemetry-collector-contrib.

Important reminders:

A maintainer will review your pull request soon. Thank you for helping make OpenTelemetry better!

@pjanotti
Copy link
Copy Markdown
Contributor

pjanotti commented Feb 6, 2026

@postnati, fyi - I can only start reviewing on Monday

Copy link
Copy Markdown
Contributor

@pjanotti pjanotti left a comment

Choose a reason for hiding this comment

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

Thanks @postnati it is looking good, but I can tell that it will fail some lint tests. I will allow the tests to run so you already have the list from the PR CI.

Comment thread receiver/windowseventlogreceiver/receiver.go Outdated
Comment thread receiver/windowseventlogreceiver/receiver.go Outdated
Comment thread receiver/windowseventlogreceiver/internal/sidcache/cache_windows.go Outdated
Comment thread receiver/windowseventlogreceiver/sid_enrichment_windows.go Outdated
Comment thread receiver/windowseventlogreceiver/testdata/README.md
Comment thread receiver/windowseventlogreceiver/README.md
Comment thread receiver/windowseventlogreceiver/README.md
Comment thread receiver/windowseventlogreceiver/internal/sidcache/cache.go Outdated
Comment thread receiver/windowseventlogreceiver/internal/sidcache/cache.go Outdated
Comment thread receiver/windowseventlogreceiver/internal/sidcache/cache.go Outdated
@paulojmdias
Copy link
Copy Markdown
Member

/workflow-approve

@postnati postnati force-pushed the gpattison/PIPE-563-resolve-sids branch from 4976faf to 4c6f3d7 Compare March 2, 2026 13:27
@postnati
Copy link
Copy Markdown
Contributor Author

postnati commented Mar 2, 2026

Rebased onto contrib upstream/main. Fixed lint issues with Windows-only code used by cache_windows.go, and removed the dead lookupSID stub from cache_other.go.

@pjanotti Is there anything else that needs to be done to get this merged?

@pjanotti
Copy link
Copy Markdown
Contributor

pjanotti commented Mar 3, 2026

Sorry @postnati somehow I missed the changes after my round of comments, looking...

Copy link
Copy Markdown
Contributor

@pjanotti pjanotti left a comment

Choose a reason for hiding this comment

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

LGTM minus the CI failures - @postnati ping me as soon as you have a chance to look at them

postnati added 13 commits March 6, 2026 13:05
Implements core SID resolution caching with:
- LRU cache with configurable size and TTL
- Windows LSA API integration via LsaLookupSids2
- Well-known SID static map (S-1-5-18, BUILTIN groups, etc.)
- Thread-safe cache with atomic statistics
- Platform-specific builds (Windows vs other)

The cache provides fast local SID-to-username resolution
without requiring remote LDAP/AD queries.

Part of PIPE-563: SID resolution for Windows Event Log Receiver
Tests cover:
- Cache creation with various configurations
- Well-known SID resolution (S-1-5-18, BUILTIN groups, etc.)
- Invalid SID format handling
- SID field name detection
- Cache statistics tracking
- Cache lifecycle (close/cleanup)
- SID format validation

All tests pass on macOS (using well-known SIDs only).
Windows-specific LSA API tests will be validated on Windows platform.

Part of PIPE-563: SID resolution for Windows Event Log Receiver
Adds configuration options for SID-to-username resolution:
- enabled: Enable/disable SID resolution (default: false)
- cache_size: Maximum cached SIDs (default: 10000)
- cache_ttl: Cache entry lifetime (default: 15m)

Configuration example:
```yaml
receivers:
  windowseventlog:
    channel: Security
    resolve_sids:
      enabled: true
      cache_size: 50000
      cache_ttl: 30m
```

Part of PIPE-563: SID resolution for Windows Event Log Receiver
Adds complete SID-to-username resolution with log enrichment:

**Consumer Wrapper (`sid_enrichment_windows.go`):**
- Intercepts logs from Stanza adapter
- Enriches security.user_id field with resolved SID data
- Enriches all SID fields in event_data (SubjectUserSid, TargetUserSid, etc.)
- Adds companion fields: *_Resolved, *_Domain, *_Account, *_Type
- Handles both array and flat event_data formats
- Graceful error handling with debug logging

**Factory Integration (`receiver_windows.go`):**
- Creates SID cache when resolve_sids.enabled = true
- Wraps consumer with SID enrichment before Stanza adapter
- Cache lifecycle managed by receiver (created at startup)
- Logs cache configuration on initialization

**Cross-Platform Support (`sid_enrichment_other.go`):**
- Stub for macOS/Linux (compiles but no-op)
- Allows development on non-Windows platforms

Example enriched output:
```json
"event_data": {
  "data": [
    {"SubjectUserSid": "S-1-5-18"},
    {"SubjectUserSid_Resolved": "NT AUTHORITY\\SYSTEM"},
    {"SubjectUserSid_Domain": "NT AUTHORITY"},
    {"SubjectUserSid_Account": "SYSTEM"},
    {"SubjectUserSid_Type": "WellKnownGroup"}
  ]
}
```

Part of PIPE-563: SID resolution for Windows Event Log Receiver
Fixes compilation error where raw values were passed to Logger.Info
instead of using zap.Int() and zap.Duration() field constructors.

Part of PIPE-563: SID resolution for Windows Event Log Receiver
…ry documentation

- Add testdata directory with test configurations from upstream OTel contrib
- Remove temporary SID resolution documentation files
postnati added 13 commits March 6, 2026 13:05
…ntribution

Update copyright headers from observIQ to OpenTelemetry Authors with SPDX license identifiers, and migrate import paths from bindplane-otel-collector to opentelemetry-collector-contrib. Also update documentation and configuration examples to reflect the new build process and binary names.

Changes:
- Replace observIQ copyright with OpenTelemetry Authors copyright and SPDX-License-Identifier
- Update import paths from github.com/observiq/bindplane-otel-collector to github.com/open-telemetry/opentelemetry-collector-contrib
- Fix linter issues: use errors.New instead of fmt.Errorf, fix unused receiver warning, add nolint directive for non-Windows stub
- Update testdata documentation with correct build commands and binary names
- Update collector configuration examples with new binary names
Add changelog entry for the Windows Event Log Receiver SID resolution
enhancement per OpenTelemetry contribution guidelines.
Links changelog entry to upstream issue for SID resolution feature.
…ent concurrency safety

Assisted-by: Claude Opus 4.6
@postnati postnati force-pushed the gpattison/PIPE-563-resolve-sids branch from 1d59418 to 853e03c Compare March 6, 2026 18:06
@pjanotti pjanotti added the ready to merge Code review completed; ready to merge by maintainers label Mar 6, 2026
@atoulme atoulme merged commit 06d436c into open-telemetry:main Mar 6, 2026
207 checks passed
@otelbot
Copy link
Copy Markdown
Contributor

otelbot bot commented Mar 6, 2026

Thank you for your contribution @postnati! 🎉 We would like to hear from you about your experience contributing to OpenTelemetry by taking a few minutes to fill out this survey. If you are getting started contributing, you can also join the CNCF Slack channel #opentelemetry-new-contributors to ask for guidance and get help.

rite7sh pushed a commit to rite7sh/opentelemetry-collector-contrib that referenced this pull request Mar 9, 2026
…#45878)

#### Description
Adds automatic Security Identifier (SID) resolution to the Windows Event
Log Receiver. This enhancement resolves Windows SIDs to human-readable
user and group names using the Windows LSA API, making Windows event
logs significantly more usable for security operations.

#### Link to tracking issue
Fixes open-telemetry#45875

#### Testing
 Comprehensive unit tests added covering:
  - Cache operations (Get, Set, Close)
  - Well-known SID resolution (45+ built-in mappings)
  - Invalid SID handling
  - SID field detection logic
  - End-to-end enrichment scenarios
  - Platform-specific builds (Windows/non-Windows)

#### Documentation
Added comprehensive documentation to README.md, including:
  - Complete configuration options and defaults
  - Before/after examples with real SID resolution
  - Performance characteristics and benchmarks
  - Troubleshooting guide
  - Well-known SIDs reference
  - Configuration example files in testdata/
 
 **Documentation Files:**
- `receiver/windowseventlogreceiver/README.md` - Updated with SID
information
- `receiver/windowseventlogreceiver/testdata/README.md` - Complete setup
guide
-
`receiver/windowseventlogreceiver/testdata/collector-config-example.yaml`
- Example config
rite7sh added a commit to rite7sh/opentelemetry-collector-contrib that referenced this pull request Mar 9, 2026
…#45878)

#### Description
Adds automatic Security Identifier (SID) resolution to the Windows Event
Log Receiver. This enhancement resolves Windows SIDs to human-readable
user and group names using the Windows LSA API, making Windows event
logs significantly more usable for security operations.

#### Link to tracking issue
Fixes open-telemetry#45875

#### Testing
 Comprehensive unit tests added covering:
  - Cache operations (Get, Set, Close)
  - Well-known SID resolution (45+ built-in mappings)
  - Invalid SID handling
  - SID field detection logic
  - End-to-end enrichment scenarios
  - Platform-specific builds (Windows/non-Windows)

#### Documentation
Added comprehensive documentation to README.md, including:
  - Complete configuration options and defaults
  - Before/after examples with real SID resolution
  - Performance characteristics and benchmarks
  - Troubleshooting guide
  - Well-known SIDs reference
  - Configuration example files in testdata/

 **Documentation Files:**
- `receiver/windowseventlogreceiver/README.md` - Updated with SID
information
- `receiver/windowseventlogreceiver/testdata/README.md` - Complete setup
guide
-
`receiver/windowseventlogreceiver/testdata/collector-config-example.yaml`
- Example config
dpaasman00 pushed a commit to observIQ/opentelemetry-collector-contrib that referenced this pull request Mar 10, 2026
…#45878)

Adds automatic Security Identifier (SID) resolution to the Windows Event
Log Receiver. This enhancement resolves Windows SIDs to human-readable
user and group names using the Windows LSA API, making Windows event
logs significantly more usable for security operations.

Fixes open-telemetry#45875

 Comprehensive unit tests added covering:
  - Cache operations (Get, Set, Close)
  - Well-known SID resolution (45+ built-in mappings)
  - Invalid SID handling
  - SID field detection logic
  - End-to-end enrichment scenarios
  - Platform-specific builds (Windows/non-Windows)

Added comprehensive documentation to README.md, including:
  - Complete configuration options and defaults
  - Before/after examples with real SID resolution
  - Performance characteristics and benchmarks
  - Troubleshooting guide
  - Well-known SIDs reference
  - Configuration example files in testdata/

 **Documentation Files:**
- `receiver/windowseventlogreceiver/README.md` - Updated with SID
information
- `receiver/windowseventlogreceiver/testdata/README.md` - Complete setup
guide
-
`receiver/windowseventlogreceiver/testdata/collector-config-example.yaml`
- Example config
avleentwilio pushed a commit to avleentwilio/opentelemetry-collector-contrib that referenced this pull request Apr 1, 2026
…#45878)

#### Description
Adds automatic Security Identifier (SID) resolution to the Windows Event
Log Receiver. This enhancement resolves Windows SIDs to human-readable
user and group names using the Windows LSA API, making Windows event
logs significantly more usable for security operations.

#### Link to tracking issue
Fixes open-telemetry#45875

#### Testing
 Comprehensive unit tests added covering:
  - Cache operations (Get, Set, Close)
  - Well-known SID resolution (45+ built-in mappings)
  - Invalid SID handling
  - SID field detection logic
  - End-to-end enrichment scenarios
  - Platform-specific builds (Windows/non-Windows)

#### Documentation
Added comprehensive documentation to README.md, including:
  - Complete configuration options and defaults
  - Before/after examples with real SID resolution
  - Performance characteristics and benchmarks
  - Troubleshooting guide
  - Well-known SIDs reference
  - Configuration example files in testdata/
 
 **Documentation Files:**
- `receiver/windowseventlogreceiver/README.md` - Updated with SID
information
- `receiver/windowseventlogreceiver/testdata/README.md` - Complete setup
guide
-
`receiver/windowseventlogreceiver/testdata/collector-config-example.yaml`
- Example config
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

first-time contributor PRs made by new contributors ready to merge Code review completed; ready to merge by maintainers receiver/windowseventlog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[receiver/windowseventlog] Add SID resolution feature to automatically resolve Windows Security Identifiers

4 participants