-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into fix/vulnerabilities-flyout
- Loading branch information
Showing
19 changed files
with
501 additions
and
88 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
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 was deleted.
Oops, something went wrong.
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
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
115 changes: 115 additions & 0 deletions
115
...ity_solution/public/management/cypress/e2e/response_actions/alerts_response_console.cy.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,115 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import { closeAllToasts } from '../../tasks/toasts'; | ||
import { | ||
getAlertsTableRows, | ||
openAlertDetailsView, | ||
openInvestigateInTimelineView, | ||
openResponderFromEndpointAlertDetails, | ||
} from '../../screens/alerts'; | ||
import { ensureOnResponder } from '../../screens/responder'; | ||
import { cleanupRule, loadRule } from '../../tasks/api_fixtures'; | ||
import type { PolicyData } from '../../../../../common/endpoint/types'; | ||
import type { CreateAndEnrollEndpointHostResponse } from '../../../../../scripts/endpoint/common/endpoint_host_services'; | ||
import { waitForEndpointListPageToBeLoaded } from '../../tasks/response_console'; | ||
import type { IndexedFleetEndpointPolicyResponse } from '../../../../../common/endpoint/data_loaders/index_fleet_endpoint_policy'; | ||
import { createAgentPolicyTask, getEndpointIntegrationVersion } from '../../tasks/fleet'; | ||
import { toggleRuleOffAndOn, visitRuleAlerts } from '../../tasks/isolate'; | ||
|
||
import { login } from '../../tasks/login'; | ||
import { enableAllPolicyProtections } from '../../tasks/endpoint_policy'; | ||
import { createEndpointHost } from '../../tasks/create_endpoint_host'; | ||
import { deleteAllLoadedEndpointData } from '../../tasks/delete_all_endpoint_data'; | ||
|
||
describe('Response console', { tags: ['@ess', '@serverless', '@brokenInServerless'] }, () => { | ||
let indexedPolicy: IndexedFleetEndpointPolicyResponse; | ||
let policy: PolicyData; | ||
let createdHost: CreateAndEnrollEndpointHostResponse; | ||
|
||
beforeEach(() => { | ||
login(); | ||
}); | ||
|
||
before(() => { | ||
getEndpointIntegrationVersion().then((version) => | ||
createAgentPolicyTask(version).then((data) => { | ||
indexedPolicy = data; | ||
policy = indexedPolicy.integrationPolicies[0]; | ||
|
||
return enableAllPolicyProtections(policy.id).then(() => { | ||
// Create and enroll a new Endpoint host | ||
return createEndpointHost(policy.policy_id).then((host) => { | ||
createdHost = host as CreateAndEnrollEndpointHostResponse; | ||
}); | ||
}); | ||
}) | ||
); | ||
}); | ||
|
||
after(() => { | ||
if (createdHost) { | ||
cy.task('destroyEndpointHost', createdHost); | ||
} | ||
|
||
if (indexedPolicy) { | ||
cy.task('deleteIndexedFleetEndpointPolicies', indexedPolicy); | ||
} | ||
|
||
if (createdHost) { | ||
deleteAllLoadedEndpointData({ endpointAgentIds: [createdHost.agentId] }); | ||
} | ||
}); | ||
|
||
describe('From Alerts', () => { | ||
let ruleId: string; | ||
let ruleName: string; | ||
|
||
before(() => { | ||
loadRule( | ||
{ query: `agent.name: ${createdHost.hostname} and agent.type: endpoint` }, | ||
false | ||
).then((data) => { | ||
ruleId = data.id; | ||
ruleName = data.name; | ||
}); | ||
}); | ||
|
||
after(() => { | ||
if (ruleId) { | ||
cleanupRule(ruleId); | ||
} | ||
}); | ||
|
||
it('should open responder from alert details flyout', () => { | ||
waitForEndpointListPageToBeLoaded(createdHost.hostname); | ||
toggleRuleOffAndOn(ruleName); | ||
visitRuleAlerts(ruleName); | ||
closeAllToasts(); | ||
getAlertsTableRows().should('have.length.greaterThan', 0); | ||
openAlertDetailsView(); | ||
|
||
openResponderFromEndpointAlertDetails(); | ||
ensureOnResponder(); | ||
}); | ||
|
||
it('should open responder from timeline view alert details flyout', () => { | ||
waitForEndpointListPageToBeLoaded(createdHost.hostname); | ||
toggleRuleOffAndOn(ruleName); | ||
visitRuleAlerts(ruleName); | ||
closeAllToasts(); | ||
|
||
getAlertsTableRows().should('have.length.greaterThan', 0); | ||
openInvestigateInTimelineView(); | ||
cy.getByTestSubj('timeline-flyout').within(() => { | ||
openAlertDetailsView(); | ||
}); | ||
openResponderFromEndpointAlertDetails(); | ||
ensureOnResponder(); | ||
}); | ||
}); | ||
}); |
Oops, something went wrong.