diff --git a/x-pack/plugins/lists/common/schemas/types/entries.ts b/x-pack/plugins/lists/common/schemas/types/entries.ts index b483ef94168b3..96d4bc22f55af 100644 --- a/x-pack/plugins/lists/common/schemas/types/entries.ts +++ b/x-pack/plugins/lists/common/schemas/types/entries.ts @@ -19,7 +19,6 @@ export const entry = t.union([ entriesMatchAny, entriesList, entriesExists, - entriesNested, entriesMatchWildcard, ]); export type Entry = t.TypeOf; diff --git a/x-pack/plugins/security_solution/common/endpoint/types/trusted_apps.ts b/x-pack/plugins/security_solution/common/endpoint/types/trusted_apps.ts index 3c854dbb7bd72..8d66370fea4d3 100644 --- a/x-pack/plugins/security_solution/common/endpoint/types/trusted_apps.ts +++ b/x-pack/plugins/security_solution/common/endpoint/types/trusted_apps.ts @@ -8,7 +8,6 @@ import { TypeOf } from '@kbn/config-schema'; import { ApplicationStart } from 'kibana/public'; -import { Entry } from '../../../../lists/common/schemas/types/entries'; import { DeleteTrustedAppsRequestSchema, GetOneTrustedAppRequestSchema, @@ -76,9 +75,10 @@ export enum OperatorFieldIds { matches = 'matches', } +export type TrustedAppEntryTypes = 'match' | 'wildcard'; export interface ConditionEntry { field: T; - type: Entry['type']; + type: TrustedAppEntryTypes; operator: 'included'; value: string; } diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/trusted_apps/mapping.test.ts b/x-pack/plugins/security_solution/server/endpoint/routes/trusted_apps/mapping.test.ts index 679058ad5f62f..9ee2ece627841 100644 --- a/x-pack/plugins/security_solution/server/endpoint/routes/trusted_apps/mapping.test.ts +++ b/x-pack/plugins/security_solution/server/endpoint/routes/trusted_apps/mapping.test.ts @@ -423,9 +423,7 @@ describe('mapping', () => { updated_at: '11/11/2011T11:11:11.111', updated_by: 'admin', os: OperatingSystem.WINDOWS, - entries: [ - createConditionEntry(ConditionEntryField.SIGNER, 'nested', 'Microsoft Windows'), - ], + entries: [createConditionEntry(ConditionEntryField.SIGNER, 'match', 'Microsoft Windows')], } ); }); diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/trusted_apps/mapping.ts b/x-pack/plugins/security_solution/server/endpoint/routes/trusted_apps/mapping.ts index 92f49026cd684..786a74e91b51a 100644 --- a/x-pack/plugins/security_solution/server/endpoint/routes/trusted_apps/mapping.ts +++ b/x-pack/plugins/security_solution/server/endpoint/routes/trusted_apps/mapping.ts @@ -9,7 +9,6 @@ import uuid from 'uuid'; import { OsType } from '../../../../../lists/common/schemas'; import { - Entry, EntriesArray, EntryMatch, EntryMatchWildcard, @@ -30,6 +29,7 @@ import { OperatingSystem, TrustedApp, UpdateTrustedApp, + TrustedAppEntryTypes, } from '../../../../common/endpoint/types'; type ConditionEntriesMap = { [K in ConditionEntryField]?: ConditionEntry }; @@ -56,7 +56,7 @@ const filterUndefined = (list: Array): T[] => { export const createConditionEntry = ( field: T, - type: Entry['type'], + type: TrustedAppEntryTypes, value: string ): ConditionEntry => { return { field, value, type, operator: OPERATOR_VALUE }; @@ -110,7 +110,7 @@ export const entriesToConditionEntriesMap = (entries: EntriesArray): ConditionEn ...result, [ConditionEntryField.SIGNER]: createConditionEntry( ConditionEntryField.SIGNER, - entry.type, + subjectNameCondition.type, subjectNameCondition.value ), };