diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/endpoint_alerts.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/endpoint_alerts.cy.ts index 9df69b03e072c..7cd7ea257aa05 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/e2e/endpoint_alerts.cy.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/endpoint_alerts.cy.ts @@ -19,72 +19,84 @@ import { login, ROLE } from '../tasks/login'; import { EXECUTE_ROUTE } from '../../../../common/endpoint/constants'; import { waitForActionToComplete } from '../tasks/response_actions'; -describe('Endpoint generated alerts', { tags: ['@ess', '@serverless'] }, () => { - let indexedPolicy: IndexedFleetEndpointPolicyResponse; - let policy: PolicyData; - let createdHost: CreateAndEnrollEndpointHostResponse; +describe( + 'Endpoint generated alerts', + { + tags: [ + '@ess', + '@serverless', + '@brokenInServerless', + '@skipInServerless', + '@skipInServerlessMKI', + ], + }, + () => { + let indexedPolicy: IndexedFleetEndpointPolicyResponse; + let policy: PolicyData; + let createdHost: CreateAndEnrollEndpointHostResponse; - beforeEach(() => { - login(ROLE.soc_manager); - getEndpointIntegrationVersion().then((version) => { - createAgentPolicyTask(version, 'alerts test').then((data) => { - indexedPolicy = data; - policy = indexedPolicy.integrationPolicies[0]; + beforeEach(() => { + login(ROLE.soc_manager); + getEndpointIntegrationVersion().then((version) => { + createAgentPolicyTask(version, 'alerts test').then((data) => { + indexedPolicy = data; + policy = indexedPolicy.integrationPolicies[0]; - return enableAllPolicyProtections(policy.id).then(() => { - // Create and enroll a new Endpoint host - return createEndpointHost(policy.policy_ids[0]).then((host) => { - createdHost = host as CreateAndEnrollEndpointHostResponse; + return enableAllPolicyProtections(policy.id).then(() => { + // Create and enroll a new Endpoint host + return createEndpointHost(policy.policy_ids[0]).then((host) => { + createdHost = host as CreateAndEnrollEndpointHostResponse; + }); }); }); }); }); - }); - afterEach(() => { - if (createdHost) { - cy.task('destroyEndpointHost', createdHost); - } + afterEach(() => { + if (createdHost) { + cy.task('destroyEndpointHost', createdHost); + } - if (indexedPolicy) { - cy.task('deleteIndexedFleetEndpointPolicies', indexedPolicy); - } + if (indexedPolicy) { + cy.task('deleteIndexedFleetEndpointPolicies', indexedPolicy); + } - if (createdHost) { - deleteAllLoadedEndpointData({ endpointAgentIds: [createdHost.agentId] }); - } - }); + if (createdHost) { + deleteAllLoadedEndpointData({ endpointAgentIds: [createdHost.agentId] }); + } + }); - it('should create a Detection Engine alert from an endpoint alert', () => { - // Triggers a Malicious Behaviour alert on Linux system (`grep *` was added only to identify this specific alert) - const executeMaliciousCommand = `bash -c cat /dev/tcp/foo | grep ${Math.random() - .toString(16) - .substring(2)}`; + it('should create a Detection Engine alert from an endpoint alert', () => { + // Triggers a Malicious Behaviour alert on Linux system (`grep *` was added only to identify this specific alert) + const executeMaliciousCommand = `bash -c cat /dev/tcp/foo | grep ${Math.random() + .toString(16) + .substring(2)}`; - // Send `execute` command that triggers malicious behaviour using the `execute` response action - request({ - method: 'POST', - url: EXECUTE_ROUTE, - body: { - endpoint_ids: [createdHost.agentId], - parameters: { - command: executeMaliciousCommand, - }, - }, - }) - .then((response) => waitForActionToComplete(response.body.data.id)) - .then(() => { - return waitForEndpointAlerts(createdHost.agentId, [ - { - term: { 'process.group_leader.args': executeMaliciousCommand }, + // Send `execute` command that triggers malicious behaviour using the `execute` response action + request({ + method: 'POST', + url: EXECUTE_ROUTE, + body: { + endpoint_ids: [createdHost.agentId], + parameters: { + command: executeMaliciousCommand, }, - ]); + }, }) - .then(() => { - return navigateToAlertsList( - `query=(language:kuery,query:'agent.id: "${createdHost.agentId}" ')` - ); - }); - getAlertsTableRows().should('have.length.greaterThan', 0); - }); -}); + .then((response) => waitForActionToComplete(response.body.data.id)) + .then(() => { + return waitForEndpointAlerts(createdHost.agentId, [ + { + term: { 'process.group_leader.args': executeMaliciousCommand }, + }, + ]); + }) + .then(() => { + return navigateToAlertsList( + `query=(language:kuery,query:'agent.id: "${createdHost.agentId}" ')` + ); + }); + getAlertsTableRows().should('have.length.greaterThan', 0); + }); + } +); diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/execute.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/execute.cy.ts index 042031b301185..40a3f72e2d98e 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/execute.cy.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/execute.cy.ts @@ -21,54 +21,66 @@ 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'] }, () => { - beforeEach(() => { - login(); - }); +describe( + 'Response console', + { + tags: [ + '@ess', + '@serverless', + '@brokenInServerless', + '@skipInServerless', + '@skipInServerlessMKI', + ], + }, + () => { + beforeEach(() => { + login(); + }); - describe('Execute operations:', () => { - const homeFilePath = process.env.CI || true ? '/home/vagrant' : `/home/ubuntu`; + describe('Execute operations:', () => { + const homeFilePath = process.env.CI || true ? '/home/vagrant' : `/home/ubuntu`; - let indexedPolicy: IndexedFleetEndpointPolicyResponse; - let policy: PolicyData; - let createdHost: CreateAndEnrollEndpointHostResponse; + let indexedPolicy: IndexedFleetEndpointPolicyResponse; + let policy: PolicyData; + let createdHost: CreateAndEnrollEndpointHostResponse; - before(() => { - getEndpointIntegrationVersion().then((version) => - createAgentPolicyTask(version).then((data) => { - indexedPolicy = data; - policy = indexedPolicy.integrationPolicies[0]; + 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_ids[0]).then((host) => { - createdHost = host as CreateAndEnrollEndpointHostResponse; + return enableAllPolicyProtections(policy.id).then(() => { + // Create and enroll a new Endpoint host + return createEndpointHost(policy.policy_ids[0]).then((host) => { + createdHost = host as CreateAndEnrollEndpointHostResponse; + }); }); - }); - }) - ); - }); + }) + ); + }); - after(() => { - if (createdHost) { - cy.task('destroyEndpointHost', createdHost); - } + after(() => { + if (createdHost) { + cy.task('destroyEndpointHost', createdHost); + } - if (indexedPolicy) { - cy.task('deleteIndexedFleetEndpointPolicies', indexedPolicy); - } + if (indexedPolicy) { + cy.task('deleteIndexedFleetEndpointPolicies', indexedPolicy); + } - if (createdHost) { - deleteAllLoadedEndpointData({ endpointAgentIds: [createdHost.agentId] }); - } - }); + if (createdHost) { + deleteAllLoadedEndpointData({ endpointAgentIds: [createdHost.agentId] }); + } + }); - it('"execute --command" - should execute a command', () => { - waitForEndpointListPageToBeLoaded(createdHost.hostname); - openResponseConsoleFromEndpointList(); - inputConsoleCommand(`execute --command "ls -al ${homeFilePath}"`); - submitCommand(); - waitForCommandToBeExecuted('execute'); + it('"execute --command" - should execute a command', () => { + waitForEndpointListPageToBeLoaded(createdHost.hostname); + openResponseConsoleFromEndpointList(); + inputConsoleCommand(`execute --command "ls -al ${homeFilePath}"`); + submitCommand(); + waitForCommandToBeExecuted('execute'); + }); }); - }); -}); + } +); diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/file_operations.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/file_operations.cy.ts index ef252cbce01aa..340bb3d03cba7 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/file_operations.cy.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/file_operations.cy.ts @@ -21,115 +21,127 @@ 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'] }, () => { - beforeEach(() => { - login(); - }); - - describe('File operations:', () => { - const homeFilePath = Cypress.env('IS_CI') ? '/home/vagrant' : '/home/ubuntu'; - - const fileContent = 'This is a test file for the get-file command.'; - const filePath = `${homeFilePath}/test_file.txt`; - - let indexedPolicy: IndexedFleetEndpointPolicyResponse; - let policy: PolicyData; - let createdHost: CreateAndEnrollEndpointHostResponse; - - 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_ids[0]).then((host) => { - createdHost = host as CreateAndEnrollEndpointHostResponse; - }); - }); - }) - ); +describe( + 'Response console', + { + tags: [ + '@ess', + '@serverless', + '@brokenInServerless', + '@skipInServerless', + '@skipInServerlessMKI', + ], + }, + () => { + beforeEach(() => { + login(); }); - after(() => { - if (createdHost) { - cy.task('destroyEndpointHost', createdHost); - } - - if (indexedPolicy) { - cy.task('deleteIndexedFleetEndpointPolicies', indexedPolicy); - } + describe('File operations:', () => { + const homeFilePath = Cypress.env('IS_CI') ? '/home/vagrant' : '/home/ubuntu'; - if (createdHost) { - deleteAllLoadedEndpointData({ endpointAgentIds: [createdHost.agentId] }); - } - }); + const fileContent = 'This is a test file for the get-file command.'; + const filePath = `${homeFilePath}/test_file.txt`; - it('"get-file --path" - should retrieve a file', () => { - const downloadsFolder = Cypress.config('downloadsFolder'); + let indexedPolicy: IndexedFleetEndpointPolicyResponse; + let policy: PolicyData; + let createdHost: CreateAndEnrollEndpointHostResponse; - waitForEndpointListPageToBeLoaded(createdHost.hostname); - cy.task('createFileOnEndpoint', { - hostname: createdHost.hostname, - path: filePath, - content: fileContent, - }); + before(() => { + getEndpointIntegrationVersion().then((version) => + createAgentPolicyTask(version).then((data) => { + indexedPolicy = data; + policy = indexedPolicy.integrationPolicies[0]; - // initiate get file action and wait for the API to complete - cy.intercept('api/endpoint/action/get_file').as('getFileAction'); - openResponseConsoleFromEndpointList(); - inputConsoleCommand(`get-file --path ${filePath}`); - submitCommand(); - cy.wait('@getFileAction', { timeout: 60000 }); - - // verify that the file was retrieved - // and that the file download link is available - cy.getByTestSubj('getFileSuccess').within(() => { - cy.contains('File retrieved from the host.'); - cy.contains('(ZIP file passcode: elastic)'); - cy.contains( - 'Files are periodically deleted to clear storage space. Download and save file locally if needed.' + return enableAllPolicyProtections(policy.id).then(() => { + // Create and enroll a new Endpoint host + return createEndpointHost(policy.policy_ids[0]).then((host) => { + createdHost = host as CreateAndEnrollEndpointHostResponse; + }); + }); + }) ); - cy.contains('Click here to download').should('exist'); }); - cy.contains('Click here to download').click(); + after(() => { + if (createdHost) { + cy.task('destroyEndpointHost', createdHost); + } - // wait for file to be downloaded - cy.readFile(`${downloadsFolder}/upload.zip`, { timeout: 120000 }).should('exist'); + if (indexedPolicy) { + cy.task('deleteIndexedFleetEndpointPolicies', indexedPolicy); + } - // move the zip file to VM - cy.task('uploadFileToEndpoint', { - hostname: createdHost.hostname, - srcPath: `${downloadsFolder}/upload.zip`, - destPath: `${homeFilePath}/upload.zip`, + if (createdHost) { + deleteAllLoadedEndpointData({ endpointAgentIds: [createdHost.agentId] }); + } }); - // unzip the file and read its content - cy.task('readZippedFileContentOnEndpoint', { - hostname: createdHost.hostname, - path: `${homeFilePath}/upload.zip`, - password: 'elastic', - }).then((unzippedFileContent) => { - expect(unzippedFileContent).to.contain(fileContent); + it('"get-file --path" - should retrieve a file', () => { + const downloadsFolder = Cypress.config('downloadsFolder'); + + waitForEndpointListPageToBeLoaded(createdHost.hostname); + cy.task('createFileOnEndpoint', { + hostname: createdHost.hostname, + path: filePath, + content: fileContent, + }); + + // initiate get file action and wait for the API to complete + cy.intercept('api/endpoint/action/get_file').as('getFileAction'); + openResponseConsoleFromEndpointList(); + inputConsoleCommand(`get-file --path ${filePath}`); + submitCommand(); + cy.wait('@getFileAction', { timeout: 60000 }); + + // verify that the file was retrieved + // and that the file download link is available + cy.getByTestSubj('getFileSuccess').within(() => { + cy.contains('File retrieved from the host.'); + cy.contains('(ZIP file passcode: elastic)'); + cy.contains( + 'Files are periodically deleted to clear storage space. Download and save file locally if needed.' + ); + cy.contains('Click here to download').should('exist'); + }); + + cy.contains('Click here to download').click(); + + // wait for file to be downloaded + cy.readFile(`${downloadsFolder}/upload.zip`, { timeout: 120000 }).should('exist'); + + // move the zip file to VM + cy.task('uploadFileToEndpoint', { + hostname: createdHost.hostname, + srcPath: `${downloadsFolder}/upload.zip`, + destPath: `${homeFilePath}/upload.zip`, + }); + + // unzip the file and read its content + cy.task('readZippedFileContentOnEndpoint', { + hostname: createdHost.hostname, + path: `${homeFilePath}/upload.zip`, + password: 'elastic', + }).then((unzippedFileContent) => { + expect(unzippedFileContent).to.contain(fileContent); + }); }); - }); - it('"upload --file" - should upload a file', () => { - waitForEndpointListPageToBeLoaded(createdHost.hostname); - openResponseConsoleFromEndpointList(); - inputConsoleCommand(`upload --file`); - cy.getByTestSubj('console-arg-file-picker').selectFile( - { - contents: Cypress.Buffer.from('upload file content here!'), - fileName: 'upload_file.txt', - lastModified: Date.now(), - }, - { force: true } - ); - submitCommand(); - waitForCommandToBeExecuted('upload'); + it('"upload --file" - should upload a file', () => { + waitForEndpointListPageToBeLoaded(createdHost.hostname); + openResponseConsoleFromEndpointList(); + inputConsoleCommand(`upload --file`); + cy.getByTestSubj('console-arg-file-picker').selectFile( + { + contents: Cypress.Buffer.from('upload file content here!'), + fileName: 'upload_file.txt', + lastModified: Date.now(), + }, + { force: true } + ); + submitCommand(); + waitForCommandToBeExecuted('upload'); + }); }); - }); -}); + } +); diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/isolate.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/isolate.cy.ts index f89f2a6f62ecf..700d018142eae 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/isolate.cy.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/isolate.cy.ts @@ -26,56 +26,68 @@ 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'] }, () => { - let indexedPolicy: IndexedFleetEndpointPolicyResponse; - let policy: PolicyData; - let createdHost: CreateAndEnrollEndpointHostResponse; +describe( + 'Response console', + { + tags: [ + '@ess', + '@serverless', + '@brokenInServerless', + '@skipInServerless', + '@skipInServerlessMKI', + ], + }, + () => { + let indexedPolicy: IndexedFleetEndpointPolicyResponse; + let policy: PolicyData; + let createdHost: CreateAndEnrollEndpointHostResponse; - before(() => { - getEndpointIntegrationVersion().then((version) => - createAgentPolicyTask(version).then((data) => { - indexedPolicy = data; - policy = indexedPolicy.integrationPolicies[0]; + 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_ids[0]).then((host) => { - createdHost = host as CreateAndEnrollEndpointHostResponse; + return enableAllPolicyProtections(policy.id).then(() => { + // Create and enroll a new Endpoint host + return createEndpointHost(policy.policy_ids[0]).then((host) => { + createdHost = host as CreateAndEnrollEndpointHostResponse; + }); }); - }); - }) - ); - }); - - after(() => { - if (createdHost) { - cy.task('destroyEndpointHost', createdHost); - } + }) + ); + }); - if (indexedPolicy) { - cy.task('deleteIndexedFleetEndpointPolicies', indexedPolicy); - } + after(() => { + if (createdHost) { + cy.task('destroyEndpointHost', createdHost); + } - if (createdHost) { - deleteAllLoadedEndpointData({ endpointAgentIds: [createdHost.agentId] }); - } - }); + if (indexedPolicy) { + cy.task('deleteIndexedFleetEndpointPolicies', indexedPolicy); + } - describe('Host Isolation:', () => { - beforeEach(() => { - login(); + if (createdHost) { + deleteAllLoadedEndpointData({ endpointAgentIds: [createdHost.agentId] }); + } }); - it('should isolate a host from response console', () => { - const command = 'isolate'; - waitForEndpointListPageToBeLoaded(createdHost.hostname); - checkEndpointListForOnlyUnIsolatedHosts(); - openResponseConsoleFromEndpointList(); - performCommandInputChecks(command); - submitCommand(); - waitForCommandToBeExecuted(command); - waitForEndpointListPageToBeLoaded(createdHost.hostname); - checkEndpointListForOnlyIsolatedHosts(); + describe('Host Isolation:', () => { + beforeEach(() => { + login(); + }); + + it('should isolate a host from response console', () => { + const command = 'isolate'; + waitForEndpointListPageToBeLoaded(createdHost.hostname); + checkEndpointListForOnlyUnIsolatedHosts(); + openResponseConsoleFromEndpointList(); + performCommandInputChecks(command); + submitCommand(); + waitForCommandToBeExecuted(command); + waitForEndpointListPageToBeLoaded(createdHost.hostname); + checkEndpointListForOnlyIsolatedHosts(); + }); }); - }); -}); + } +); diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/process_operations.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/process_operations.cy.ts index e09aa8dc9fc85..206237e4038ea 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/process_operations.cy.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/process_operations.cy.ts @@ -26,90 +26,102 @@ import { deleteAllLoadedEndpointData } from '../../../tasks/delete_all_endpoint_ const AGENT_BEAT_FILE_PATH_SUFFIX = '/components/agentbeat'; -describe('Response console', { tags: ['@ess', '@serverless', '@skipInServerlessMKI'] }, () => { - beforeEach(() => { - login(); - }); - - describe('Processes operations:', () => { - let indexedPolicy: IndexedFleetEndpointPolicyResponse; - let policy: PolicyData; - let createdHost: CreateAndEnrollEndpointHostResponse; - - 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_ids[0]).then((host) => { - createdHost = host as CreateAndEnrollEndpointHostResponse; - }); - }); - }) - ); +describe( + 'Response console', + { + tags: [ + '@ess', + '@serverless', + '@brokenInServerless', + '@skipInServerless', + '@skipInServerlessMKI', + ], + }, + () => { + beforeEach(() => { + login(); }); - after(() => { - if (createdHost) { - cy.task('destroyEndpointHost', createdHost); - } + describe('Processes operations:', () => { + let indexedPolicy: IndexedFleetEndpointPolicyResponse; + let policy: PolicyData; + let createdHost: CreateAndEnrollEndpointHostResponse; + + 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_ids[0]).then((host) => { + createdHost = host as CreateAndEnrollEndpointHostResponse; + }); + }); + }) + ); + }); - if (indexedPolicy) { - cy.task('deleteIndexedFleetEndpointPolicies', indexedPolicy); - } + after(() => { + if (createdHost) { + cy.task('destroyEndpointHost', createdHost); + } - if (createdHost) { - deleteAllLoadedEndpointData({ endpointAgentIds: [createdHost.agentId] }); - } - }); + if (indexedPolicy) { + cy.task('deleteIndexedFleetEndpointPolicies', indexedPolicy); + } - it('"processes" - should obtain a list of processes', () => { - waitForEndpointListPageToBeLoaded(createdHost.hostname); - openResponseConsoleFromEndpointList(); + if (createdHost) { + deleteAllLoadedEndpointData({ endpointAgentIds: [createdHost.agentId] }); + } + }); - // get running processes - performCommandInputChecks('processes'); - submitCommand(); - cy.contains('Action pending.').should('exist'); + it('"processes" - should obtain a list of processes', () => { + waitForEndpointListPageToBeLoaded(createdHost.hostname); + openResponseConsoleFromEndpointList(); - // on success - cy.getByTestSubj('processesOutput-processListTable', { timeout: 120000 }).within(() => { - ['USER', 'PID', 'ENTITY ID', 'COMMAND'].forEach((header) => { - cy.contains(header); - }); + // get running processes + performCommandInputChecks('processes'); + submitCommand(); + cy.contains('Action pending.').should('exist'); - cy.get('tbody > tr').should('have.length.greaterThan', 0); - cy.get('tbody > tr > td').should('contain', AGENT_BEAT_FILE_PATH_SUFFIX); + // on success + cy.getByTestSubj('processesOutput-processListTable', { timeout: 120000 }).within(() => { + ['USER', 'PID', 'ENTITY ID', 'COMMAND'].forEach((header) => { + cy.contains(header); + }); + + cy.get('tbody > tr').should('have.length.greaterThan', 0); + cy.get('tbody > tr > td').should('contain', AGENT_BEAT_FILE_PATH_SUFFIX); + }); }); - }); - it('"kill-process --pid" - should kill a process', () => { - waitForEndpointListPageToBeLoaded(createdHost.hostname); - openResponseConsoleFromEndpointList(); + it('"kill-process --pid" - should kill a process', () => { + waitForEndpointListPageToBeLoaded(createdHost.hostname); + openResponseConsoleFromEndpointList(); - // get running processes - getRunningProcesses(AGENT_BEAT_FILE_PATH_SUFFIX).then((pid) => { - // kill the process using PID - inputConsoleCommand(`kill-process --pid ${pid}`); - submitCommand(); - waitForCommandToBeExecuted('kill-process'); + // get running processes + getRunningProcesses(AGENT_BEAT_FILE_PATH_SUFFIX).then((pid) => { + // kill the process using PID + inputConsoleCommand(`kill-process --pid ${pid}`); + submitCommand(); + waitForCommandToBeExecuted('kill-process'); + }); }); - }); - it('"suspend-process --pid" - should suspend a process', () => { - waitForEndpointListPageToBeLoaded(createdHost.hostname); - openResponseConsoleFromEndpointList(); + it('"suspend-process --pid" - should suspend a process', () => { + waitForEndpointListPageToBeLoaded(createdHost.hostname); + openResponseConsoleFromEndpointList(); - // get running processes - getRunningProcesses(AGENT_BEAT_FILE_PATH_SUFFIX).then((pid) => { - // suspend the process using PID - inputConsoleCommand(`suspend-process --pid ${pid}`); - submitCommand(); - waitForCommandToBeExecuted('suspend-process'); + // get running processes + getRunningProcesses(AGENT_BEAT_FILE_PATH_SUFFIX).then((pid) => { + // suspend the process using PID + inputConsoleCommand(`suspend-process --pid ${pid}`); + submitCommand(); + waitForCommandToBeExecuted('suspend-process'); + }); }); }); - }); -}); + } +); diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/release.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/release.cy.ts index d11b7210713a8..96d5955b1de69 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/release.cy.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/release.cy.ts @@ -27,59 +27,71 @@ 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'] }, () => { - let indexedPolicy: IndexedFleetEndpointPolicyResponse; - let policy: PolicyData; - let createdHost: CreateAndEnrollEndpointHostResponse; +describe( + 'Response console', + { + tags: [ + '@ess', + '@serverless', + '@brokenInServerless', + '@skipInServerless', + '@skipInServerlessMKI', + ], + }, + () => { + let indexedPolicy: IndexedFleetEndpointPolicyResponse; + let policy: PolicyData; + let createdHost: CreateAndEnrollEndpointHostResponse; - before(() => { - getEndpointIntegrationVersion().then((version) => - createAgentPolicyTask(version).then((data) => { - indexedPolicy = data; - policy = indexedPolicy.integrationPolicies[0]; + 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_ids[0]).then((host) => { - createdHost = host as CreateAndEnrollEndpointHostResponse; + return enableAllPolicyProtections(policy.id).then(() => { + // Create and enroll a new Endpoint host + return createEndpointHost(policy.policy_ids[0]).then((host) => { + createdHost = host as CreateAndEnrollEndpointHostResponse; + }); }); - }); - }) - ); - }); - - after(() => { - if (createdHost) { - cy.task('destroyEndpointHost', createdHost); - } + }) + ); + }); - if (indexedPolicy) { - cy.task('deleteIndexedFleetEndpointPolicies', indexedPolicy); - } + after(() => { + if (createdHost) { + cy.task('destroyEndpointHost', createdHost); + } - if (createdHost) { - deleteAllLoadedEndpointData({ endpointAgentIds: [createdHost.agentId] }); - } - }); + if (indexedPolicy) { + cy.task('deleteIndexedFleetEndpointPolicies', indexedPolicy); + } - describe('Host Isolation:', () => { - beforeEach(() => { - login(); + if (createdHost) { + deleteAllLoadedEndpointData({ endpointAgentIds: [createdHost.agentId] }); + } }); - it('should release an isolated host via response console', () => { - const command = 'release'; - waitForEndpointListPageToBeLoaded(createdHost.hostname); - // isolate the host first - isolateHostActionViaAPI(createdHost.agentId); - // verify and find the isolated host - checkEndpointListForOnlyIsolatedHosts(); - openResponseConsoleFromEndpointList(); - performCommandInputChecks(command); - submitCommand(); - waitForCommandToBeExecuted(command); - waitForEndpointListPageToBeLoaded(createdHost.hostname); - checkEndpointListForOnlyUnIsolatedHosts(); + describe('Host Isolation:', () => { + beforeEach(() => { + login(); + }); + + it('should release an isolated host via response console', () => { + const command = 'release'; + waitForEndpointListPageToBeLoaded(createdHost.hostname); + // isolate the host first + isolateHostActionViaAPI(createdHost.agentId); + // verify and find the isolated host + checkEndpointListForOnlyIsolatedHosts(); + openResponseConsoleFromEndpointList(); + performCommandInputChecks(command); + submitCommand(); + waitForCommandToBeExecuted(command); + waitForEndpointListPageToBeLoaded(createdHost.hostname); + checkEndpointListForOnlyUnIsolatedHosts(); + }); }); - }); -}); + } +); diff --git a/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/scan.cy.ts b/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/scan.cy.ts index 04630647ed35f..c7a66f6280df0 100644 --- a/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/scan.cy.ts +++ b/x-pack/plugins/security_solution/public/management/cypress/e2e/response_actions/response_console/scan.cy.ts @@ -34,7 +34,13 @@ describe( // ], }, }, - tags: ['@ess', '@serverless', '@skipInServerlessMKI'], + tags: [ + '@ess', + '@serverless', + '@brokenInServerless', + '@skipInServerless', + '@skipInServerlessMKI', + ], }, () => { beforeEach(() => {