[EDR Workflows] Enable S1 feature flags (#177147)

This commit is contained in:
Tomasz Ciecierski 2024-02-20 10:52:59 +01:00 committed by GitHub
parent 7476496fb4
commit 95050fe7ab
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 13 additions and 73 deletions

View file

@ -78,7 +78,7 @@ export const allowedExperimentalValues = Object.freeze({
/**
* Enables the ability to send Response actions to SentinelOne
*/
responseActionsSentinelOneV1Enabled: false,
responseActionsSentinelOneV1Enabled: true,
/**
* Enables top charts on Alerts Page

View file

@ -568,6 +568,7 @@ describe('Response actions history', () => {
'Parameters',
'Comment',
'Hostname',
'Agent type',
'Output:',
]
);

View file

@ -671,26 +671,6 @@ describe('Response actions history page', () => {
expect(history.location.search).toEqual('');
});
it('should clear `actionTypes` selected options on `types` filter', () => {
const filterPrefix = 'types-filter';
render();
const { getAllByTestId, getByTestId } = renderResult;
userEvent.click(getByTestId(`${testPrefix}-${filterPrefix}-popoverButton`));
const allFilterOptions = getAllByTestId(`${filterPrefix}-option`);
allFilterOptions.forEach((option) => {
option.style.pointerEvents = 'all';
userEvent.click(option);
});
expect(history.location.search).toEqual('?types=automated%2Cmanual');
const clearAllButton = getByTestId(`${testPrefix}-${filterPrefix}-clearAllButton`);
clearAllButton.style.pointerEvents = 'all';
userEvent.click(clearAllButton);
expect(history.location.search).toEqual('');
});
it('should clear `agentTypes` and `actionTypes` selected options on `types` filter', () => {
mockedContext.setExperimentalFlag({
responseActionsSentinelOneV1Enabled: true,

View file

@ -15,11 +15,9 @@ import {
} from '@kbn/core/server/mocks';
import type { EndpointActionListRequestQuery } from '../../../../common/api/endpoint';
import { BASE_ENDPOINT_ACTION_ROUTE } from '../../../../common/endpoint/constants';
import { EndpointAppContextService } from '../../endpoint_app_context_services';
import type { HttpApiTestSetupMock } from '../../mocks';
import {
createMockEndpointAppContext,
createMockEndpointAppContextServiceSetupContract,
createMockEndpointAppContextServiceStartContract,
createHttpApiTestSetupMock,
createRouteHandlerContext,
getRegisteredVersionedRouteMock,
} from '../../mocks';
@ -37,8 +35,8 @@ const mockGetActionList = getActionList as jest.Mock;
const mockGetActionListByStatus = getActionListByStatus as jest.Mock;
describe('Action List Handler', () => {
let endpointAppContextService: EndpointAppContextService;
let mockResponse: jest.Mocked<KibanaResponseFactory>;
let apiTestSetup: HttpApiTestSetupMock;
let actionListHandler: (
query?: EndpointActionListRequestQuery
@ -47,12 +45,11 @@ describe('Action List Handler', () => {
beforeEach(() => {
const esClientMock = elasticsearchServiceMock.createScopedClusterClient();
const routerMock = httpServiceMock.createRouter();
endpointAppContextService = new EndpointAppContextService();
endpointAppContextService.setup(createMockEndpointAppContextServiceSetupContract());
endpointAppContextService.start(createMockEndpointAppContextServiceStartContract());
apiTestSetup = createHttpApiTestSetupMock();
mockDoesLogsEndpointActionsIndexExist.mockResolvedValue(true);
registerActionListRoutes(routerMock, createMockEndpointAppContext());
registerActionListRoutes(routerMock, apiTestSetup.endpointAppContextMock);
actionListHandler = async (
query?: EndpointActionListRequestQuery
@ -81,10 +78,6 @@ describe('Action List Handler', () => {
};
});
afterEach(() => {
endpointAppContextService.stop();
});
describe('Internals', () => {
const defaultParams = { pageSize: 10, page: 1 };
it('should return `notFound` when actions index does not exist', async () => {
@ -96,8 +89,10 @@ describe('Action List Handler', () => {
});
it('should return `badRequest` when sentinel_one feature flag is not enabled and agentType is `sentinel_one`', async () => {
// @ts-expect-error We're writing to a readonly property just for the purpose of the test
endpointAppContextService.experimentalFeatures.responseActionsSentinelOneV1Enabled = false;
apiTestSetup.endpointAppContextMock.experimentalFeatures = {
...apiTestSetup.endpointAppContextMock.experimentalFeatures,
responseActionsSentinelOneV1Enabled: false,
};
await actionListHandler({ ...defaultParams, agentTypes: 'sentinel_one' });
expect(mockResponse.customError).toHaveBeenCalledWith({
statusCode: 400,

View file

@ -16,8 +16,7 @@ export const allowedExperimentalValues = Object.freeze({
// set to true to show tech preview badge on sentinel one connector
sentinelOneConnectorOn: true,
// set to true to show beta badge on sentinel one connector
// TODO: set to true when 8.13 is ready
sentinelOneConnectorOnBeta: false,
sentinelOneConnectorOnBeta: true,
});
export type ExperimentalConfigKeys = Array<keyof ExperimentalFeatures>;

View file

@ -1,34 +0,0 @@
/*
* 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 { ISOLATE_HOST_ROUTE_V2 } from '@kbn/security-solution-plugin/common/endpoint/constants';
import { FtrProviderContext } from '../../ftr_provider_context';
import { targetTags } from '../../../security_solution_endpoint/target_tags';
export default function ({ getService }: FtrProviderContext) {
const supertest = getService('supertest');
describe('Response Actions support for sentinelOne agentType', function () {
targetTags(this, ['@ess', '@serverless']);
describe('and the "responseActionsSentinelOneV1Enabled" feature flag is disabled', () => {
// When feature flag is enabled, this entire `describe()` block should be removed
it('should return an error', async () => {
await supertest
.post(ISOLATE_HOST_ROUTE_V2)
.set('kbn-xsrf', 'true')
.set('Elastic-Api-Version', '2023-10-31')
.send({ endpoint_ids: ['test'], agent_type: 'sentinel_one' })
.expect(400, {
statusCode: 400,
error: 'Bad Request',
message: '[request body.agent_type]: feature is disabled',
});
});
});
});
}

View file

@ -57,7 +57,6 @@ export default function endpointAPIIntegrationTests(providerContext: FtrProvider
loadTestFile(require.resolve('./package'));
loadTestFile(require.resolve('./endpoint_authz'));
loadTestFile(require.resolve('./endpoint_response_actions/execute'));
loadTestFile(require.resolve('./endpoint_response_actions/agent_type_support'));
loadTestFile(require.resolve('./endpoint_artifacts/trusted_apps'));
loadTestFile(require.resolve('./endpoint_artifacts/event_filters'));
loadTestFile(require.resolve('./endpoint_artifacts/host_isolation_exceptions'));