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

Conversation

chemamartinez
Copy link
Contributor

Proposed commit message

Falco assets are not only used for the integration itself. They are also used by users that want to ingest Falco alerts directly into Elasticsearch through Falco Sidekick (more information at https://www.elastic.co/blog/cncf-open-source-security-tools).

This PR adds event.original to events directly ingested from Falco Sidekick.

It also updates the Alerts by Host visualisation to rely on the host.name instead of host.hostname.

Checklist

  • I have reviewed tips for building integrations and this pull request is aligned with them.
  • I have verified that all data streams collect metrics or logs.
  • I have added an entry to my package's changelog.yml file.
  • I have verified that Kibana version constraints are current according to guidelines.
  • I have verified that any added dashboard complies with Kibana's Dashboard good practices

Related issues

Screenshots

image

image

@chemamartinez chemamartinez added dashboard Relates to a Kibana dashboard bug, enhancement, or modification. bugfix Pull request that fixes a bug issue Team:Security-Service Integrations Security Service Integrations Team [elastic/security-service-integrations] Integration:falco Falco labels Nov 26, 2024
@chemamartinez chemamartinez self-assigned this Nov 26, 2024
@chemamartinez chemamartinez marked this pull request as ready for review November 26, 2024 15:49
@chemamartinez chemamartinez requested a review from a team as a code owner November 26, 2024 15:49
@elasticmachine
Copy link

Pinging @elastic/security-service-integrations (Team:Security-Service Integrations)

@elastic-vault-github-plugin-prod

🚀 Benchmarks report

To see the full report comment with /test benchmark fullreport

@elasticmachine
Copy link

💚 Build Succeeded

History

cc @chemamartinez

@chemamartinez chemamartinez enabled auto-merge (squash) November 26, 2024 18:11
Copy link
Contributor

@efd6 efd6 left a comment

Choose a reason for hiding this comment

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

Can we add a test case for this?

}
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.

Comment on lines +42 to +48
def original = ctx.falco.toString();
if (original != null) {
if (ctx.event == null) {
ctx.event = new HashMap();
}
ctx.event.original = original;
}
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?

@@ -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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix Pull request that fixes a bug issue dashboard Relates to a Kibana dashboard bug, enhancement, or modification. Integration:falco Falco Team:Security-Service Integrations Security Service Integrations Team [elastic/security-service-integrations]
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Falco]: Dashboard seems to be broken
3 participants