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

splunk: fix mapping of process command line [#918] #971

Merged
merged 2 commits into from
May 31, 2022
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,12 @@
"process": {
"cim_type": "process",
"fields": {
"name": "process",
"name": "process_name",
"command_line": "process",
"pid": "pid",
"creator_user_ref.account_login": "user",
"binary_ref.parent_directory_ref.path": "file_path",
"binary_ref.name": "file_name"
"binary_ref.parent_directory_ref.path": "process_path",
"binary_ref.name": "process_exec"
}
},
"url": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,18 @@ def test_x_oca_event_missing_vals(self):
expected_queries = f'search ((source = "") AND ((signature_id = "") OR (signature = ""))) earliest="-5minutes" | head 10000 | fields {fields}'
_test_query_assertions(result_query, expected_queries)

def test_proc_command_line_query(self):
stix_pattern = "[process:command_line = 'wmic.exe process call create calc']"
query = translation.translate('splunk', 'query', '{}', stix_pattern)
queries = f'search (process = "wmic.exe process call create calc") earliest="-5minutes" | head 10000 | fields {fields}'
_test_query_assertions(query, queries)

def test_proc_name_query(self):
stix_pattern = "[process:name = 'wmic.exe']"
query = translation.translate('splunk', 'query', '{}', stix_pattern)
queries = f'search (process_name = "wmic.exe") earliest="-5minutes" | head 10000 | fields {fields}'
_test_query_assertions(query, queries)

def test_ipv4_query_in_operator(self):
stix_pattern = "[ipv4-addr:value IN ('192.168.122.83', '192.168.122.84')]"
query = translation.translate('splunk', 'query', '{}', stix_pattern)
Expand Down