-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Winlogbeat] Tolerate faults when Windows Event Log session is interrupted #28191
[Winlogbeat] Tolerate faults when Windows Event Log session is interrupted #28191
Conversation
- Added a retry mechanism to winlog/input and winlogbeat to reopen a session to Windows Event Log when certain error conditions are encountered. - This applies when opening a session to Windows Event Log and also when reading from Windows Event Log.
💚 Build Succeeded
Expand to view the summary
Build stats
Test stats 🧪
💚 Flaky test reportTests succeeded. 🤖 GitHub commentsTo re-run your PR in the CI, just comment with:
|
Pinging @elastic/security-external-integrations (Team:Security-External Integrations) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Just one suggestion from me.
filebeat/input/winlog/input.go
Outdated
openErr := api.Open(evtCheckpoint) | ||
if eventlog.IsRecoverable(openErr) { | ||
log.Errorf("Encountered recoverable error when opening Windows Event Log: %v", openErr) | ||
time.Sleep(time.Second * 5) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think using timed.Wait(cancelCtx, 5 * time.Second)
would be better because it would allow the sleep to unblock if cancellation occurs.
…upted (#28191) - Added a retry mechanism to winlog/input and winlogbeat to reopen a session to Windows Event Log when certain error conditions are encountered. - This applies when opening a session to Windows Event Log and also when reading from Windows Event Log. (cherry picked from commit 3c1731d)
…t Log session is interrupted (#28283) * [Winlogbeat] Tolerate faults when Windows Event Log session is interrupted (#28191) - Added a retry mechanism to winlog/input and winlogbeat to reopen a session to Windows Event Log when certain error conditions are encountered. - This applies when opening a session to Windows Event Log and also when reading from Windows Event Log. (cherry picked from commit 3c1731d) Co-authored-by: Taylor Swanson <90622908+taylor-swanson@users.noreply.github.com>
* upstream/master: (73 commits) Remove GCP support from Functionbeat (elastic#28253) Move labels and annotations under kubernetes.namespace. (elastic#27917) Update go release version 1.17.1 (elastic#27543) Osquerybeat: Runner and Fetcher unit tests (elastic#28290) Osquerybeat: Improve handling of osquery.autoload file, allow customizations (elastic#28289) seccomp: allow clone3 syscall for x86 (elastic#28117) packetbeat/protos/dns: don't render missing A and AAAA addresses from truncated records (elastic#28297) [7.x] [DOCS] Update api_key example on elasticsearch output (elastic#28288) [cloud][docker] use the private docker namespace (elastic#28286) Update aws-lambda-go library version to 1.13.3 (elastic#28236) Deprecate common.Float (elastic#28280) Filebeat: Change compatibility test stage to test against previous minor instead of 7.11 (elastic#28274) x-pack/filebeat/module/threatintel/misp: add support for secondary object attribute handling (elastic#28124) Explicitly pass http config to doppler consumer (elastic#28277) processors/actions/add_fields: Do not panic if event.Fields is nil map (elastic#28219) Resolved timestamp for defender atp (elastic#28272) [Winlogbeat] Tolerate faults when Windows Event Log session is interrupted (elastic#28191) [elastic-agent] proxy requests to subprocesses to their metrics endpoints (elastic#28165) Build cloud docker images for elastic-agent (elastic#28134) Upgrade k8s go-client library (elastic#28228) ...
…upted (elastic#28191) - Added a retry mechanism to winlog/input and winlogbeat to reopen a session to Windows Event Log when certain error conditions are encountered. - This applies when opening a session to Windows Event Log and also when reading from Windows Event Log.
I am excited for this fix, as it seems this happens a lot to the Windows Defender channel. |
What does this PR do?
session to Windows Event Log when certain error conditions are encountered.
also when reading from Windows Event Log.
Why is it important?
Checklist
[ ] I have made corresponding changes to the documentation[ ] I have made corresponding change to the default configuration files[ ] I have added tests that prove my fix is effective or that my feature worksCHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.How to test this PR locally
Reproducing the issue
matter, it can be
Security
or other channels. Make sure debug logging and logging to STDERR is enabled.Windows Event Log
service.Windows Event Log
service has no effect. New event logs are not picked up by filebeat/winlogbeat.Testing the fix
Windows Event Log
service.Windows Event Log
service.Logs
The following logs are from filebeat. Winlogbeat produces similar logs.
Logs showing normal activity (when no event logs are being generated):
Logs indicating original problem (error may vary):
Logs showing issue resolved by fix (error may vary):
Related issues