falco icon indicating copy to clipboard operation
falco copied to clipboard

wip: new(metrics): add file sha256sum metrics for loaded config and rules files

Open incertum opened this issue 2 months ago • 4 comments

What type of PR is this?

Uncomment one (or more) /kind <> lines:

/kind bug

/kind cleanup

/kind design

/kind documentation

/kind failing-test

/kind feature

/kind release

Any specific area of the project related to this PR?

Uncomment one (or more) /area <> lines:

/area build

/area engine

/area tests

/area proposals

/area CI

What this PR does / why we need it:

This PR adds the sha256sum for each loaded config and rules file as individual metric. These metrics complement existing informational metrics such as the Falco version or kernelrelease of the host and especially help to track deployment upgrade convergence and integrity.

Note: This PR only adds the new metrics, thus deferring future metrics code consolidations to the next release dev cycle.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

new(metrics): add file sha256sum metrics for loaded config and rules files

incertum avatar May 08 '24 12:05 incertum

This PR may bring feature or behavior changes in the Falco engine and may require the engine version to be bumped.

Please double check userspace/engine/falco_engine_version.h file. See versioning for FALCO_ENGINE_VERSION.

/hold

github-actions[bot] avatar May 08 '24 12:05 github-actions[bot]

/milestone 0.38.0

incertum avatar May 08 '24 12:05 incertum

This is now ready for review.

incertum avatar May 09 '24 16:05 incertum

Question: why is all of this linux only?

Main purpose of metrics is at runtime when running Falco on Linux. I am not sure why we would need it when we load a capture file on macOS or Windows. In addition, most metrics already only work on Linux. More thoughts?

Support for macOS or Windows likely requires a different approach as that openssl lib I am using is not available.

incertum avatar May 10 '24 07:05 incertum

I was thinking if running Falco on eg: windows with plugins and their rules, one could still want the shasums in the metrics.

Support for macOS or Windows likely requires a different approach as that openssl lib I am using is not available.

No problem then, we can introduce it later if someone needs it!

FedeDP avatar May 10 '24 07:05 FedeDP

I was thinking if running Falco on eg: windows with plugins and their rules, one could still want the shasums in the metrics.

Support for macOS or Windows likely requires a different approach as that openssl lib I am using is not available.

No problem then, we can introduce it later if someone needs it!

Yeah, right now it's actually not even working well for plugins only even on Linux. Needless to say, metrics still requires lots of work over the next n releases.

incertum avatar May 10 '24 07:05 incertum

LGTM label has been added.

Git tree hash: dcb2a70aa3d6111480fd1c016a4db4f24a8b665d

poiana avatar May 10 '24 08:05 poiana

CI Build / test-dev-packages / test-packages (pull_request) Failing after 4m

I am investigating the TestFalco_Legacy_KernelUpgrade failure since it also fails on https://github.com/falcosecurity/falco/pull/3191

FedeDP avatar May 13 '24 08:05 FedeDP

LGTM label has been added.

Git tree hash: dc0266cc27417ce5e855648589ac81944db7ea34

poiana avatar May 13 '24 21:05 poiana

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: FedeDP, incertum, 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~~ [FedeDP,incertum,leogr]

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

poiana avatar May 14 '24 08:05 poiana

This PR may bring feature or behavior changes in the Falco engine and may require the engine version to be bumped.

Please double check userspace/engine/falco_engine_version.h file. See versioning for FALCO_ENGINE_VERSION.

/hold

false positive /unhold

leogr avatar May 14 '24 08:05 leogr