Skip to content

new(userspace): static fields #3557

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

new(userspace): static fields #3557

wants to merge 2 commits into from

Conversation

FedeDP
Copy link
Contributor

@FedeDP FedeDP commented May 15, 2025

What type of PR is this?

/kind feature

Any specific area of the project related to this PR?

/area engine

What this PR does / why we need it:

The PR adds a new static_fields configuration object; each {key,value} pair will be used as static field that will be automatically appended to the output (if append_output.suggested_output is enabled), and can be used as rule condition.

Which issue(s) this PR fixes:

Fixes #3554

Special notes for your reviewer:

This PR depends upon falcosecurity/libs#2405, keeping this wip until that PR is merged.

Does this PR introduce a user-facing change?:

new(userspace): static fields

@poiana
Copy link
Contributor

poiana commented May 15, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: FedeDP

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:

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

@poiana poiana requested review from Kaizhe and leogr May 15, 2025 08:49
@poiana poiana added the size/M label May 15, 2025
@FedeDP
Copy link
Contributor Author

FedeDP commented May 15, 2025

/milestone 0.42.0

@poiana poiana added this to the 0.42.0 milestone May 15, 2025
@FedeDP
Copy link
Contributor Author

FedeDP commented May 15, 2025

CI build-dev is failing because it uses yaml-cpp from the system that is too old and does not support as<std::unoredered_map<>>: jbeder/yaml-cpp#932
I think we should actually enforce the bundle yaml-cpp for that CI (that yaml-cpp version is also hit by jbeder/yaml-cpp#1318 and jbeder/yaml-cpp#1319)

EDIT: fixed by porting the code to use a std::map.

@FedeDP
Copy link
Contributor Author

FedeDP commented May 15, 2025

Example rule output with:

static_fields:
  foo: bar
  foo2: ${HOME}

👇

11:01:07.833224783: Notice A shell was spawned in a container with an attached terminal | evt_type=execve user=root user_uid=0 user_loginuid=-1 process=bash proc_exepath=/usr/bin/bash parent=containerd-shim command=bash terminal=34816 exe_flags=EXE_WRITABLE|EXE_LOWER_LAYER container_id=0f361b374116 container_name=compassionate_antonelli container_image_repository=ubuntu container_image_tag=24.04 k8s_pod_name=<NA> k8s_ns_name=<NA> static_foo2=/root static_foo=bar

@FedeDP
Copy link
Contributor Author

FedeDP commented Jun 3, 2025

Relevant PRs have been merged in libs master; once #3592 is merged i will rebase this one and get it ready.

@FedeDP FedeDP force-pushed the new/static_fields branch from 6c114e3 to 3ba10c4 Compare June 3, 2025 09:14
@poiana poiana added size/S and removed size/M labels Jun 3, 2025
@FedeDP FedeDP changed the title wip: new(userspace): static fields new(userspace): static fields Jun 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

Static event fields for falco daemonsets
2 participants