8000 fix for kernels v6.3 and mitigation for tracee.pid in tests by rafaeldtinoco · Pull Request #3076 · aquasecurity/tracee · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix for kernels v6.3 and mitigation for tracee.pid in tests #3076

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

Merged
merged 6 commits into from
May 9, 2023
Merged

fix for kernels v6.3 and mitigation for tracee.pid in tests #3076

merged 6 commits into from
May 9, 2023

Conversation

rafaeldtinoco
Copy link
Contributor
@rafaeldtinoco rafaeldtinoco commented May 9, 2023

commit cea89a6 (HEAD -> include-v6, rafaeldtinoco/include-v6)
Author: Rafael David Tinoco rafaeldtinoco@gmail.com
Date: Mon May 8 23:45:33 2023

workflow: enable v6.1 and v6.3 tests after fix

commit f45cc1b
Author: Rafael David Tinoco rafaeldtinoco@gmail.com
Date: Mon May 8 23:42:07 2023

ebpf: CO-RE: deal with new kernel_cap_t type

commit 5752060
Author: Rafael David Tinoco rafaeldtinoco@gmail.com
Date: Mon May 8 12:54:31 2023

workflow: fix debug-shell job name

commit 6aee729
Author: Rafael David Tinoco rafaeldtinoco@gmail.com
Date: Mon May 8 12:53:06 2023

tests: cleanup tracee.pid in case not cleaned

The only change that isn't chore is the change that fixes v6.3 kernels (commit f45cc1b) and the way to test it:

test case

#### command 01

$ sudo ./dist/tracee --output json --filter event=com
mit_creds --filter comm=capsh

#### command 02

$ sudo capsh --drop=cap_sys_admin -- -c 'sleep 1000'

#### command 03

$ sudo cat /proc/$(pidof sleep)/status | grep ^Cap
CapInh: 0000000000000000
CapPrm: 000001ffffdfffff
CapEff: 000001ffffdfffff
CapBnd: 000001ffffdfffff
CapAmb: 0000000000000000

in a v6.3.1 kernel (vanilla upstream)

{"timestamp":1683599572209837155,"threadStartTime":1683599572207592072,"processorId":12,"processId":1645572,"cgroupId":6255,"threadId":1645572,"parentProcessId":1645571,"hostProcessId":1645572,"hostThreadId":1645572,"hostParentProcessId":1645571,"userId":0,"mountNamespace":4026531841,"pidNamespace":4026531836,"processName":"capsh","hostName":"fujitsu","container":{},"kubernetes":{},"eventId":"723","eventName":"commit_creds","matchedPolicies":[""],"argsNum":2,"returnValue":0,"syscall":"prctl","stackAddresses":null,"contextFlags":{"containerStarted":false,"isCompat":false},"args":[{"name":"old_cred","type":"slim_cred_t","value":{"Uid":0,"Gid":0,"Suid":0,"Sgid":0,"Euid":0,"Egid":0,"Fsuid":0,"Fsgid":0,"UserNamespace":4026531837,"SecureBits":0,"CapInheritable":0,"CapPermitted":2199023255551,"CapEffective":2199023255551,"CapBounding":2199023255551,"CapAmbient":0}},{"name":"new_cred","type":"slim_cred_t","value":{"Uid":0,"Gid":0,"Suid":0,"Sgid":0,"Euid":0,"Egid":0,"Fsuid":0,"Fsgid":0,"UserNamespace":4026531837,"SecureBits":0,"CapInheritable":0,"CapPermitted":2199023255551,"CapEffective":2199023255551,"CapBounding":2199021158399,"CapAmbient":0}}]}

in a 5.15.0-69-generic kernel (ubuntu flavored)

{"timestamp":1683599381252829883,"threadStartTime":1683599381250171936,"processorId":5,"processId":2981,"cgroupId":4098,"threadId":2981,"parentProcessId":2980,"hostProcessId":2981,"hostThreadId":2981,"hostParentProcessId":2980,"userId":0,"mountNamespace":4026531841,"pidNamespace":4026531836,"processName":"capsh","hostName":"e2etests","container":{},"kubernetes":{},"eventId":"723","eventName":"commit_creds","matchedPolicies":[""],"argsNum":2,"returnValue":0,"syscall":"prctl","stackAddresses":null,"contextFlags":{"containerStarted":false,"isCompat":false},"args":[{"name":"old_cred","type":"slim_cred_t","value":{"Uid":0,"Gid":0,"Suid":0,"Sgid":0,"Euid":0,"Egid":0,"Fsuid":0,"Fsgid":0,"UserNamespace":4026531837,"SecureBits":0,"CapInheritable":0,"CapPermitted":2199023255551,"CapEffective":2199023255551,"CapBounding":2199023255551,"CapAmbient":0}},{"name":"new_cred","type":"slim_cred_t","value":{"Uid":0,"Gid":0,"Suid":0,"Sgid":0,"Euid":0,"Egid":0,"Fsuid":0,"Fsgid":0,"UserNamespace":4026531837,"SecureBits":0,"CapInheritable":0,"CapPermitted":2199023255551,"CapEffective":2199023255551,"CapBounding":2199021158399,"CapAmbient":0}}]}

@rafaeldtinoco rafaeldtinoco changed the title Include v6 fix for kernels v6.3 and mitigation for tracee.pid in tests May 9, 2023
@rafaeldtinoco rafaeldtinoco linked an issue May 9, 2023 that may be closed by this pull request
@rafaeldtinoco
Copy link
Contributor Author

This is ready for review. The only thing having errors in v6.1 and v6.3 kernels is the e2e instrumentation tests for file_modification event (opened #3077 for that issue).

I don't see why not merging this one (if you agree) because then the tests will get fixed once that PR is merged (hopefully).

Copy link
Member
@geyslan geyslan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@rafaeldtinoco
Copy link
Contributor Author

image

I have opened an issue for the failing tests. All the rest (in this PR) is good.

Updating urfave brought some issues with cmdline parsing. Usually we
would fix them but, since urfave is being deprecated, it is just easier
to keep urfave version until then.

Fixes broken "magic_write_filter" parsing.
@rafaeldtinoco rafaeldtinoco merged commit 9fc6a83 into aquasecurity:main May 9, 2023
@rafaeldtinoco rafaeldtinoco deleted the include-v6 branch May 9, 2023 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

tracee won't run in kernels v6.3 from stable tree
3 participants
0