-
Notifications
You must be signed in to change notification settings - Fork 392
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
tetragon: harden actions a bit #3279
base: main
Are you sure you want to change the base?
Conversation
7b664dd
to
ab3513b
Compare
pkg/sensors/base/base.go
Outdated
threads := readFileDefault("/proc/sys/kernel/threads-max", 32768) | ||
ExecveMap.SetMaxEntries(int(threads)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need this? It seems it will make the size of the execve_map even larger as threads-max is often well above 32K. This will take significant space while running threads-max threads is pretty rare nop?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried this as mitigation for https://github.com/isovalent/security/issues/88 .. I think we need some combination of this change (with some reasonable size for execve_map) and other ways mentioned in the issue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah I see, maybe this is one of the cases where NO_PREALLOC could help so that we can dynamically size to a very large map. But I could see how this can lead to memory issues in the future. That's not an easy problem :/
c64e7e4
to
fcfa0a9
Compare
✅ Deploy Preview for tetragon ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
pkg/option/flags.go
Outdated
@@ -416,4 +419,6 @@ func AddFlags(flags *pflag.FlagSet) { | |||
flags.Int(KeyEventCacheRetryDelay, defaults.DefaultEventCacheRetryDelay, "Delay in seconds between event cache retries") | |||
|
|||
flags.Bool(KeyCompatibilitySyscall64SizeType, false, "syscall64 type will produce output of type size (compatibility flag, will be removed in v1.4)") | |||
|
|||
flags.String(KeyExecveMapEntries, "", "Set entries for execve_map table (default 32768)") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we have the default from the actual default value here? If we ever change it, the change should be reflected in help.
db51eba
to
44fdaa4
Compare
44fdaa4
to
6922611
Compare
b8b9d4e
to
bafb514
Compare
c349e11
to
6132585
Compare
Adding new 'unknown' value for flags field in the message Process. It will be used in following changes for process without details. Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Moving d_path into bpf_d_path.h header so it can be easily used in following changes from other places. Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Moving read_exe into process.h header so it can be easily used in following changes from other places. Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Setting flags early in the processing so in following changes the filter tail call can change it (which is executed before current flags setup code). Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Adding new filter logic that triggers when process is not found in execve_map (likely due to exhausted capacity). In this case we currently exit the bpf program and that might leave some crucial actions not executed (like sigkill). We add new event_find_curr_probe call to gather process info in filter context and use it to execute filters. The resulting kprobe event will have minimal process data with 'unknown' flags field. Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Adding test for unknown process kprobe kill. Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Adding test for unknown process tracepoint kill. Signed-off-by: Jiri Olsa <jolsa@kernel.org>
6132585
to
f6e5835
Compare
note the checkpatch fails on container_of macro which is false alarm |
Adding new filter logic that triggers when process is not found in
execve_map (likely due to exhausted capacity).
In this case we currently exit the bpf program and that might leave
some crucial actions not executed (like sigkill).
We add new event_find_curr_probe call to gather process info in filter
context and use it to execute filters. The resulting kprobe event will
have minimal process data with 'unknown' flags field.