-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Adds support for the computer field in Windows Eventlogs #6952
Adds support for the computer field in Windows Eventlogs #6952
Conversation
|
To pass the code style enforcement check, you can run |
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.
The changes look good to me.
I built and ran on Windows 10 and it works well with some quick testing.
osqueryi.exe --disable_events=false --windows_event_channels="System,Application,Setup,Security" --enable_windows_events_publisher=true --enable_windows_events_subscriber=true
osquery> select * from windows_events LIMIT 10;
It looks like the newly added test case is failing on the CI because certain mock event test data ("recorded events") (JSON files, here) do not have the It should be added as E.g. for
To re-run just the failing test locally:
|
Is this an error in the test data, or is this field sometimes missing? |
@alessandrogario you originally put these test files together, right? Were they manually exported from the event log selecting only certain fields? I guess I am echoing the question @theopolis originally asked here #6280 (comment) |
In a separate conversation with me he said that he exported these Windows events manually from Windows Event Viewer or possibly Hopefully that answers the question of why this particular field is missing. Example:
You can see that the events normally include |
Should I manually add that field to the test files? |
Yea, that's all that is needed. I manually confirmed that with a couple of them. It will unfortunately be a little tedious to update them all manually, but you can edit each XML file with an
and then each JSON file with
Except |
not a problem, will get it done and submitted. Thanks for the guidance! |
Looks like that JSON parsing test is having a problem still https://github.com/osquery/osquery/pull/6952/checks?check_run_id=1989915214#step:17:2239 Did too much get appended to this one? osquery/tables/events/tests/windows/data/windows_events/output/Application/1.json |
My mistake, I pushed to the wrong branch. Still cleaning up the test files. |
Local tests are now passing. I had to edit a few of the source test files as they had different hostnames - normalized them all to |
For those who may need to bulk edit these test source files in the future (Will need to tweak for your use case): (Thanks to @mike-myers-tob for getting me started on figuring this out) XML: JSON: |
…0 to master * commit '943935789dbfb03b55db1471ed1595e1fd4ffe23': (119 commits) seccomp migrations Add 4.7.0 CHANGELOG (osquery#6985) ATC fails because journal_mode pragma is blocked by sqlite authorizer (osquery#6999) Always use BIGINT macro for 'long long' data (osquery#6986) chrome_extensions: Refactor the table, add tests (osquery#6780) Remove extraneous lenses directory for augues on macOS (osquery#6998) Update the info about macOS CI (osquery#6988) Make Group ID columns consistent across Windows tables (osquery#6987) Fix mem leak regression with Windows' sids API (osquery#6984) Fix error in process_open_files around stoi vs stoul (osquery#6983) Remove hash and yara table from fuzz harnesses (osquery#6972) Augeas Table: Don't autoload system lenses (osquery#6980) Augeas Table: Fix output bug (osquery#6981) Add concat and concat_ws functions (osquery#6927) Copy JSON objects to avoid MemoryPool buildup (osquery#6957) Fix CODEOWNERS syntax to allow committers and TSC (osquery#6975) augeas: Clear aug pointer on error (osquery#6973) Adds support for the computer field in Windows Eventlogs (osquery#6952) Add Shellbags table (osquery#6949) Implementation of VM metadata table for Yandex.Cloud (osquery#6961) ...
Parses out the
Computer
field for Windows Eventlogs, which is important as it is the hostname of the system on which the event was originally generated.Partially completes #6726