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

[security_solution_cypress] Add support for options in EsArchiver.load #164988

Merged
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 @@ -33,7 +33,7 @@ describe('Alert tagging', { tags: ['@ess', '@serverless'] }, () => {
beforeEach(() => {
login();
deleteAlertsAndRules();
cy.task('esArchiverLoad', 'endpoint');
cy.task('esArchiverLoad', { archiveName: 'endpoint' });
createRule(getNewRule({ rule_id: 'new custom rule' }));
visit(ALERTS_URL);
waitForAlertsToPopulate();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ import { addsFieldsToTimeline } from '../../tasks/rule_details';
describe('CTI Enrichment', { tags: ['@ess', '@serverless'] }, () => {
before(() => {
cleanKibana();
cy.task('esArchiverLoad', 'threat_indicator');
cy.task('esArchiverLoad', 'suspicious_source_event');
cy.task('esArchiverLoad', { archiveName: 'threat_indicator' });
cy.task('esArchiverLoad', { archiveName: 'suspicious_source_event' });
login();
createRule({ ...getNewThreatIndicatorRule(), rule_id: 'rule_testing', enabled: true });
disableExpandableFlyout();
Expand Down Expand Up @@ -155,7 +155,7 @@ describe('CTI Enrichment', { tags: ['@ess', '@serverless'] }, () => {

describe('with additional indicators', () => {
before(() => {
cy.task('esArchiverLoad', 'threat_indicator2');
cy.task('esArchiverLoad', { archiveName: 'threat_indicator2' });
});

beforeEach(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import { ALERTS_URL } from '../../urls/navigation';
describe('Enrichment', { tags: ['@ess', '@serverless'] }, () => {
before(() => {
cleanKibana();
cy.task('esArchiverLoad', 'risk_users');
cy.task('esArchiverLoad', { archiveName: 'risk_users' });
});

after(() => {
Expand All @@ -43,7 +43,7 @@ describe('Enrichment', { tags: ['@ess', '@serverless'] }, () => {
describe('Custom query rule', () => {
beforeEach(() => {
disableExpandableFlyout();
cy.task('esArchiverLoad', 'risk_hosts');
cy.task('esArchiverLoad', { archiveName: 'risk_hosts' });
deleteAlertsAndRules();
createRule(getNewRule({ rule_id: 'rule1' }));
login();
Expand Down Expand Up @@ -75,7 +75,7 @@ describe('Enrichment', { tags: ['@ess', '@serverless'] }, () => {

closeAlertFlyout();
cy.task('esArchiverUnload', 'risk_hosts');
cy.task('esArchiverLoad', 'risk_hosts_updated');
cy.task('esArchiverLoad', { archiveName: 'risk_hosts_updated' });
expandFirstAlert();
cy.get(ENRICHED_DATA_ROW).contains('Critical');
cy.get(ENRICHED_DATA_ROW).contains('Original host risk classification');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ import { createTimeline } from '../../tasks/timelines';

describe('Ransomware Detection Alerts', { tags: ['@ess', '@serverless'] }, () => {
before(() => {
cy.task('esArchiverLoad', 'ransomware_detection');
cy.task('esArchiverLoad', {
archiveName: 'ransomware_detection',
});
});

describe('Ransomware display in Alerts Section', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,14 @@ import { ALERTS_HISTOGRAM_SERIES, ALERT_RULE_NAME, MESSAGE } from '../../screens
import { TIMELINE_QUERY, TIMELINE_VIEW_IN_ANALYZER } from '../../screens/timeline';
import { selectAlertsHistogram } from '../../tasks/alerts';
import { createTimeline } from '../../tasks/timelines';
import { cleanKibana } from '../../tasks/common';

describe('Ransomware Prevention Alerts', { tags: ['@ess', '@serverless'] }, () => {
before(() => {
cy.task('esArchiverLoad', 'ransomware_prevention');
cleanKibana();
cy.task('esArchiverLoad', {
archiveName: 'ransomware_prevention',
});
});

after(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ describe('EQL rules', { tags: ['@ess', '@brokenInServerless'] }, () => {
const rule = getEqlSequenceRule();

beforeEach(() => {
cy.task('esArchiverLoad', 'auditbeat_big');
cy.task('esArchiverLoad', { archiveName: 'auditbeat_big' });
});
afterEach(() => {
cy.task('esArchiverUnload', 'auditbeat_big');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ describe('indicator match', { tags: ['@ess', '@brokenInServerless'] }, () => {

before(() => {
cleanKibana();
cy.task('esArchiverLoad', 'threat_indicator');
cy.task('esArchiverLoad', 'suspicious_source_event');
cy.task('esArchiverLoad', { archiveName: 'threat_indicator' });
cy.task('esArchiverLoad', { archiveName: 'suspicious_source_event' });
});

beforeEach(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ describe(
() => {
before(() => {
cleanKibana();
cy.task('esArchiverLoad', 'all_users');
cy.task('esArchiverLoad', { archiveName: 'all_users' });
});

beforeEach(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ describe.skip(
cy.task('esArchiverResetKibana');
login();
deleteAlertsAndRules();
cy.task('esArchiverLoad', 'endpoint');
cy.task('esArchiverLoad', { archiveName: 'endpoint' });
createRule(getEndpointRule());
visitWithoutDateRange(DETECTIONS_RULE_MANAGEMENT_URL);
goToRuleDetails();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ describe.skip(
beforeEach(() => {
cy.task('esArchiverUnload', 'endpoint');
cy.task('esArchiverResetKibana');
cy.task('esArchiverLoad', 'endpoint');
cy.task('esArchiverLoad', { archiveName: 'endpoint' });
login();
createRule(getEndpointRule());
visitWithoutDateRange(DETECTIONS_RULE_MANAGEMENT_URL);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ describe('Close matching Alerts ', () => {
cy.task('esArchiverUnload', 'exceptions');
cy.task('esArchiverResetKibana');
deleteAlertsAndRules();
cy.task('esArchiverLoad', 'exceptions');
cy.task('esArchiverLoad', { archiveName: 'exceptions' });

login();
postDataView('exceptions-*');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ describe.skip('Exceptions flyout', { tags: ['@ess', '@serverless'] }, () => {
// this is a made-up index that has just the necessary
// mappings to conduct tests, avoiding loading large
// amounts of data like in auditbeat_exceptions
cy.task('esArchiverLoad', 'exceptions');
cy.task('esArchiverLoad', { archiveName: 'exceptions' });
// Comment the Conflicts here as they are skipped
// cy.task('esArchiverLoad', 'conflicts_1');
// cy.task('esArchiverLoad', 'conflicts_2');
// cy.task('esArchiverLoad',{ archiveName: 'conflicts_1' });
// cy.task('esArchiverLoad',{ archiveName: 'conflicts_2' });
login();
createExceptionList(getExceptionList(), getExceptionList().list_id).then((response) =>
createRule(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ describe('Use Value list in exception entry', { tags: ['@ess', '@serverless'] },
before(() => {
cleanKibana();
login();
cy.task('esArchiverLoad', 'exceptions');
cy.task('esArchiverLoad', { archiveName: 'exceptions' });
createRule({
...getNewRule(),
query: 'user.name:*',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ describe('Add endpoint exception from rule details', { tags: ['@ess', '@serverle

before(() => {
cy.task('esArchiverResetKibana');
cy.task('esArchiverLoad', 'auditbeat');
cy.task('esArchiverLoad', { archiveName: 'auditbeat' });
login();
deleteAlertsAndRules();
// create rule with exception
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ describe('Add/edit exception from rule details', { tags: ['@ess', '@brokenInServ

before(() => {
cy.task('esArchiverResetKibana');
cy.task('esArchiverLoad', 'exceptions');
cy.task('esArchiverLoad', { archiveName: 'exceptions' });
login();
});

Expand Down Expand Up @@ -319,7 +319,7 @@ describe('Add/edit exception from rule details', { tags: ['@ess', '@brokenInServ
cy.get(NO_EXCEPTIONS_EXIST_PROMPT).should('exist');

// load more docs
cy.task('esArchiverLoad', 'exceptions_2');
cy.task('esArchiverLoad', { archiveName: 'exceptions_2' });

// now that there are no more exceptions, the docs should match and populate alerts
goToAlertsTab();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ describe(

before(() => {
cy.task('esArchiverResetKibana');
cy.task('esArchiverLoad', 'exceptions');
cy.task('esArchiverLoad', { archiveName: 'exceptions' });
login();
postDataView('exceptions-*');
});
Expand Down Expand Up @@ -117,7 +117,7 @@ describe(
cy.get(NO_EXCEPTIONS_EXIST_PROMPT).should('exist');

// load more docs
cy.task('esArchiverLoad', 'exceptions_2');
cy.task('esArchiverLoad', { archiveName: 'exceptions_2' });

// now that there are no more exceptions, the docs should match and populate alerts
goToAlertsTab();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import {
describe('Add, edit and delete exception', { tags: ['@ess', '@serverless'] }, () => {
before(() => {
cy.task('esArchiverResetKibana');
cy.task('esArchiverLoad', 'exceptions');
cy.task('esArchiverLoad', { archiveName: 'exceptions' });

createRule(getNewRule());
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ describe('Entity Analytics Dashboard', { tags: ['@ess', '@brokenInServerless'] }

describe('Risk Score enabled but still no data', () => {
before(() => {
cy.task('esArchiverLoad', 'risk_hosts_no_data');
cy.task('esArchiverLoad', 'risk_users_no_data');
cy.task('esArchiverLoad', { archiveName: 'risk_hosts_no_data' });
cy.task('esArchiverLoad', { archiveName: 'risk_users_no_data' });
});

beforeEach(() => {
Expand All @@ -102,8 +102,8 @@ describe('Entity Analytics Dashboard', { tags: ['@ess', '@brokenInServerless'] }

describe('With Legacy data', () => {
before(() => {
cy.task('esArchiverLoad', 'risk_hosts_legacy_data');
cy.task('esArchiverLoad', 'risk_users_legacy_data');
cy.task('esArchiverLoad', { archiveName: 'risk_hosts_legacy_data' });
cy.task('esArchiverLoad', { archiveName: 'risk_users_legacy_data' });
});

beforeEach(() => {
Expand All @@ -127,7 +127,7 @@ describe('Entity Analytics Dashboard', { tags: ['@ess', '@brokenInServerless'] }

describe('With host risk data', () => {
before(() => {
cy.task('esArchiverLoad', 'risk_hosts');
cy.task('esArchiverLoad', { archiveName: 'risk_hosts' });
});

beforeEach(() => {
Expand Down Expand Up @@ -215,7 +215,7 @@ describe('Entity Analytics Dashboard', { tags: ['@ess', '@brokenInServerless'] }

describe('With user risk data', () => {
before(() => {
cy.task('esArchiverLoad', 'risk_users');
cy.task('esArchiverLoad', { archiveName: 'risk_users' });
});

beforeEach(() => {
Expand Down Expand Up @@ -304,7 +304,7 @@ describe('Entity Analytics Dashboard', { tags: ['@ess', '@brokenInServerless'] }

describe('With anomalies data', () => {
before(() => {
cy.task('esArchiverLoad', 'network');
cy.task('esArchiverLoad', { archiveName: 'network' });
login();
visit(ENTITY_ANALYTICS_URL);
cy.get(ANOMALIES_TABLE).should('be.visible');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { TABLE_CELL, TABLE_ROWS } from '../../../screens/alerts_details';
describe('risk tab', { tags: ['@ess', '@serverless'] }, () => {
before(() => {
cleanKibana();
cy.task('esArchiverLoad', 'risk_hosts');
cy.task('esArchiverLoad', { archiveName: 'risk_hosts' });
});

beforeEach(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const defaultHeadersInDefaultEcsCategory = [

describe('Events Viewer', { tags: ['@ess', '@brokenInServerless'] }, () => {
before(() => {
cy.task('esArchiverLoad', 'auditbeat_big');
cy.task('esArchiverLoad', { archiveName: 'auditbeat_big' });
});

after(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { clearSearchBar, kqlSearch } from '../../../tasks/security_header';
describe('risk tab', { tags: ['@ess', '@brokenInServerless'] }, () => {
before(() => {
cleanKibana();
cy.task('esArchiverLoad', 'risk_hosts');
cy.task('esArchiverLoad', { archiveName: 'risk_hosts' });
});

beforeEach(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { kqlSearch } from '../../../tasks/security_header';
describe('All hosts table', { tags: ['@ess', '@serverless'] }, () => {
before(() => {
cleanKibana();
cy.task('esArchiverLoad', 'risk_hosts');
cy.task('esArchiverLoad', { archiveName: 'risk_hosts' });
});

beforeEach(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ describe.skip('Hover actions', { tags: ['@ess', '@serverless'] }, () => {
};

before(() => {
cy.task('esArchiverLoad', 'network');
cy.task('esArchiverLoad', { archiveName: 'network' });
});

after(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const testDomainTwo = 'myTest2';
describe('Overflow items', { tags: ['@ess', '@serverless'] }, () => {
context('Network stats and tables', () => {
before(() => {
cy.task('esArchiverLoad', 'network');
cy.task('esArchiverLoad', { archiveName: 'network' });
});

beforeEach(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { getTimeline } from '../../../objects/timeline';
describe('Overview Page', { tags: ['@ess', '@serverless'] }, () => {
before(() => {
cleanKibana();
cy.task('esArchiverLoad', 'overview');
cy.task('esArchiverLoad', { archiveName: 'overview' });
});

beforeEach(() => {
Expand Down Expand Up @@ -69,7 +69,7 @@ describe('Overview page with no data', { tags: '@brokenInServerless' }, () => {
cy.task('esArchiverUnload', 'auditbeat');
});
after(() => {
cy.task('esArchiverLoad', 'auditbeat');
cy.task('esArchiverLoad', { archiveName: 'auditbeat' });
});

it('Splash screen should be here', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { goToTablePage, sortFirstTableColumn } from '../../../tasks/table_pagina
describe('Pagination', { tags: ['@ess', '@serverless'] }, () => {
describe('Host uncommon processes table)', () => {
before(() => {
cy.task('esArchiverLoad', 'host_uncommon_processes');
cy.task('esArchiverLoad', { archiveName: 'host_uncommon_processes' });
});

beforeEach(() => {
Expand Down Expand Up @@ -99,7 +99,7 @@ describe('Pagination', { tags: ['@ess', '@serverless'] }, () => {

describe('All users and all Hosts tables', () => {
before(() => {
cy.task('esArchiverLoad', 'all_users');
cy.task('esArchiverLoad', { archiveName: 'all_users' });
});

beforeEach(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ import { USERS_URL } from '../../../urls/navigation';
describe('Users stats and tables', () => {
before(() => {
cleanKibana();
cy.task('esArchiverLoad', 'users');
cy.task('esArchiverLoad', { archiveName: 'users' });

cy.task('esArchiverLoad', 'risk_users');
cy.task('esArchiverLoad', { archiveName: 'risk_users' });
});

beforeEach(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ const DATA_VIEW = 'auditbeat-*';

describe('Inspect Explore pages', { tags: ['@ess', '@serverless'] }, () => {
before(() => {
cy.task('esArchiverLoad', 'risk_users');
cy.task('esArchiverLoad', 'risk_hosts');
cy.task('esArchiverLoad', { archiveName: 'risk_users' });
cy.task('esArchiverLoad', { archiveName: 'risk_hosts' });

login();
// Create and select data view
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ import { ALERTS_URL } from '../../../urls/navigation';
describe('Alerts Table Action column', { tags: ['@ess', '@serverless'] }, () => {
before(() => {
cleanKibana();
cy.task('esArchiverLoad', 'process_ancestry');
cy.task('esArchiverLoad', {
archiveName: 'process_ancestry',
});
});

beforeEach(() => {
Expand Down
Loading