Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Security Solution] Adding aggregations for endpoint events #72705

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
142 changes: 126 additions & 16 deletions x-pack/plugins/security_solution/server/lib/overview/query.dsl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,57 +142,167 @@ export const buildOverviewHostQuery = ({
},
endgame_module: {
filter: {
term: {
'event.module': 'endgame',
bool: {
should: [
{
term: { 'event.module': 'endpoint' },
},
{
term: {
'event.module': 'endgame',
},
},
],
},
},
aggs: {
dns_event_count: {
filter: {
term: {
'endgame.event_type_full': 'dns_event',
bool: {
should: [
{
bool: {
filter: [
{ term: { 'network.protocol': 'dns' } },
{ term: { 'event.category': 'network' } },
],
},
},
{
term: {
'endgame.event_type_full': 'dns_event',
},
},
],
},
},
},
file_event_count: {
filter: {
term: {
'endgame.event_type_full': 'file_event',
bool: {
should: [
{
term: {
'event.category': 'file',
},
},
{
term: {
'endgame.event_type_full': 'file_event',
},
},
],
},
},
},
image_load_event_count: {
filter: {
term: {
'endgame.event_type_full': 'image_load_event',
bool: {
should: [
{
bool: {
should: [
{
term: {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We're treating library and driver events as image load.

'event.category': 'library',
},
},
{
term: {
'event.category': 'driver',
},
},
],
},
},
{
term: {
'endgame.event_type_full': 'image_load_event',
},
},
],
},
},
},
network_event_count: {
filter: {
term: {
'endgame.event_type_full': 'network_event',
bool: {
should: [
{
bool: {
filter: [
{
bool: {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Network is anything but dns

must_not: {
term: { 'network.protocol': 'dns' },
},
},
},
{
term: { 'event.category': 'network' },
},
],
},
},
{
term: {
'endgame.event_type_full': 'network_event',
},
},
],
},
},
},
process_event_count: {
filter: {
term: {
'endgame.event_type_full': 'process_event',
bool: {
should: [
{
term: { 'event.category': 'process' },
},
{
term: {
'endgame.event_type_full': 'process_event',
},
},
],
},
},
},
registry_event: {
filter: {
term: {
'endgame.event_type_full': 'registry_event',
bool: {
should: [
{
term: { 'event.category': 'registry' },
},
{
term: {
'endgame.event_type_full': 'registry_event',
},
},
],
},
},
},
security_event_count: {
filter: {
term: {
'endgame.event_type_full': 'security_event',
bool: {
should: [
{
bool: {
filter: [
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Security events for endpoint should be an array of two values for event.category == [session, authentication]

{ term: { 'event.category': 'session' } },
{ term: { 'event.category': 'authentication' } },
],
},
},
{
term: {
'endgame.event_type_full': 'security_event',
},
},
],
},
},
},
Expand Down