forked from elastic/beats
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Winlogbeat: Fix compatibility problems with newer OS versions in CI (e…
…lastic#22362) * Fix EVT_VARIANT struct definition for GOARCH=386 The first field of the structure, a union, didn't have the proper size when compiled for 32-bits, causing "invalid argument" errors when the struct was passed to an API. Also, some EVT_VARIANT types weren't being handled properly. * Remove formatting assertion in TestFormatMessage Under most Windows versions, GUID values cannot be substituted with string values. However, this is not the case under at least Win7 32bit. Just disable the testing assertion as it has no impact. * Update generated syscalls to avoid bug under 32-bit Go's mkwinsyscall is generating syscall invocations that don't work properly under GOARCH=386 (or any 32-bit arch). This only affects functions that receive a 64-bit parameter, in this case only EvtSeek is affected. This replaces `mkwinsyscall` with a patched one that adds some workaround code. * Enable all windows tests * Disable TestFormatMessage/no_metadata tests Under Windows 10, event formatting is not failing with an error even though not metadata is being passed. * Testing: Error check on publishing events to an event log Under Windows 7 and Windows 10, writes to a newly created event log fail occasionally. It seems that there is a delay between when an event log is created and publishing events to it is allowed. This commit updates the tests to retry on failure when creating an event log for testing. * Sysmon: Ignore winlog.user.* fields during test For some reason, the following fields: - winlog.user.type - winlog.user.name - winlog.user.domain are not populated by the Sysmon module under Windows 7 32-bit. I couldn't reproduce outside of CI, where it's failing to lookup SID `S-1-5-18`: ``` testing_windows.go:69: Expected and actual are different: --- Expected +++ Actual @@ -47,6 +47,3 @@ "user": { - "domain": "NT AUTHORITY", - "identifier": "S-1-5-18", - "name": "SYSTEM", - "type": "Well Known Group" + "identifier": "S-1-5-18" }, ``` This commit updates the test to ignore those fields and removes them from the golden files. * Testing: limit event size in testWindowsEventLog Under Windows 10, writing large events (31800 bytes) results in an empty event log. Seems that the events are being silently dropped due to being too big.
- Loading branch information
Showing
22 changed files
with
884 additions
and
1,471 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.