Skip to content

Commit 02804d8

Browse files
yanivagmanrafaeldtinoco
authored andcommitted
capabilities: raise caps for init_namespaces event
The init_namespaces event requires SYS_PTRACE to function correctly.
1 parent 73273d2 commit 02804d8

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

pkg/ebpf/tracee.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1399,8 +1399,11 @@ func (t *Tracee) updateFileSHA() {
13991399

14001400
func (t *Tracee) invokeInitEvents() {
14011401
if t.events[events.InitNamespaces].emit {
1402-
systemInfoEvent := events.InitNamespacesEvent()
1403-
t.config.ChanEvents <- systemInfoEvent
1402+
t.capabilities.Requested(func() error { // ring2
1403+
systemInfoEvent := events.InitNamespacesEvent()
1404+
t.config.ChanEvents <- systemInfoEvent
1405+
return nil
1406+
}, cap.SYS_PTRACE)
14041407
t.stats.EventCount.Increment()
14051408
}
14061409
if t.events[events.ExistingContainer].emit {

0 commit comments

Comments
 (0)