-
Notifications
You must be signed in to change notification settings - Fork 912
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
rules: detect pods sharing host pid and IPC namespaces #1951
Conversation
/cc @Kaizhe |
rules/k8s_audit_rules.yaml
Outdated
@@ -174,6 +174,22 @@ | |||
source: k8s_audit | |||
tags: [k8s] | |||
|
|||
- rule: Create HostPid Pod | |||
desc: Detect an attempt to start a pod using the host pid namespace. | |||
condition: kevt and pod and kcreate and ka.req.pod.host_pid intersects (true) |
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 you add an exception list ? e.g. falco_hostpid_images
and user_known_hostpid_images
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.
Hi @Kaizhe, I have added an empty list for both rules. If you have any suggestions on how to find out non-malicious images that make use of these namespaces to work, let me know! Thank you
rules/k8s_audit_rules.yaml
Outdated
|
||
- rule: Create HostIPC Pod | ||
desc: Detect an attempt to start a pod using the host ipc namespace. | ||
condition: kevt and pod and kcreate and ka.req.pod.host_ipc intersects (true) |
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.
similar above
/milestone 0.32.0 |
…PC namespaces Signed-off-by: Lorenzo Susini <susinilorenzo1@gmail.com>
eeeef1a
to
68e64f7
Compare
LGTM label has been added. Git tree hash: 6896a83235b7cd37c786a3d85f40769f8099fd64
|
Closing and reopening to trigger the CI |
@leogr: Closed this PR. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/reopen |
@leogr: Reopened this PR. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
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.
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: leogr, loresuso 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 |
What type of PR is this?
/kind feature
/kind rule-create
Any specific area of the project related to this PR?
/area rules
What this PR does / why we need it:
This PR adds two rules to detect if a pod is created and configured to share host pid and IPC namespaces. When talking about container security, namespaces play a big role, since they allow to control which resources a process in a container can actually use. Having a pod sharing pid and IPC host namespaces is a potential risk and it could be leveraged by attackers. You can read more in this well-written article.
Please, let me know if there are container images that make use of host pid and IPC namespaces and can be whitelisted. I am not aware of any atm
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
I tested these new rules using KinD and installed Falco with the latest Helm chart. To configure k8s audit logs, I configured KinD with this config file:
Then I have used FluentBit as described in this blog post on the official Falco website
Does this PR introduce a user-facing change?: