[Security Solution][Endpoint] Fix Response Console not displaying the platform icon for non-Windows hosts when opened from an alert (#188030)

## Summary

- Fixes `useAlertResponseActionsSupport()` hook so that the OS platform
is retrieved from the alert's `host.os.type`
- Note: tests already exist to validate this, however, the mocks were
also incorrectly typed. Those are now corrected as well.
This commit is contained in:
Paul Tavares 2024-07-11 08:26:01 -04:00 committed by GitHub
parent 5df7bb87c0
commit 3b9ac48d57
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 8 deletions

View file

@ -184,7 +184,7 @@ export const useAlertResponseActionsSupport = (
);
}
return getAlertDetailsFieldValue({ category: 'host', field: 'host.os.family' }, eventData);
return getAlertDetailsFieldValue({ category: 'host', field: 'host.os.type' }, eventData);
}, [agentType, eventData]);
const unsupportedReason = useMemo(() => {

View file

@ -119,6 +119,13 @@ const generateEndpointAlertDetailsItemDataMock = (
{
category: 'host',
field: 'host.os.family',
values: ['Windows Server'],
originalValue: ['Windows Server'],
isObjectArray: false,
},
{
category: 'host',
field: 'host.os.type',
values: ['windows'],
originalValue: ['windows'],
isObjectArray: false,
@ -191,13 +198,6 @@ const generateCrowdStrikeAlertDetailsItemDataMock = (
originalValue: ['abfe4a35-d5b4-42a0-a539-bd054c791769'],
isObjectArray: false,
},
{
category: 'host',
field: 'host.os.type',
values: ['windows'],
originalValue: ['windows'],
isObjectArray: false,
},
{
category: 'host',
field: 'host.os.platform',