-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* adds 'Creates and activates new rule' * loads data using es_archive * refactor test
- Loading branch information
1 parent
0283819
commit 0f29eee
Showing
18 changed files
with
482 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
interface Mitre { | ||
tactic: string; | ||
techniques: string[]; | ||
} | ||
|
||
export interface Rule { | ||
customQuery: string; | ||
name: string; | ||
description: string; | ||
severity: string; | ||
riskScore: string; | ||
tags: string[]; | ||
timelineTemplate?: string; | ||
referenceUrls: string[]; | ||
falsePositivesExamples: string[]; | ||
mitre: Mitre[]; | ||
} | ||
|
||
const mitre1: Mitre = { | ||
tactic: 'Discovery (TA0007)', | ||
techniques: ['Cloud Service Discovery (T1526)', 'File and Directory Discovery (T1083)'], | ||
}; | ||
|
||
const mitre2: Mitre = { | ||
tactic: 'Execution (TA0002)', | ||
techniques: ['CMSTP (T1191)'], | ||
}; | ||
|
||
export const newRule: Rule = { | ||
customQuery: 'hosts.name: *', | ||
name: 'New Rule Test', | ||
description: 'The new rule description.', | ||
severity: 'High', | ||
riskScore: '17', | ||
tags: ['test', 'newRule'], | ||
referenceUrls: ['https://www.google.com/', 'https://elastic.co/'], | ||
falsePositivesExamples: ['False1', 'False2'], | ||
mitre: [mitre1, mitre2], | ||
}; |
49 changes: 49 additions & 0 deletions
49
x-pack/legacy/plugins/siem/cypress/screens/create_new_rule.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
export const ABOUT_CONTINUE_BTN = '[data-test-subj="about-continue"]'; | ||
|
||
export const ADD_FALSE_POSITIVE_BTN = | ||
'[data-test-subj="detectionEngineStepAboutRuleFalsePositives"] .euiButtonEmpty__text'; | ||
|
||
export const ADD_REFERENCE_URL_BTN = | ||
'[data-test-subj="detectionEngineStepAboutRuleReferenceUrls"] .euiButtonEmpty__text'; | ||
|
||
export const MITRE_BTN = '[data-test-subj="addMitre"]'; | ||
|
||
export const ADVANCED_SETTINGS_BTN = '[data-test-subj="advancedSettings"] .euiAccordion__button'; | ||
|
||
export const CREATE_AND_ACTIVATE_BTN = '[data-test-subj="create-activate"]'; | ||
|
||
export const CUSTOM_QUERY_INPUT = '[data-test-subj="queryInput"]'; | ||
|
||
export const DEFINE_CONTINUE_BUTTON = '[data-test-subj="continue"]'; | ||
|
||
export const FALSE_POSITIVES_INPUT = | ||
'[data-test-subj="detectionEngineStepAboutRuleFalsePositives"] input'; | ||
|
||
export const MITRE_TACTIC = '.euiContextMenuItem__text'; | ||
|
||
export const MITRE_TACTIC_DROPDOWN = '[data-test-subj="mitreTactic"]'; | ||
|
||
export const MITRE_TECHNIQUES_INPUT = | ||
'[data-test-subj="mitreTechniques"] [data-test-subj="comboBoxSearchInput"]'; | ||
|
||
export const REFERENCE_URLS_INPUT = | ||
'[data-test-subj="detectionEngineStepAboutRuleReferenceUrls"] input'; | ||
|
||
export const RISK_INPUT = '.euiRangeInput'; | ||
|
||
export const RULE_DESCRIPTION_INPUT = | ||
'[data-test-subj="detectionEngineStepAboutRuleDescription"] [data-test-subj="input"]'; | ||
|
||
export const RULE_NAME_INPUT = | ||
'[data-test-subj="detectionEngineStepAboutRuleName"] [data-test-subj="input"]'; | ||
|
||
export const SEVERITY_DROPDOWN = '[data-test-subj="select"]'; | ||
|
||
export const TAGS_INPUT = | ||
'[data-test-subj="detectionEngineStepAboutRuleTags"] [data-test-subj="comboBoxSearchInput"]'; |
39 changes: 39 additions & 0 deletions
39
x-pack/legacy/plugins/siem/cypress/screens/rule_details.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
export const ABOUT_DESCRIPTION = '[data-test-subj="aboutRule"] .euiDescriptionList__description'; | ||
|
||
export const ABOUT_EXPECTED_URLS = 4; | ||
|
||
export const ABOUT_FALSE_POSITIVES = 5; | ||
|
||
export const ABOUT_MITRE = 6; | ||
|
||
export const ABOUT_RULE_DESCRIPTION = 0; | ||
|
||
export const ABOUT_RISK = 2; | ||
|
||
export const ABOUT_SEVERITY = 1; | ||
|
||
export const ABOUT_TAGS = 7; | ||
|
||
export const ABOUT_TIMELINE = 3; | ||
|
||
export const DEFINITION_CUSTOM_QUERY = 1; | ||
|
||
export const DEFINITION_DESCRIPTION = | ||
'[data-test-subj="definition"] .euiDescriptionList__description'; | ||
|
||
export const DEFINITION_INDEX_PATTERNS = | ||
'[data-test-subj="definition"] .euiDescriptionList__description .euiBadge__text'; | ||
|
||
export const RULE_NAME_HEADER = '[data-test-subj="header-page-title"]'; | ||
|
||
export const SCHEDULE_DESCRIPTION = '[data-test-subj="schedule"] .euiDescriptionList__description'; | ||
|
||
export const SCHEDULE_RUNS = 0; | ||
|
||
export const SCHEDULE_LOOPBACK = 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.