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

Parsing XML data in schedule tasks (a scheduled task was created) #39905

Open
willemri opened this issue Jun 14, 2024 · 1 comment
Open

Parsing XML data in schedule tasks (a scheduled task was created) #39905

willemri opened this issue Jun 14, 2024 · 1 comment
Labels
needs_team Indicates that the issue/PR needs a Team:* label

Comments

@willemri
Copy link

Describe the enhancement:
https://www.elastic.co/guide/en/security/current/ .html

winlog.event_data.TaskContent XML data is not parsed in elasticsearch:

DOMAIN\user Deze taak zorgt ervoor dat presentatie-instellingen worden uitgeschakeld als u zich opnieuw bij de computer aanmeldt. \PresentationSettingsTurnOff_DOMAIN_USER true DOMAIN\USER PT5S IgnoreNew false false true false false PT10M PT1H true false true true true false false PT72H 7 %windir%\system32\PresentationSettings.exe /stop DOMAIN\USER InteractiveToken LeastPrivilege

This change would start with elastic agent and/or winlogbeat, was thinking about a javascript processor that would run on the client:
function process(event) {
var xml = new XML(event.GetEvent());
var task = xml.Task;

event.Put("task_version", task.@version);
event.Put("author", task.RegistrationInfo.Author);
event.Put("description", task.RegistrationInfo.Description);
event.Put("uri", task.RegistrationInfo.URI);
event.Put("logon_trigger_enabled", task.Triggers.LogonTrigger.Enabled);
event.Put("user_id", task.Triggers.LogonTrigger.UserId);
event.Put("delay", task.Triggers.LogonTrigger.Delay);
event.Put("multiple_instances_policy", task.Settings.MultipleInstancesPolicy);
event.Put("disallow_start_if_on_batteries", task.Settings.DisallowStartIfOnBatteries);
event.Put("stop_if_going_on_batteries", task.Settings.StopIfGoingOnBatteries);
event.Put("allow_hard_terminate", task.Settings.AllowHardTerminate);
event.Put("start_when_available", task.Settings.StartWhenAvailable);
event.Put("run_only_if_network_available", task.Settings.RunOnlyIfNetworkAvailable);
event.Put("idle_duration", task.Settings.IdleSettings.Duration);
event.Put("idle_wait_timeout", task.Settings.IdleSettings.WaitTimeout);
event.Put("idle_stop_on_idle_end", task.Settings.IdleSettings.StopOnIdleEnd);
event.Put("idle_restart_on_idle", task.Settings.IdleSettings.RestartOnIdle);
event.Put("allow_start_on_demand", task.Settings.AllowStartOnDemand);
event.Put("enabled", task.Settings.Enabled);
event.Put("hidden", task.Settings.Hidden);
event.Put("run_only_if_idle", task.Settings.RunOnlyIfIdle);
event.Put("wake_to_run", task.Settings.WakeToRun);
event.Put("execution_time_limit", task.Settings.ExecutionTimeLimit);
event.Put("priority", task.Settings.Priority);
event.Put("command", task.Actions.Exec.Command);
event.Put("arguments", task.Actions.Exec.Arguments);
event.Put("principal_user_id", task.Principals.Principal.UserId);
event.Put("principal_logon_type", task.Principals.Principal.LogonType);
event.Put("principal_run_level", task.Principals.Principal.RunLevel);

return event;

}

however, this would also imply changes into the winlogbeat mappings.

Describe a specific use case for the enhancement or feature:
With the xml parsed we could create better exceptions in elasticsearch. Currently only the taskname is possible. While taskname is useful, i'm more interested in what commands the schedule task runs.

@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Jun 14, 2024
@botelastic
Copy link

botelastic bot commented Jun 14, 2024

This issue doesn't have a Team:<team> label.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs_team Indicates that the issue/PR needs a Team:* label
Projects
None yet
Development

No branches or pull requests

1 participant