[Security Solution] response action entity_id number -> string (#135037)

This commit is contained in:
Joey F. Poon 2022-06-23 14:28:03 -05:00 committed by GitHub
parent 61b5349d95
commit acfd0517a2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 6 deletions

View file

@ -213,7 +213,7 @@ describe('actions schemas', () => {
KillOrSuspendProcessRequestSchema.body.validate({ KillOrSuspendProcessRequestSchema.body.validate({
endpoint_ids: ['ABC-XYZ-000'], endpoint_ids: ['ABC-XYZ-000'],
parameters: { parameters: {
entity_id: 5678, entity_id: 'abc123',
}, },
}); });
}).not.toThrow(); }).not.toThrow();
@ -225,7 +225,7 @@ describe('actions schemas', () => {
endpoint_ids: ['ABC-XYZ-000'], endpoint_ids: ['ABC-XYZ-000'],
parameters: { parameters: {
pid: 1234, pid: 1234,
entity_id: 5678, entity_id: 'abc123',
}, },
}); });
}).toThrow(); }).toThrow();

View file

@ -27,7 +27,7 @@ export const KillOrSuspendProcessRequestSchema = {
...BaseActionRequestSchema, ...BaseActionRequestSchema,
parameters: schema.oneOf([ parameters: schema.oneOf([
schema.object({ pid: schema.number({ min: 1 }) }), schema.object({ pid: schema.number({ min: 1 }) }),
schema.object({ entity_id: schema.number({ min: 1 }) }), schema.object({ entity_id: schema.string({ minLength: 1 }) }),
]), ]),
}), }),
}; };

View file

@ -87,7 +87,7 @@ interface ResponseActionParametersWithPid {
interface ResponseActionParametersWithEntityId { interface ResponseActionParametersWithEntityId {
pid?: never; pid?: never;
entity_id: number; entity_id: string;
} }
export type ResponseActionParametersWithPidOrEntityId = export type ResponseActionParametersWithPidOrEntityId =

View file

@ -94,12 +94,12 @@ export default function ({ getService }: FtrProviderContext) {
{ {
method: 'post', method: 'post',
path: KILL_PROCESS_ROUTE, path: KILL_PROCESS_ROUTE,
body: { endpoint_ids: ['one'], parameters: { entity_id: 1234 } }, body: { endpoint_ids: ['one'], parameters: { entity_id: 'abc123' } },
}, },
{ {
method: 'post', method: 'post',
path: SUSPEND_PROCESS_ROUTE, path: SUSPEND_PROCESS_ROUTE,
body: { endpoint_ids: ['one'], parameters: { entity_id: 1234 } }, body: { endpoint_ids: ['one'], parameters: { entity_id: 'abc123' } },
}, },
]; ];