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

Added test data for Process Explorer - Downloads panel and updated selenium test for the panel #395

Merged
merged 1 commit into from
Jul 30, 2024
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
@@ -0,0 +1,42 @@
{
"winlog": {
"computer_name": "C2.lme.local",
"keywords": [
"Test Data Insertion for Process Explorer"
],
"user": {
"name": "APItestuserid",
"domain": ""
},
"event_data": {
"LogonType": "2",
"SubjectUserName": "-",
"FailureReason": "%%2313",
"SubjectDomainName": "-",
"IpAddress": "194.169.175.22",
"TargetUserName": "solidart",
"LogonProcessName": "NtLmSsp ",
"SubjectUserSid": "S-1-0-0",
"TargetUserSid": "S-1-0-0",
"AuthenticationPackageName": "NTLM",
"TargetFilename": "C:\\Users\\admin.ackbar\\Downloads\\test.txt"
},
"@timestamp": "2024-07-28T09:50:18.252Z",
"host": {
"name": "C2.lme.local"
}
},
"event": {
"code": "11",
"provider": "Microsoft-Windows-Sysmon",
"action": "Download",
"outcome": "test"
},
"user": {
"name": "APItestuserid",
"domain": "test"
},
"host": {
"name": "C2.lme.local"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"aggs": {
"2": {
"terms": {
"field": "winlog.event_data.TargetFilename",
"order": {
"_count": "desc"
},
"size": 100
}
}
},
"size": 100,
"script_fields": {},
"stored_fields": [
"*"
],
"_source": {
"excludes": []
},
"query": {
"bool": {
"must": [
{
"query_string": {
"query": "winlog.event_data.TargetFilename:*\\\\Users\\\\*\\\\Downloads\\\\*",
"analyze_wildcard": true,
"time_zone": "America/New_York"
}
}
],
"filter": [
{
"match_phrase": {
"event.code": "11"
}
},
{
"match_phrase": {
"event.provider": "Microsoft-Windows-Sysmon"
}
},
{
"range": {
"@timestamp": {
"format": "strict_date_optional_time",
"gte": "2009-07-25T19:37:25.876Z",
"lte": "2024-07-25T19:37:25.876Z"
}
}
}
],
"should": [],
"must_not": []
}
}
}
8 changes: 8 additions & 0 deletions testing/tests/api_tests/data_insertion_tests/test_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,14 @@ def test_user_logon_events_insert(es_host, es_port, username, password):

# Check to make sure the data was inserted
assert(second_response_loaded['aggregations']['2']['buckets'][0]['key'] == 'APItestuserid')


def test_file_downloads_insert(es_host, es_port, username, password):

second_response_loaded=insert_winlog_data(es_host, es_port, username, password, 'filter_fileCreatedDownloads.json', 'fileCreatedDownloads.json', 2)

# Check to make sure the data was inserted
assert(second_response_loaded['aggregations']['2']['buckets'][0]['key'] == 'C:\\Users\\admin.ackbar\\Downloads\\test.txt')



Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ def test_files_created_over_time_in_downloads(self, setup_login, kibana_url, tim
driver = setup_login
dashboard_test_function(driver, kibana_url, timeout, self.dashboard_id, "Files created (in Downloads)", ".needarealvaluehere",".euiFlexGroup")

@pytest.mark.skip(reason="Skipping this test")
#@pytest.mark.skip(reason="Skipping this test")
def test_files_created_in_downloads(self, setup_login, kibana_url, timeout):
#This dashboard panel is not working corectly. Shows no data even when there is data. Create issue LME#294
#This dashboard panel is not working corectly. Shows no data even when there is data on DC instance downloads folder. Create issue LME#294
driver = setup_login
dashboard_test_function(driver, kibana_url, timeout, self.dashboard_id, "Files created (in Downloads)", ".euiFlexGroup", ".euiDataGrid__noResults",)
dashboard_test_function(driver, kibana_url, timeout, self.dashboard_id, "Files created (in Downloads)", ".euiDataGrid", ".euiDataGrid__noResults",)

def test_hosts(self, setup_login, kibana_url, timeout):
driver = setup_login
Expand Down
Loading