Skip to content

Commit a65db69

Browse files
committed
Fix pre import handler
1 parent 8e41fbf commit a65db69

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

x-pack/solutions/security/plugins/security_solution/server/lists_integration/endpoint/handlers/exceptions_pre_import_handler.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77

88
import type { ExceptionsListPreImportServerExtension } from '@kbn/lists-plugin/server';
9-
import { ENDPOINT_ARTIFACT_LISTS } from '@kbn/securitysolution-list-constants';
9+
import { ENDPOINT_LIST_ID } from '@kbn/securitysolution-list-constants';
1010
import type { PromiseFromStreams } from '@kbn/lists-plugin/server/services/exception_lists/import_exception_list_and_items';
1111
import { stringify } from '../../../endpoint/utils/stringify';
1212
import type { EndpointAppContextService } from '../../../endpoint/endpoint_app_context_services';
@@ -24,11 +24,7 @@ export const getExceptionsPreImportHandler = (
2424
return async ({ data }) => {
2525
const hasEndpointArtifactListOrListItems = [...data.lists, ...data.items].some((item) => {
2626
if ('list_id' in item) {
27-
const NON_IMPORTABLE_ENDPOINT_ARTIFACT_IDS = ALL_ENDPOINT_ARTIFACT_LIST_IDS.filter(
28-
(listId) => listId !== ENDPOINT_ARTIFACT_LISTS.endpointExceptions.id
29-
) as string[];
30-
31-
return NON_IMPORTABLE_ENDPOINT_ARTIFACT_IDS.includes(item.list_id);
27+
return (ALL_ENDPOINT_ARTIFACT_LIST_IDS as string[]).includes(item.list_id);
3228
}
3329

3430
return false;
@@ -50,7 +46,7 @@ export const getExceptionsPreImportHandler = (
5046
for (const item of data.items) {
5147
if (
5248
!(item instanceof Error) &&
53-
item.list_id === ENDPOINT_ARTIFACT_LISTS.endpointExceptions.id &&
49+
item.list_id === ENDPOINT_LIST_ID &&
5450
item.tags?.includes(GLOBAL_ARTIFACT_TAG) === false
5551
) {
5652
item.tags = item.tags ?? [];

0 commit comments

Comments
 (0)