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 additional cypress tests for Security Analytics Dashboards plugin. #486

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
3f0425d
Added additional cypress tests for the security analytics plugin.
AWSHurneyt Jan 20, 2023
d72d720
Fixed imports and added test fixtures.
AWSHurneyt Jan 20, 2023
77db94d
Refactored test to use Date instead of moment.
AWSHurneyt Jan 20, 2023
a74efe9
Fixed eslint errors.
AWSHurneyt Jan 20, 2023
e158ef7
Fixed eslint errors.
AWSHurneyt Jan 20, 2023
884e5c1
Added additional cypress tests for the security analytics plugin.
AWSHurneyt Jan 20, 2023
bb660aa
Fixed cy.createIndex call.
AWSHurneyt Jan 20, 2023
0876580
Fixed import.
AWSHurneyt Jan 20, 2023
b51b4b1
Fixed eslint errors.
AWSHurneyt Jan 20, 2023
27b05a6
Fixed import.
AWSHurneyt Jan 20, 2023
5591bc1
Fixed call to Cypress.env().
AWSHurneyt Jan 20, 2023
11185c2
Fixed eslint errors.
AWSHurneyt Jan 20, 2023
2b980e1
Fixed call to Cypress.env().
AWSHurneyt Jan 21, 2023
cc4c6b4
Fixed eslint errors.
AWSHurneyt Jan 21, 2023
98f89ec
Fixed call to Cypress.env().
AWSHurneyt Jan 21, 2023
70efaeb
Fixed eslint errors.
AWSHurneyt Jan 21, 2023
e5c947d
Fixed call to Cypress.env().
AWSHurneyt Jan 21, 2023
6d9e79d
Fixed call to Cypress.env().
AWSHurneyt Jan 21, 2023
4ace5d7
Fixed expected URL.
AWSHurneyt Jan 30, 2023
e5345e7
Fixed waitForPageLoad helper method.
AWSHurneyt Jan 31, 2023
ae6a78c
Replaced call to realPress.
AWSHurneyt Jan 31, 2023
578df55
Fixed failing tests.
AWSHurneyt Feb 8, 2023
957abb2
Replaced existing test file.
AWSHurneyt Feb 8, 2023
eecca0c
Fixed es lint errors.
AWSHurneyt Feb 8, 2023
7ee4c28
Adjusted security-analytics-release-e2e-workflow to run cypress tests…
AWSHurneyt Feb 8, 2023
e6d55d1
Refactored security analytics cypress tests to no longer use the cust…
AWSHurneyt Feb 8, 2023
6fd92ae
Removed unused import.
AWSHurneyt Feb 8, 2023
618d2e5
Refactored failing tests.
AWSHurneyt Feb 8, 2023
5c9bf2d
Refactored failing tests.
AWSHurneyt Feb 8, 2023
e096a8d
Refactored failing tests.
AWSHurneyt Feb 8, 2023
2fd21d2
Fixed failing ISM cypress test.
AWSHurneyt Feb 9, 2023
c9ad6eb
Fixed failing ISM cypress test.
AWSHurneyt Feb 9, 2023
d4f224b
Fixed failing ISM cypress test.
AWSHurneyt Feb 9, 2023
4b498e9
Fixed failing ISM cypress test.
AWSHurneyt Feb 9, 2023
b4163cb
Fixed failing ISM cypress test.
AWSHurneyt Feb 10, 2023
c42876c
Removed dev code.
AWSHurneyt Feb 10, 2023
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
@@ -1,10 +1,7 @@
name: Security Analytics Release tests workflow in Bundled OpenSearch Dashboards
on:
pull_request:
branches:
- main
- dev-*
- 2.x
branches: [ '**' ]
jobs:
changes:
runs-on: ubuntu-latest
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"type": "detector",
"detector_type": "dns",
"name": "Cypress DNS Detector",
"enabled": true,
"createdBy": "",
"schedule": {
"period": {
"interval": 1,
"unit": "MINUTES"
}
},
"inputs": [
{
"detector_input": {
"description": "Detects DNS names.",
"indices": ["cypress-index-dns"],
"pre_packaged_rules": [],
"custom_rules": [
{
"id": "25b9c01c-350d-4b95-bed1-836d04a4f325"
}
]
}
}
],
"triggers": [
{
"name": "DNS name alert",
"sev_levels": ["low"],
"tags": ["dns.low"],
"actions": [
{
"id": "",
"name": "Triggered alert condition: - Severity: 1 (Highest) - Threat detector: Cypress DNS Detector",
"destination_id": "",
"subject_template": {
"source": "Triggered alert condition: - Severity: 1 (Highest) - Threat detector: Cypress DNS Detector",
"lang": "mustache"
},
"message_template": {
"source": "Triggered alert condition: \nSeverity: 1 (Highest)\nThreat detector: Cypress DNS Detector\nDescription: Detects DNS names.\nDetector data sources:\n\tdns",
"lang": "mustache"
},
"throttle_enabled": false,
"throttle": {
"value": 10,
"unit": "MINUTES"
}
}
],
"types": ["dns"],
"severity": "1",
"ids": ["R1ng94QBbw8UQ2Cvqe6h"]
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"properties": {
"dns-answers-type": {
"type": "alias",
"path": "DnsAnswerType"
},
"dns-question-name": {
"type": "alias",
"path": "DnsQuestionName"
},
"dns-question-registered_domain": {
"type": "alias",
"path": "DnsQuestionRegisteredDomain"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"type": "detector",
"detector_type": "windows",
"name": "Cypress USB Detector",
"enabled": true,
"createdBy": "",
"schedule": {
"period": {
"interval": 1,
"unit": "MINUTES"
}
},
"inputs": [
{
"detector_input": {
"description": "Detect USB plugged in.",
"indices": ["cypress-index-windows"],
"pre_packaged_rules": [],
"custom_rules": [
{
"id": "25b9c01c-350d-4b95-bed1-836d04a4f324"
}
]
}
}
],
"triggers": [
{
"name": "USB plugged in alert",
"sev_levels": ["low"],
"tags": ["windows.usb"],
"actions": [
{
"id": "",
"name": "Triggered alert condition: - Severity: 1 (Highest) - Threat detector: USB Detector",
"destination_id": "",
"subject_template": {
"source": "Triggered alert condition: - Severity: 1 (Highest) - Threat detector: USB Detector",
"lang": "mustache"
},
"message_template": {
"source": "Triggered alert condition: \nSeverity: 1 (Highest)\nThreat detector: USB Detector\nDescription: Detect USB plugged in.\nDetector data sources:\n\twindows",
"lang": "mustache"
},
"throttle_enabled": false,
"throttle": {
"value": 10,
"unit": "MINUTES"
}
}
],
"types": ["windows"],
"severity": "1",
"ids": ["25b9c01c-350d-4b95-bed1-836d04a4f123"]
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"properties": {
"event_uid": {
"type": "alias",
"path": "EventID"
},
"windows-event_data-CommandLine": {
"type": "alias",
"path": "CommandLine"
},
"windows-hostname": {
"type": "alias",
"path": "HostName"
},
"windows-message": {
"type": "alias",
"path": "Message"
},
"windows-provider-name": {
"type": "alias",
"path": "Provider_Name"
},
"windows-servicename": {
"type": "alias",
"path": "ServiceName"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"DnsAnswerType": "QWE",
"DnsQuestionRegisteredDomain": "EC2AMAZ-EPWO7HKA",
"DnsQuestionName": "QWE"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"EventTime": "2020-02-04T14:59:39.343541+00:00",
"HostName": "EC2AMAZ-EPO7HKA",
"Keywords": "9223372036854775808",
"SeverityValue": 2,
"Severity": "ERROR",
"EventID": 2003,
"SourceName": "Microsoft-Windows-Sysmon",
"ProviderGuid": "{5770385F-C22A-43E0-BF4C-06F5698FFBD9}",
"Version": 5,
"TaskValue": 22,
"OpcodeValue": 0,
"RecordNumber": 9532,
"ExecutionProcessID": 1996,
"ExecutionThreadID": 2616,
"Channel": "Microsoft-Windows-Sysmon/Operational",
"Domain": "NT AUTHORITY",
"AccountName": "SYSTEM",
"UserID": "S-1-5-18",
"AccountType": "User",
"Message": "Dns query:\r\nRuleName: \r\nUtcTime: 2020-02-04 14:59:38.349\r\nProcessGuid: {b3c285a4-3cda-5dc0-0000-001077270b00}\r\nProcessId: 1904\r\nQueryName: EC2AMAZ-EPO7HKA\r\nQueryStatus: 0\r\nQueryResults: 172.31.46.38;\r\nImage: C:\\Program Files\\nxlog\\nxlog.exe",
"Category": "Dns query (rule: DnsQuery)",
"Opcode": "Info",
"UtcTime": "2020-02-04 14:59:38.349",
"ProcessGuid": "{b3c285a4-3cda-5dc0-0000-001077270b00}",
"ProcessId": "1904",
"QueryName": "EC2AMAZ-EPO7HKA",
"QueryStatus": "0",
"QueryResults": "172.31.46.38;",
"Image": "C:\\Program Files\\nxlog\\regsvr32.exe",
"EventReceivedTime": "2020-02-04T14:59:40.780905+00:00",
"SourceModuleName": "in",
"SourceModuleType": "im_msvistalog",
"CommandLine": "eachtest",
"Initiated": "true",
"Provider_Name": "Service_ws_Control_ws_Manager",
"TargetObject": "\\SOFTWARE\\Microsoft\\Office\\Outlook\\Security",
"EventType": "SetValue"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"mappings": {
"properties": {
"DnsAnswerType": {
"type": "text"
},
"DnsQuestionRegisteredDomain": {
"type": "text"
},
"DnsQuestionName": {
"type": "text"
}
}
},
"settings": {
"index": {
"number_of_shards": "1",
"number_of_replicas": "1"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"mappings": {
"properties": {
"CommandLine": {
"type": "text"
},
"EventID": {
"type": "integer"
},
"HostName": {
"type": "text"
},
"Message": {
"type": "text"
},
"Provider_Name": {
"type": "text"
},
"ServiceName": {
"type": "text"
}
}
},
"settings": {
"index": {
"number_of_shards": "1",
"number_of_replicas": "1"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"id": "25b9c01c-350d-4b95-bed1-836d04a4f325",
"category": "dns",
"title": "Cypress DNS Rule",
"description": "Detects DNS name as QWE",
"status": "experimental",
"author": "Cypress Tests",
"references": [
{
"value": ""
}
],
"tags": [
{
"value": "dns.low"
}
],
"log_source": "",
"detection": "selection:\n DnsQuestionName:\n - QWE\n - ASD\n - YXC\ncondition: selection",
"level": "low",
"false_positives": [
{
"value": ""
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"id": "25b9c01c-350d-4b95-bed1-836d04a4f123",
"category": "windows",
"title": "Cypress USB Rule",
"description": "USB plugged-in rule",
"status": "experimental",
"author": "Cypress Tests",
"references": [
{
"value": ""
}
],
"tags": [
{
"value": "windows.usb"
}
],
"log_source": "",
"detection": "selection:\n EventID:\n - 2003\n - 2100\n - 2102\ncondition: selection",
"level": "low",
"false_positives": [
{
"value": ""
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"properties": {
"source_ip": {
"type": "alias",
"path": "src_ip"
},
"windows-event_data-CommandLine": {
"path": "CommandLine",
"type": "alias"
},
"event_uid": {
"path": "EventID",
"type": "alias"
}
}
}
Loading