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

falco: fix dashboard visualisation and handling of event.original #11881

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
8 changes: 8 additions & 0 deletions packages/falco/changelog.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
# newer versions go on top
- version: "1.0.3"
changes:
- description: Add `event.original` for events forwarded from Falco Sidekick.
type: bugfix
link: https://github.com/elastic/integrations/pull/11881
- description: Use `host.name` for `Alerts by Host` visualization in Alerts Overview dashboard.
type: bugfix
link: https://github.com/elastic/integrations/pull/11881
- version: "1.0.2"
changes:
- description: Use triple-brace Mustache templating when referencing variables in ingest pipelines.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ processors:
tag: move_falco_fields
lang: painless
if: ctx?.output_fields != null
description: >
For events forwarded directly from Falco Sidekick, we need to adjust the event to the expected format by the pipeline.
params:
fields:
- uuid
Expand All @@ -36,7 +38,14 @@ processors:
ctx.remove(v);
}
}
ctx['falco'] = m
ctx['falco'] = m;
def original = ctx.falco.toString();
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think this is the right thing to do; toString gives a Java syntax representation of the value:

def a = [:];
a.a = 1;
a.b = 2;
a.c = "three";
a.toString();
{a=1, b=2, c=three}

We want something that renders the JSON. Json.dump works, though note that it does not canonicalise key order in my experience, so tests will be brittle.

def a = [:];
a.a = 1;
a.b = 2;
a.c = "three";
Json.dump(a);
{"a":1,"b":2,"c":"three"}

Copy link
Contributor

Choose a reason for hiding this comment

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

Alternatively, just retaining the actual original data.

if (original != null) {
if (ctx.event == null) {
ctx.event = new HashMap();
}
ctx.event.original = original;
}
Comment on lines +42 to +48
Copy link
Contributor

Choose a reason for hiding this comment

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

Make this depend on preserve_original_event?

- dot_expander:
field: 'container.image'
path: falco.output_fields
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@
"size": 10
},
"scale": "ordinal",
"sourceField": "host.hostname"
"sourceField": "host.name"
},
"95aa1257-f7d8-41c1-8dba-4fb75f70750f": {
"customLabel": true,
Expand Down Expand Up @@ -854,4 +854,4 @@
],
"type": "dashboard",
"typeMigrationVersion": "8.9.0"
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think this should change.

2 changes: 1 addition & 1 deletion packages/falco/manifest.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
format_version: 3.1.2
name: falco
title: Falco
version: 1.0.2
version: 1.0.3
description: Collect events and alerts from Falco using Elastic Agent
type: integration
categories:
Expand Down