Skip to content
84 changes: 84 additions & 0 deletions custom_schemas/custom_ransomware.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
---
- name: Ransomware
title: Ransomware
group: 2
short: These fields contain information specific to ransomware alerts.
description: >
These fields contain information specific to ransomware alerts.
type: group
fields:
- name: feature
level: custom
type: keyword
description: Ransomware feature which triggered the alert.

- name: score
level: custom
type: double
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this need to be a double or could it be a smaller float? In your example @wburgess1 they only had one decimal places I think. Will that always be the case?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jonathan-buttner We typically require up to three decimal places at the moment

description: Total ransomware score for aggregated file events.

- name: version
level: custom
type: keyword
description: Ransomware artifact version.

- name: child_pids
level: custom
type: long
description: Array of child PIDs for ransomware which spawns numerous processes to handle encryption.
normalize:
- array
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does the normalize do here?

Copy link
Collaborator Author

@marshallmain marshallmain Oct 19, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't do anything for elasticsearch right now, but it's used in some ECS core fields as well for documentation that a field is expected to be an array.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah thanks!


- name: files
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we imagine the user searching across these files? Would we need to switch it to type: nested?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jonathan-buttner Yes, users would likely be interested in searching / scanning through this list to determine the extent of the breach. type: nested seems like it would be appropriate in this use case

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like if we can make it searchable it sounds like a good idea but not sure if that comes at a performance cost. Note that max number of objects will be 200, on average though its probs around ~50. @jonathan-buttner how would these numbers affect nested limitations ?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah so the advantage of nested is being able to query the objects in the array independently of each other, which is probably what we'd want to do. At endgame we ran into issues with nested objects because they have these limits by default:

https://www.elastic.co/guide/en/elasticsearch/reference/master/mapping.html#:~:text=Default%20is%2050%20.&text=The%20maximum%20number%20of%20nested,Default%20is%2010000%20.

image

https://www.elastic.co/guide/en/elasticsearch/reference/current/index-modules.html

image

If worst case is 200, I think we'll be fine.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@magermark Would users want to query for a specific alert based on files that are breached? Or would they only need be able to scan through the list of files after picking a specific alert based on other criteria? Even without nested they'll be able to see all the information in files once they are looking at a specific alert document.

The use case that nested enables is a query like "find ransomware alerts where a certain ransomed file had (property 1 AND property 2)".

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jared-day Do you have any opinion on the above? Is it desirable for users to be able to query for a specific file that may have been encrypted/affected?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@marshallmain that was the main use case @magermark and I were thinking about - a user may want to search for a specific file that may have been affected by this kind of incident (e.g. for incident response).

Is it easy to change this in the future? My view is still the same, if we can do it and it's fine performance wise then it makes sense to gives users as much flexibility as possible.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not easy to change the type of a field in the future so I went ahead and changed it to nested.

level: custom
type: nested
description: Information about each file event attributed to the ransomware. Expected to be an array.
normalize:
- array

- name: files.operation
level: custom
type: keyword
description: Operation applied to file.
Copy link
Contributor

@magermark magermark Oct 16, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wburgess1 Operation is string-based here. So I take it we'll need to map the file operation dword values to their string equivalents before forming the alert?

Copy link

@wburgess1 wburgess1 Oct 19, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@magermark operation is only ever one int value right? So this is fine just being a keyword and not say an array?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that's correct


- name: files.entropy
level: custom
type: double
description: Entropy of file contents.

- name: files.metrics
level: custom
type: keyword
description: Suspicious ransomware behaviours associated with the file event.
normalize:
- array

- name: files.extension
level: custom
type: keyword
description: File extension, excluding the leading dot.

- name: files.original.path
level: custom
type: keyword
description: Original file path prior to the file event.

- name: files.original.extension
level: custom
type: keyword
description: Original file extension prior to the file event.

- name: files.path
level: custom
type: keyword
description: Full path to the file, including the file name.

- name: files.data
level: custom
type: binary
description: File header or MBR bytes.

- name: files.score
level: custom
type: double
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same question here does this need to be a full double?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Up to three decimal places should suffice

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gotcha, if we wanted to save some space we could probably switch it to like a float or maybe even half_float I think:

https://www.elastic.co/guide/en/elasticsearch/reference/current/number.html#number

description: Ransomware score for this particular file event.
Loading