Skip to content
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

Add process.command_line to Sysmon module #17327

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions x-pack/winlogbeat/module/sysmon/config/winlogbeat-sysmon.js
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ var sysmon = (function () {
return;
}
evt.Put(field, winlogbeat.splitCommandLine(commandLine));
evt.Put("process.command_line", commandLine);
Copy link
Member

Choose a reason for hiding this comment

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

Check out where this function is called. It's used in two different contexts so hard-coding the target field won't work. I suggest changing the field parameter to be the target namespace. Like this, then update the callers.

var splitCommandLine = function(evt, namespace) {
        var commandLine = evt.Get(field);
        if (!commandLine) {
            return;
        }
        evt.Put(namespace+".args", winlogbeat.splitCommandLine(commandLine));
        evt.Put(namespace+".command_line", commandLine);
}

};

var splitProcessArgs = function(evt) {
Expand Down Expand Up @@ -468,6 +469,7 @@ var sysmon = (function () {
{from: "winlog.event_data.ProcessGuid", to: "process.entity_id"},
{from: "winlog.event_data.ProcessId", to: "process.pid", type: "long"},
{from: "winlog.event_data.Image", to: "process.executable"},
{from: "winlog.event_data.CommandLine", to: "process.command_line"},
{from: "winlog.event_data.CommandLine", to: "process.args"},
{from: "winlog.event_data.CurrentDirectory", to: "process.working_directory"},
{from: "winlog.event_data.ParentProcessGuid", to: "process.parent.entity_id"},
Expand Down