mirror of
https://github.com/splunk/security_content
synced 2026-06-08 17:32:49 +00:00
Improved regex to handle paths
- changed regex for paths - updated unit test & data
This commit is contained in:
@@ -14,7 +14,7 @@ search: '| from read_ssa_enriched_events()
|
||||
dest_device_id=ucast(map_get(input_event, "dest_device_id"), "string", null),
|
||||
process_name=ucast(map_get(input_event, "process_name"), "string", null),
|
||||
cmd_line=lower(ucast(map_get(input_event, "process"), "string", null)),
|
||||
cmd_line_norm=replace(cmd_line, /\w:\\[^\s]+/, "PATH"),
|
||||
cmd_line_norm=replace(cmd_line, /\w:\\[^:]*(?=\\.*\.\w{3}(\s|$)+)/, "\\PATH"),
|
||||
cmd_line_norm=replace(cmd_line_norm, /\d+/, "N")
|
||||
| where process_name="cmd.exe" AND
|
||||
match_regex(ucast(cmd_line, "string", ""), /.* \/[cC] .*/)=true
|
||||
|
||||
@@ -2,7 +2,7 @@ name: First time seen command line argument - SSA Unit Test
|
||||
tests:
|
||||
- name: First time seen command line argument
|
||||
file: endpoint/ssa___first_time_seen_cmd_line.yml
|
||||
pass_condition: '@count_eq(3)'
|
||||
pass_condition: '@count_eq(4)'
|
||||
description: Test detection of first time seen command
|
||||
attack_data:
|
||||
- file_name: first_time_seen_commandline.json
|
||||
|
||||
Reference in New Issue
Block a user