Skip to content

Commit f96e507

Browse files
[Security Solution] Correct memory exception field names (#110705) (#110742)
Co-authored-by: Kevin Logan <56395104+kevinlog@users.noreply.github.com>
1 parent 5d0065f commit f96e507

File tree

7 files changed

+18
-131
lines changed

7 files changed

+18
-131
lines changed

x-pack/plugins/security_solution/common/ecs/event/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export enum EventCode {
5353
// Memory Protection alert
5454
MEMORY_SIGNATURE = 'memory_signature',
5555
// Memory Protection alert
56-
MALICIOUS_THREAD = 'malicious_thread',
56+
SHELLCODE_THREAD = 'shellcode_thread',
5757
// behavior
5858
BEHAVIOR = 'behavior',
5959
}

x-pack/plugins/security_solution/common/endpoint/generate_data.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -678,7 +678,7 @@ export class EndpointDocGenerator extends BaseDataGenerator {
678678
action: 'start',
679679
kind: 'alert',
680680
category: 'malware',
681-
code: isShellcode ? 'malicious_thread' : 'memory_signature',
681+
code: isShellcode ? 'shellcode_thread' : 'memory_signature',
682682
id: this.seededUUIDv4(),
683683
dataset: 'endpoint',
684684
module: 'endpoint',

x-pack/plugins/security_solution/public/common/components/event_details/alert_summary_view.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ describe('AlertSummaryView', () => {
8686
return {
8787
category: 'event',
8888
field: 'event.code',
89-
values: ['malicious_thread'],
90-
originalValue: ['malicious_thread'],
89+
values: ['shellcode_thread'],
90+
originalValue: ['shellcode_thread'],
9191
};
9292
}
9393
return item;

x-pack/plugins/security_solution/public/common/components/event_details/alert_summary_view.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ function getEventFieldsToDisplay({
157157
}): EventSummaryField[] {
158158
switch (eventCode) {
159159
// memory protection fields
160-
case EventCode.MALICIOUS_THREAD:
160+
case EventCode.SHELLCODE_THREAD:
161161
return memoryShellCodeAlertFields;
162162
case EventCode.MEMORY_SIGNATURE:
163163
return memorySignatureAlertFields;

x-pack/plugins/security_solution/public/common/components/exceptions/exceptionable_endpoint_fields.json

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@
1919
"Target.process.pe.original_file_name",
2020
"Target.process.pe.product",
2121
"Target.process.pgid",
22-
"Target.process.thread.Ext.start_address_details.allocation_type",
22+
"Target.process.Ext.memory_region.allocation_type",
2323
"Target.process.thread.Ext.start_address_bytes_disasm_hash",
2424
"Target.process.thread.Ext.start_address_allocation_offset",
25-
"Target.process.thread.Ext.start_address_details.allocation_size",
26-
"Target.process.thread.Ext.start_address_details.region_size",
27-
"Target.process.thread.Ext.start_address_details.region_protection",
28-
"Target.process.thread.Ext.start_address_details.memory_pe.imphash",
25+
"Target.process.Ext.memory_region.allocation_size",
26+
"Target.process.Ext.memory_region.region_size",
27+
"Target.process.Ext.memory_region.region_protection",
28+
"Target.process.Ext.memory_region.memory_pe.imphash",
2929
"Target.process.thread.Ext.start_address_bytes",
3030
"agent.id",
3131
"agent.type",
@@ -82,6 +82,8 @@
8282
"process.Ext.services",
8383
"process.Ext.user",
8484
"process.Ext.code_signature",
85+
"process.Ext.token.integrity_level_name",
86+
"process.Ext.memory_region.malware_signature.all_names",
8587
"process.executable",
8688
"process.hash.md5",
8789
"process.hash.sha1",

x-pack/plugins/security_solution/public/common/components/exceptions/helpers.test.tsx

Lines changed: 4 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -1031,7 +1031,7 @@ describe('Exception helpers', () => {
10311031
]);
10321032
});
10331033

1034-
test('it should return pre-populated memory shellcode items for event code `malicious_thread`', () => {
1034+
test('it should return pre-populated memory shellcode items for event code `shellcode_thread`', () => {
10351035
const defaultItems = defaultEndpointExceptionItems('list_id', 'my_rule', {
10361036
_id: '123',
10371037
process: {
@@ -1049,7 +1049,7 @@ describe('Exception helpers', () => {
10491049
self_injection: true,
10501050
},
10511051
event: {
1052-
code: 'malicious_thread',
1052+
code: 'shellcode_thread',
10531053
},
10541054
Target: {
10551055
process: {
@@ -1108,52 +1108,10 @@ describe('Exception helpers', () => {
11081108
value: 'high',
11091109
id: '123',
11101110
},
1111-
{
1112-
field: 'Target.process.thread.Ext.start_address_details',
1113-
type: 'nested',
1114-
entries: [
1115-
{
1116-
field: 'allocation_type',
1117-
operator: 'included',
1118-
type: 'match',
1119-
value: 'PRIVATE',
1120-
id: '123',
1121-
},
1122-
{
1123-
field: 'allocation_size',
1124-
operator: 'included',
1125-
type: 'match',
1126-
value: '4000',
1127-
id: '123',
1128-
},
1129-
{
1130-
field: 'region_size',
1131-
operator: 'included',
1132-
type: 'match',
1133-
value: '4000',
1134-
id: '123',
1135-
},
1136-
{
1137-
field: 'region_protection',
1138-
operator: 'included',
1139-
type: 'match',
1140-
value: 'RWX',
1141-
id: '123',
1142-
},
1143-
{
1144-
field: 'memory_pe.imphash',
1145-
operator: 'included',
1146-
type: 'match',
1147-
value: 'a hash',
1148-
id: '123',
1149-
},
1150-
],
1151-
id: '123',
1152-
},
11531111
]);
11541112
});
11551113

1156-
test('it should return pre-populated memory shellcode items for event code `malicious_thread` and skip empty', () => {
1114+
test('it should return pre-populated memory shellcode items for event code `shellcode_thread` and skip empty', () => {
11571115
const defaultItems = defaultEndpointExceptionItems('list_id', 'my_rule', {
11581116
_id: '123',
11591117
process: {
@@ -1171,7 +1129,7 @@ describe('Exception helpers', () => {
11711129
self_injection: true,
11721130
},
11731131
event: {
1174-
code: 'malicious_thread',
1132+
code: 'shellcode_thread',
11751133
},
11761134
Target: {
11771135
process: {
@@ -1217,41 +1175,6 @@ describe('Exception helpers', () => {
12171175
value: 'high',
12181176
id: '123',
12191177
},
1220-
{
1221-
field: 'Target.process.thread.Ext.start_address_details',
1222-
type: 'nested',
1223-
entries: [
1224-
{
1225-
field: 'allocation_size',
1226-
operator: 'included',
1227-
type: 'match',
1228-
value: '4000',
1229-
id: '123',
1230-
},
1231-
{
1232-
field: 'region_size',
1233-
operator: 'included',
1234-
type: 'match',
1235-
value: '4000',
1236-
id: '123',
1237-
},
1238-
{
1239-
field: 'region_protection',
1240-
operator: 'included',
1241-
type: 'match',
1242-
value: 'RWX',
1243-
id: '123',
1244-
},
1245-
{
1246-
field: 'memory_pe.imphash',
1247-
operator: 'included',
1248-
type: 'match',
1249-
value: 'a hash',
1250-
id: '123',
1251-
},
1252-
],
1253-
id: '123',
1254-
},
12551178
]);
12561179
});
12571180
});

x-pack/plugins/security_solution/public/common/components/exceptions/helpers.tsx

Lines changed: 2 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,7 @@ export const getPrepopulatedMemoryShellcodeException = ({
577577
eventCode: string;
578578
alertEcsData: Flattened<Ecs>;
579579
}): ExceptionsBuilderExceptionItem => {
580-
const { process, Target } = alertEcsData;
580+
const { process } = alertEcsData;
581581
const entries = filterEmptyExceptionEntries([
582582
{
583583
field: 'Memory_protection.feature',
@@ -609,44 +609,6 @@ export const getPrepopulatedMemoryShellcodeException = ({
609609
type: 'match' as const,
610610
value: process?.Ext?.token?.integrity_level_name ?? '',
611611
},
612-
{
613-
field: 'Target.process.thread.Ext.start_address_details',
614-
type: 'nested' as const,
615-
entries: [
616-
{
617-
field: 'allocation_type',
618-
operator: 'included' as const,
619-
type: 'match' as const,
620-
value: Target?.process?.thread?.Ext?.start_address_details?.allocation_type ?? '',
621-
},
622-
{
623-
field: 'allocation_size',
624-
operator: 'included' as const,
625-
type: 'match' as const,
626-
value: String(Target?.process?.thread?.Ext?.start_address_details?.allocation_size) ?? '',
627-
},
628-
{
629-
field: 'region_size',
630-
operator: 'included' as const,
631-
type: 'match' as const,
632-
value: String(Target?.process?.thread?.Ext?.start_address_details?.region_size) ?? '',
633-
},
634-
{
635-
field: 'region_protection',
636-
operator: 'included' as const,
637-
type: 'match' as const,
638-
value:
639-
String(Target?.process?.thread?.Ext?.start_address_details?.region_protection) ?? '',
640-
},
641-
{
642-
field: 'memory_pe.imphash',
643-
operator: 'included' as const,
644-
type: 'match' as const,
645-
value:
646-
String(Target?.process?.thread?.Ext?.start_address_details?.memory_pe?.imphash) ?? '',
647-
},
648-
],
649-
},
650612
]);
651613

652614
return {
@@ -845,7 +807,7 @@ export const defaultEndpointExceptionItems = (
845807
alertEcsData,
846808
}),
847809
];
848-
case 'malicious_thread':
810+
case 'shellcode_thread':
849811
return [
850812
getPrepopulatedMemoryShellcodeException({
851813
listId,

0 commit comments

Comments
 (0)