[EDR Workflows] Remove usage of _source in automated response actions (#162316)

This commit is contained in:
Tomasz Ciecierski 2023-07-20 15:53:52 +02:00 committed by GitHub
parent a190b3f2ab
commit 1a300e31bb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 3 deletions

View file

@ -124,11 +124,9 @@ export const useGetAutomatedActionResponseList = (
)
);
const action = responseData.edges[0]?._source;
return {
action_id: actionId,
completedAt: action?.EndpointActions.completed_at,
completedAt: responseData.edges[0]?.fields?.['EndpointActions.completed_at']?.[0],
isExpired: responseData.isExpired,
wasSuccessful: responseData.wasSuccessful,
isCompleted: responseData.isCompleted,

View file

@ -34,6 +34,7 @@ export const buildResponseActionsQuery = (
ignore_unavailable: true,
body: {
fields,
_source: false,
query: {
bool: {
minimum_should_match: 2,

View file

@ -13,10 +13,13 @@ export const buildActionResultsQuery = ({
actionId,
sort,
}: ActionResponsesRequestOptions): ISearchRequestParams => {
const fields = [{ field: '*' }, { field: 'EndpointActions.*', include_unmapped: true }];
const dslQuery = {
allow_no_indices: true,
index: [ENDPOINT_ACTION_RESPONSES_INDEX],
body: {
fields,
_source: false,
size: 1,
query: {
term: { action_id: actionId },