-
Notifications
You must be signed in to change notification settings - Fork 303
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
Add configuration value to run unprivileged with capabilities #305
Conversation
Welcome @bauerd! It looks like this is your first PR to falcosecurity/charts 🎉 |
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.
Hey @bauerd
Thank you so much for this PR. We missed this feature for a long time 🙏
I haven't tried it yet, but after a quick look at your implementation, it SGTM. I just have a couple of questions.
Is the leastPrivileged
option intended to be used in conjunction with the init container approach?
Or do we assume the user installed the driver by other means?
Basically, how can the driver be installed without privileged: true
?
(it would be great to document that in the README)
I see you did not include SYS_PTRACE
. It is included in our documentation, but I can't recall why it is needed. Could you explain why it's not needed in this case?
Same question for hostPid
. I guess it is not needed since Falco can still access the host /proc
?
Hey @leogr, thanks for having a look, great questions.
It depends on the driver. It won't work to load the kernel module unprivileged. But attaching the eBPF probe works with So yes, good point, I should definitely note that For the record, installting the chart from the master branch, the
My understanding is that only the pdig userspace driver uses ptrace(2). However pdig does not appear to be supported by this chart. Hence no need for |
5b289ad
to
83c7264
Compare
Hey @bauerd You're probably right. We have to find the time to confirm that before merging this PR. PS |
Hi, don't worry and take your time 👍 For the record, I also tested this on GKE. |
{{- if .Values.leastPrivileged.enabled }} | ||
capabilities: | ||
add: | ||
- BPF |
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.
Note that this requires runc 1.0.0-rc93 onwards: https://github.com/opencontainers/runc/pull/2553/files.
In older versions, this won't work.
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.
quick update:
- I believe this can work only with ebpf (see my suggestion below)
- There's a conflict; the PR needs a rebase
cc @bauerd
I'm still testing this PR. Once done, I can fix the comment and do the rebase by myself (so no action is required by you). Then, I'll give my final approval :)
Hi @bauerd !
I tried adding In the end, i tried with Any hint? EDIT: looking around, i found this issue: falcosecurity/falco#1299 EDIT2: it seems like i was using a 5.4 kernel after all ( EDIT3: tested on latest GKE version available (1.23.2) where nodes use kernel |
Can this be merged? Is there something missing? |
Quick update: We have done some investigation and testing. In the end, we discovered that:
So, I will rebase this PR soon and likely give my approval. I will keep you posted. |
Signed-off-by: Dominic Bauer <dbauer@gitlab.com>
Signed-off-by: Dominic Bauer <dbauer@gitlab.com>
Signed-off-by: Dominic Bauer <dbauer@gitlab.com>
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
83c7264
to
6a9bf88
Compare
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
Note:
I've rebased the PR and resolved some conflicts.
Also added a commit to clarify this option can only work with ebpf.
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: bauerd, leogr 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 |
LGTM label has been added. Git tree hash: 88d4b866611df5af9665c051f6629c96964611c4
|
Signed-off-by: Dominic Bauer dbauer@gitlab.com
What type of PR is this?
/kind feature
Any specific area of the project related to this PR?
/area falco-chart
What this PR does / why we need it:
This PR introduces a
leastPrivilege.enabled
value that enables running Falco least privileged.If enabled, the
CAP_{BPF,SYS_RESOURCE,PERFMON}
capabilities are assigned, and the containers run unprivileged.Which issue(s) this PR fixes:
https://gitlab.com/gitlab-org/cluster-integration/cluster-applications/-/issues/51
Special notes for your reviewer:
The changelog does not have an entry for 1.16.3, yet Chart.yaml is at 1.16.3 currently. I bumped to 1.16.4 and added a changelog entry.
Checklist