[Security Solution] Updates loock-back time on Cypress tests (#110609)

* updates loock-back time

* updates loock-back value for 'expectedExportedRule'
This commit is contained in:
Gloria Hornero 2021-08-31 20:07:06 +02:00 committed by GitHub
parent a3fd138da1
commit f8c80a7422
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View file

@ -164,7 +164,7 @@ const getRunsEvery = (): Interval => ({
});
const getLookBack = (): Interval => ({
interval: '17520',
interval: '50000',
timeType: 'Hours',
type: 'h',
});
@ -382,5 +382,5 @@ export const getEditedRule = (): CustomRule => ({
export const expectedExportedRule = (ruleResponse: Cypress.Response): string => {
const jsonrule = ruleResponse.body;
return `{"id":"${jsonrule.id}","updated_at":"${jsonrule.updated_at}","updated_by":"elastic","created_at":"${jsonrule.created_at}","created_by":"elastic","name":"${jsonrule.name}","tags":[],"interval":"100m","enabled":false,"description":"${jsonrule.description}","risk_score":${jsonrule.risk_score},"severity":"${jsonrule.severity}","output_index":".siem-signals-default","author":[],"false_positives":[],"from":"now-17520h","rule_id":"rule_testing","max_signals":100,"risk_score_mapping":[],"severity_mapping":[],"threat":[],"to":"now","references":[],"version":1,"exceptions_list":[],"immutable":false,"type":"query","language":"kuery","index":["exceptions-*"],"query":"${jsonrule.query}","throttle":"no_actions","actions":[]}\n{"exported_count":1,"missing_rules":[],"missing_rules_count":0}\n`;
return `{"id":"${jsonrule.id}","updated_at":"${jsonrule.updated_at}","updated_by":"elastic","created_at":"${jsonrule.created_at}","created_by":"elastic","name":"${jsonrule.name}","tags":[],"interval":"100m","enabled":false,"description":"${jsonrule.description}","risk_score":${jsonrule.risk_score},"severity":"${jsonrule.severity}","output_index":".siem-signals-default","author":[],"false_positives":[],"from":"now-50000h","rule_id":"rule_testing","max_signals":100,"risk_score_mapping":[],"severity_mapping":[],"threat":[],"to":"now","references":[],"version":1,"exceptions_list":[],"immutable":false,"type":"query","language":"kuery","index":["exceptions-*"],"query":"${jsonrule.query}","throttle":"no_actions","actions":[]}\n{"exported_count":1,"missing_rules":[],"missing_rules_count":0}\n`;
};

View file

@ -19,7 +19,7 @@ export const createCustomRule = (rule: CustomRule, ruleId = 'rule_testing', inte
name: rule.name,
severity: rule.severity.toLocaleLowerCase(),
type: 'query',
from: 'now-17520h',
from: 'now-50000h',
index: ['exceptions-*'],
query: rule.customQuery,
language: 'kuery',
@ -59,7 +59,7 @@ export const createCustomIndicatorRule = (rule: ThreatIndicatorRule, ruleId = 'r
threat_filters: [],
threat_index: rule.indicatorIndexPattern,
threat_indicator_path: '',
from: 'now-17520h',
from: 'now-50000h',
index: rule.index,
query: rule.customQuery || '*:*',
language: 'kuery',
@ -86,7 +86,7 @@ export const createCustomRuleActivated = (
name: rule.name,
severity: rule.severity.toLocaleLowerCase(),
type: 'query',
from: 'now-17520h',
from: 'now-50000h',
index: rule.index,
query: rule.customQuery,
language: 'kuery',