Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR reshuffles the capability detection flow after an analysis performed. In a nutshell, we don't need anything but
CAP_BPF
andCAP_NET_RAW
for network observability using socket filters.Also,
CAP_NET_ADMIN
does not implyCAP_NET_RAW
, so that is fixed as well.The entire list of capabilities per tracer is as follow:
Socket flow fetcher
CAP_BPF
-> forBPF_PROG_TYPE_SOCK_FILTER
CAP_NET_RAW
-> for creatingAF_PACKET
socketFlow fetcher (tc)
CAP_BPF
CAP_NET_ADMIN
-> forPROG_TYPE_SCHED_CLS
CAP_PERFMON
-> direct access tostruct __sk_buff::data
and pointer arithmeticWatcher
CAP_BPF
CAP_CHECKPOINT_RESTORE
CAP_DAC_READ_SEARCH
-> access to/proc/self/mem
to determine kernel versionCAP_PERFMON
-> forBPF_PROG_TYPE_KPROBE
Generic tracer
CAP_BPF
CAP_DAC_READ_SEARCH
CAP_CHECKPOINT_RESTORE
CAP_PERFMON
CAP_NET_RAW
-> for creatingAF_PACKET
socket used bybeyla_socket__http_filter
CAP_SYS_PTRACE
-> access to/proc/pid/exe
and other nodes in/proc
TC tracers
CAP_BPF
CAP_DAC_READ_SEARCH
CAP_PERFMON
CAP_NET_ADMIN
-> forBPF_PROG_TYPE_SCHED_CLS
,BPF_PROG_TYPE_SOCK_OPS
andBPF_PROG_TYPE_SK_MSG
GO tracer
CAP_BPF
CAP_DAC_READ_SEARCH
CAP_CHECKPOINT_RESTORE
CAP_PERFMON
CAP_NET_RAW
-> for creatingAF_PACKET
socket used bybeyla_socket__http_filter
CAP_SYS_PTRACE
-> access to/proc/pid/exe
and other nodes in/proc
CAP_SYS_ADMIN
-> for probe based (bpf_probe_write_user()
) library level context propagation