fix lint error

This commit is contained in:
Jonathan Budzenski 2024-03-29 17:13:45 -05:00
parent cbaa8c04c6
commit c5754d96d7

View file

@ -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');
});
});
}
);