-
Notifications
You must be signed in to change notification settings - Fork 919
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
rule(Change thread namespace): Modify condition to detect suspicious container activity #974
Conversation
Procedure Step
kubectl run malicious-container --restart=Never -ti --rm --image lol --overrides '{"spec":{"hostPID": true, "containers":[{"name":"1","image":"alpine","command":["sh"],"stdin": true,"tty":true,"securityContext":{"privileged":true}}]}}'
nsenter --mount=/proc/1/ns/mnt -- /bin/bash Sample Output
|
evt.type = setns | ||
and not proc.name in (docker_binaries, k8s_binaries, lxd_binaries, sysdigcloud_binaries, | ||
sysdig, nsenter, calico, oci-umount, network_plugin_binaries) | ||
evt.type=setns and evt.dir=< |
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 like this change.evt.dir=<
/lgtm |
LGTM label has been added. Git tree hash: c19ce5e70645012684c11623453c3f717782b2ef
|
I'll check why CI failed. |
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.
🚒
(hmm, I tried finding the reason to get error, but I haven't solved it yet) |
@mstemm can you please help? The rule changes might break the existing tests. It would be great that you can point us to the right place. Thanks! |
Closing and reopening this to let this test against the new CI |
oh, very sorry. I thought this was merged 🙇🙇. |
…container activity Signed-off-by: Hiroki Suezawa <[email protected]>
sysdig, nsenter, calico, oci-umount, cilium-cni, network_plugin_binaries) | ||
evt.type=setns and evt.dir=< | ||
and not (container.id=host and proc.name in (docker_binaries, k8s_binaries, lxd_binaries, nsenter)) | ||
and not proc.name in (sysdigcloud_binaries, sysdig, calico, oci-umount, cilium-cni, network_plugin_binaries) |
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.
This line was conflicted because of the PR (48a0f51), and I fixed the conflict.
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.
did you rebase?
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.
Yes, after I got needs-rebase label from poiana. The point I changed in first commit is to add cilium-cni.
Signed-off-by: Hiroki Suezawa <[email protected]>
Report on deep dive (why regression tests failed).Reason 1
Reason 2
|
LGTM label has been added. Git tree hash: 17f1406746d56ff07ee0721850368ffb50565b69
|
Good job as always @rung ! |
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.
🔥
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: fntlnz, Kaizhe, leodido The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/milestone 0.21.0 |
Signed-off-by: Hiroki Suezawa [email protected]
What type of PR is this?
/kind rule-update
Any specific area of the project related to this PR?
/area rules
What this PR does / why we need it:
What this PR does
Why we need it
k8s_binaries
,nsenter
nsenter
could be used to do privilege escalationalpine
by default)Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?: