Skip to content

Commit

Permalink
[Security Solution] bump isolation timeout to 5 minutes (elastic#108568
Browse files Browse the repository at this point in the history
…) (elastic#108744)

Co-authored-by: Joey F. Poon <[email protected]>
  • Loading branch information
kibanamachine and joeypoon authored Aug 16, 2021
1 parent bf61bcc commit cf65286
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ export interface EndpointAction {
input_type: 'endpoint';
agents: string[];
user_id: string;
// the number of seconds Elastic Agent (on the host) should
// wait to send back an action result before it will timeout
timeout?: number;
data: EndpointActionData;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,14 @@ describe('Host Isolation', () => {
actionID
);
});
it('records the timeout in the action payload', async () => {
const ctx = await callRoute(ISOLATE_HOST_ROUTE, {
body: { endpoint_ids: ['XYZ'] },
});
const actionDoc: EndpointAction = (ctx.core.elasticsearch.client.asCurrentUser
.index as jest.Mock).mock.calls[0][0].body;
expect(actionDoc.timeout).toEqual(300);
});

it('succeeds when just an endpoint ID is provided', async () => {
await callRoute(ISOLATE_HOST_ROUTE, { body: { endpoint_ids: ['XYZ'] } });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ export const isolationRequestHandler = function (
input_type: 'endpoint',
agents: endpointData.map((endpt: HostMetadata) => endpt.elastic.agent.id),
user_id: user!.username,
timeout: 300, // 5 minutes
data: {
command: isolate ? 'isolate' : 'unisolate',
comment: req.body.comment ?? undefined,
Expand Down

0 comments on commit cf65286

Please sign in to comment.