mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
fix lint error
This commit is contained in:
parent
cbaa8c04c6
commit
c5754d96d7
1 changed files with 81 additions and 77 deletions
|
@ -21,91 +21,95 @@ import { deleteAllLoadedEndpointData } from '../../tasks/delete_all_endpoint_dat
|
|||
import { enableAllPolicyProtections } from '../../tasks/endpoint_policy';
|
||||
|
||||
// Failing: See https://github.com/elastic/kibana/issues/168340
|
||||
describe.skip('Automated Response Actions', {
|
||||
tags: ['@ess', '@serverless'],
|
||||
env: {
|
||||
ftrConfig: {
|
||||
kbnServerArgs: [
|
||||
`--xpack.securitySolution.enableExperimental=${JSON.stringify([
|
||||
'automatedProcessActionsEnabled',
|
||||
])}`,
|
||||
],
|
||||
describe.skip(
|
||||
'Automated Response Actions',
|
||||
{
|
||||
tags: ['@ess', '@serverless'],
|
||||
env: {
|
||||
ftrConfig: {
|
||||
kbnServerArgs: [
|
||||
`--xpack.securitySolution.enableExperimental=${JSON.stringify([
|
||||
'automatedProcessActionsEnabled',
|
||||
])}`,
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
}, () => {
|
||||
let indexedPolicy: IndexedFleetEndpointPolicyResponse;
|
||||
let policy: PolicyData;
|
||||
let createdHost: CreateAndEnrollEndpointHostResponse;
|
||||
|
||||
before(() => {
|
||||
getEndpointIntegrationVersion().then((version) =>
|
||||
createAgentPolicyTask(version, 'automated_response_actions').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] });
|
||||
}
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
login();
|
||||
});
|
||||
|
||||
// FLAKY: https://github.com/elastic/kibana/issues/169828
|
||||
describe.skip('From alerts', () => {
|
||||
let ruleId: string;
|
||||
let ruleName: string;
|
||||
() => {
|
||||
let indexedPolicy: IndexedFleetEndpointPolicyResponse;
|
||||
let policy: PolicyData;
|
||||
let createdHost: CreateAndEnrollEndpointHostResponse;
|
||||
|
||||
before(() => {
|
||||
loadRule().then((data) => {
|
||||
ruleId = data.id;
|
||||
ruleName = data.name;
|
||||
});
|
||||
getEndpointIntegrationVersion().then((version) =>
|
||||
createAgentPolicyTask(version, 'automated_response_actions').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 (ruleId) {
|
||||
cleanupRule(ruleId);
|
||||
if (createdHost) {
|
||||
cy.task('destroyEndpointHost', createdHost);
|
||||
}
|
||||
|
||||
if (indexedPolicy) {
|
||||
cy.task('deleteIndexedFleetEndpointPolicies', indexedPolicy);
|
||||
}
|
||||
|
||||
if (createdHost) {
|
||||
deleteAllLoadedEndpointData({ endpointAgentIds: [createdHost.agentId] });
|
||||
}
|
||||
});
|
||||
|
||||
it('should have generated endpoint and rule', () => {
|
||||
loadPage(APP_ENDPOINTS_PATH);
|
||||
cy.contains(createdHost.hostname).should('exist');
|
||||
|
||||
toggleRuleOffAndOn(ruleName);
|
||||
|
||||
visitRuleAlerts(ruleName);
|
||||
closeAllToasts();
|
||||
|
||||
changeAlertsFilter('process.name: "sshd"');
|
||||
cy.getByTestSubj('expand-event').eq(0).click();
|
||||
cy.getByTestSubj('securitySolutionFlyoutNavigationExpandDetailButton').click();
|
||||
cy.getByTestSubj('securitySolutionFlyoutResponseTab').click();
|
||||
|
||||
cy.contains(/isolate is pending|isolate completed successfully/g);
|
||||
cy.contains(/kill-process is pending|kill-process completed successfully/g);
|
||||
cy.contains('The action was called with a non-existing event field name: entity_id');
|
||||
beforeEach(() => {
|
||||
login();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
// FLAKY: https://github.com/elastic/kibana/issues/169828
|
||||
describe.skip('From alerts', () => {
|
||||
let ruleId: string;
|
||||
let ruleName: string;
|
||||
|
||||
before(() => {
|
||||
loadRule().then((data) => {
|
||||
ruleId = data.id;
|
||||
ruleName = data.name;
|
||||
});
|
||||
});
|
||||
|
||||
after(() => {
|
||||
if (ruleId) {
|
||||
cleanupRule(ruleId);
|
||||
}
|
||||
});
|
||||
|
||||
it('should have generated endpoint and rule', () => {
|
||||
loadPage(APP_ENDPOINTS_PATH);
|
||||
cy.contains(createdHost.hostname).should('exist');
|
||||
|
||||
toggleRuleOffAndOn(ruleName);
|
||||
|
||||
visitRuleAlerts(ruleName);
|
||||
closeAllToasts();
|
||||
|
||||
changeAlertsFilter('process.name: "sshd"');
|
||||
cy.getByTestSubj('expand-event').eq(0).click();
|
||||
cy.getByTestSubj('securitySolutionFlyoutNavigationExpandDetailButton').click();
|
||||
cy.getByTestSubj('securitySolutionFlyoutResponseTab').click();
|
||||
|
||||
cy.contains(/isolate is pending|isolate completed successfully/g);
|
||||
cy.contains(/kill-process is pending|kill-process completed successfully/g);
|
||||
cy.contains('The action was called with a non-existing event field name: entity_id');
|
||||
});
|
||||
});
|
||||
}
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue