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

fix(engine): correctly format json output in json_event #1847

Merged
merged 1 commit into from
Jan 14, 2022

Conversation

jasondellaluce
Copy link
Contributor

@jasondellaluce jasondellaluce commented Jan 10, 2022

Signed-off-by: Jason Dellaluce jasondellaluce@gmail.com

What type of PR is this?

/kind bug

Any specific area of the project related to this PR?

/area engine

What this PR does / why we need it:

Due to the changes of #1715, json_event_formatter does not format events properly when the JSON output is enabled. This is caused by the return value not being propagated properly. This seems to be what caused the issues of #1845.

Which issue(s) this PR fixes:

Fixes #1845

Special notes for your reviewer:

This has been tested by building Falco locally from source. Running the following tests without the changes of this PR made me reproduce the issues of #1845, which now seem to be fixed.

mkdir build
cd build
cmake ..
make falco
userspace/falco/falco -r ../rules/k8s_audit_rules.yaml -e ../test/trace_files/k8s_audit/anonymous_creates_namespace_foo.json -o json_output=true

Does this PR introduce a user-facing change?:

fix(engine): correctly format json output in json_event

Signed-off-by: Jason Dellaluce <jasondellaluce@gmail.com>
Copy link
Member

@leogr leogr left a comment

Choose a reason for hiding this comment

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

Good catch! 👏

/approve

@poiana
Copy link

poiana commented Jan 10, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jasondellaluce, leogr

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [jasondellaluce,leogr]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@poiana
Copy link

poiana commented Jan 10, 2022

LGTM label has been added.

Git tree hash: c0d2363fa22c4c068ae76fd934ed89be24805644

@leogr
Copy link
Member

leogr commented Jan 10, 2022

/milestone 0.31.0
/cc @mstemm

@poiana poiana added this to the 0.31.0 milestone Jan 10, 2022
@poiana poiana merged commit 6bf8f34 into master Jan 14, 2022
@poiana poiana deleted the fix/k8s_audit-json-output branch January 14, 2022 12:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Null output_fields object in falco output for k8s audit events
5 participants