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

Add file hash to exec events #225

Merged
merged 4 commits into from
Mar 20, 2024
Merged

Conversation

patrickpichler
Copy link
Contributor

This PR adds some basic infrastructure for adding various event enrichers. It also adds the first enricher in form of calculating a sha256 hash over executed files.

cmd/agent/daemon/enrichment/enrichers.go Show resolved Hide resolved
cmd/agent/daemon/enrichment/enrichers.go Outdated Show resolved Hide resolved
cmd/agent/daemon/enrichment/service.go Outdated Show resolved Hide resolved
cmd/agent/daemon/enrichment/enrichers.go Outdated Show resolved Hide resolved
cmd/agent/daemon/enrichment/service.go Show resolved Hide resolved
@patrickpichler patrickpichler force-pushed the feature/add-file-hash-to-events branch 3 times, most recently from e113bb6 to 3ef474e Compare March 12, 2024 10:10
@patrickpichler patrickpichler force-pushed the feature/add-file-hash-to-events branch from d5f99c9 to 88fac20 Compare March 13, 2024 09:52
@anjmao anjmao self-requested a review March 14, 2024 17:50
@patrickpichler patrickpichler force-pushed the feature/add-file-hash-to-events branch 8 times, most recently from e485793 to 199c666 Compare March 20, 2024 08:55
cmd/agent/daemon/app/app.go Outdated Show resolved Hide resolved
cmd/agent/daemon/app/app.go Outdated Show resolved Hide resolved
cmd/agent/daemon/app/app.go Outdated Show resolved Hide resolved
cmd/agent/daemon/enrichment/service.go Outdated Show resolved Hide resolved
pkg/bucketcache/bucketcache.go Outdated Show resolved Hide resolved
pkg/ebpftracer/tracer_decode.go Outdated Show resolved Hide resolved
pkg/ebpftracer/tracer_decode.go Outdated Show resolved Hide resolved
@patrickpichler patrickpichler force-pushed the feature/add-file-hash-to-events branch from 199c666 to 30cfd70 Compare March 20, 2024 12:33
cmd/agent/daemon/daemon.go Outdated Show resolved Hide resolved
@patrickpichler patrickpichler force-pushed the feature/add-file-hash-to-events branch 3 times, most recently from 641f751 to d5a5aa4 Compare March 20, 2024 13:56
With the enrichment service it is now possible to easily add event
enrichers, that run outside of the main event reporting hot loop. This
can be useful to e.g. calculate hashes for files, as the enrichment
process has multiple workers available.
Exec events now feature a sha256 hash field, of the executed binary.
File access is done via the `/proc` filesystem. In order to also catch
short living processes, kvisor also tries accessing the file via other
processes in the same mount namespace.

For this to work in virtualised environments, such as kind, kvisor now
also translates PIDs from the origin PID namespace, to the namespace it
is running in.
It is no longer feasable to run kvisor with `hostPID: false`, as various
features depend on this (e.g. the translation for container related PIDs).
Hence the option to configure it via the helm chart has been removed.

Additionally, the mount of the hosts `/proc` directory has also been
dropped, as it is no longer required.
@patrickpichler patrickpichler force-pushed the feature/add-file-hash-to-events branch from 80e0106 to c95014e Compare March 20, 2024 14:26
@patrickpichler patrickpichler merged commit f28361e into main Mar 20, 2024
2 checks passed
@patrickpichler patrickpichler deleted the feature/add-file-hash-to-events branch March 20, 2024 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants