-
Notifications
You must be signed in to change notification settings - Fork 918
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
Scope of Falco artifacts #1114
Comments
For supported operating systems for the driver, find the survey that was sent out: |
I'd suggest taking a look at https://github.com/bottlerocket-os/bottlerocket as another potential OS (related issue: #1103) |
After speaking with @leogr we wanted to propose some thoughts around running Falco with Kubernetes. The above proposal solves the problem of Falco artifacts running on a Linux system, but does not give an official answer to
So we would like to add another officially supported toolchain to run Falco with Kubernetes. We would like to use |
@kris-nova What is the reason for creating a special installation tool for Kubernetes? In my case, I'll have to export what your tool will deploy and make a helm chart out of it. |
I have a few questions and some comments... First, the comments...
And then my questions...
|
Hey @danmx thanks for your comments
Helm and Kustomize are fantastic ways to install Kubernetes applications. Falco isn't a traditional Kubernetes application, and trying to fit it into a traditional kubernetes deployment tool violates container isolation boundaries, is a risk, and isn't flexible enough for what we need to do. Installing Falco should be more like a The paradigm that a user can simply The helm chart requires a privileged security context to load a driverThe # Taken from the helm chart
securityContext:
privileged: true The reason for this is because we would load a driver at runtime. Which means the pod had to be privileged. Most end users won't even allow this configuration in their clusters. Just because you can, doesn't mean you shouldNot everything should be deployed with helm, as helm is bound to running above Kubernetes. There are reasons we don't have paradigms like the following: helm install docker
helm install kubeadm
helm install selinux
helm install broadcom driver
helm install iptables
helm install nvidia driver
helm install kubelet Again - in order to create the Falco doesn't "run on" KubernetesIt runs next to Kubernetes, and also below Kubernetes. In fact one could make the argument that it makes sense to have Falco running even before you install Kubernetes in the first place. Falco is NOT a Kubernetes application. It's a kernel security tool that happens to have features that work well with Kubernetes. It will be important that Falco users have a reliable, secure, and friendly avenue in which they install Falco. While most users think that something like [ Kubernetes] --- [ Pods ] ------------- [ Falco clients / consumers / producers ]
[ Kubernetes] --- [ Container Runtime ] ------------------------------------------
[ Kubernetes] --- [ Kubelet ] ----------------------------------------------------
----------------- [ Linux userspace ] -- [Falco program] -------------------------
----------------- [ Kernel ] ----------- [Falco driver] -------------------------- So while Setting the expectation that you can (and should) do that with helm seems wrong. If you look at the kubelet, you certainly could run it as a daemonset. Which means you could potentially install it with helm. That doesn't make sense as the kubelet lives and runs at a layer of the system below Kubernetes. The kubelet exposes an API which other parts of Kubernetes can access using Kubernetes primitives. Falco should follow this pattern in my mind. Falco clients require mTLSThe Falco APIs are mTLS encrypted and we will need an easy way to rotate TLS over time as well as set up TLS upon installation. A lot of the data we will need will come from the cluster so being able to reason about this at runtime makes a lot more sense than forcing the user to aggregate it and add it as a So the resources we would be potentially deploying as Kubernetes objects are lightweight clients of the Falco systemd process, and a service to expose the Falco API to pods in a given namespace. Now here is where a Kubernetes resource DOES make sense. Having an operator that can help with managing mTLS and rules as well as installing the Kubernetes resources seems much more powerful than having a static manifest approach. But again - an operator is only relevant after Falco is already set up at the Linux level. ScopeBasically the problem here is that users think it's a good idea to install Falco with a tool like helm and I think that is a risk for us. It's just not that simple. Let's look at the steps need to happen to install Falco on a fresh Linux system.
Now I do think users should have a clean, reliable, and friendly way to set this up. I just do not think a tool like helm or kustomize has a broad enough scope, is powerful (or safe) enough to do this for us. They fundamentally operate at a layer of the system that doesn't go deep enough to safely manage all of these concerns. If you look at what we need to do it aligns much more with a user experience like Hence why I suggested It is very important that we understand we aren't re-inventing helm or kustomize, but that we rather need to do things that shouldn't (and in some cases can't) be done with Kubernetes resources. Hence why a command line tool to encapsulate this logic makes sense to me, and would provide a much more rich user experience. We need to remind ourselves that a directory with Kubernetes YAML - at the end of the day - isn't enough to safely and reliably install Falco. Therefore as a project we shouldn't support it. Example workflows Manual (modeled after kubeadm)
Note: Kubeadm has a concept of phases and performs many tasks in series - we should probably do the same with Pre-baked
This is how tools like kops work, and we could begin to start using libraries from Notice that we already have done some of this with We have also done this with kind and the "work-around" is to install the driver external to kind. ConclusionIn every example we keep coming back to this fundamental truth: Something needs to install a driver and configure various parts of Falco before we can run Falco in a container. Which is why the project should support Linux artifacts and not Kubernetes artifacts. If a user chooses to run Falco alongside Kubernetes, I feel very strongly it should be easy and safe for them. Hence, why it is my belief that a tool like Falco isn't a Kubernetes application. It is a Linux application. It should be installed and managed as one. Falco happens to offer features that play nicely with Kubernetes such as consuming audit logs and exposing services but setting Falco up should be a Linux style installation just like Kubeadm. At the end of the day Falco could be installed before, or after Kubernetes is installed, or even as many of Falco end users have mentioned - in systems where Kubernetes isn't even running at all. If there is a third-party community that would like to maintain a helm chart, or YAML manifests I think it's great! But I don't think those artifacts should ever have support from the project that goes any deeper than a "use-at-your-own-risk" "these are unsafe, unoffical and unsupported ways of installing Falco" experience. I even think the Falco community has a responsibility to index, and even host some of these unofficial installation methods. These are probably a good starting place for folks interested in trying Falco out. We just don't want to create the expectation that installing Falco with helm is a good idea to do in production. Frankly, because it isn't. 😃 |
Falco isn't the only tool that falls to these set of technical concerns. Look at CNI for instance. Cilium has a helm chart, and a DaemonSet configured but if you look at how it works
It "works" by privilege escalating in your cluster. Now many low-level container tools (like Cilium) can get away with this. But Falco is a security tool. Which means we need to set a good precedent for our end-users and lead by example. Installing any application like this with helm is a security concern, and Falco will alert if you try to do something like this. In fact if you install the Falco helm chart as it stands right now, Falco actually ends up alerting against itself 😄 A lot of helm charts aren't secure. This isn't something a security tool should endorse. If you look at the stable helm charts there are currently 53 cases of the string "privileged: true" appearing. Falco by default would raise a security alert if any of those 53 charts were deployed. As a security tool we can't endorse these types of packages for anyone else, especially ourselves. The helm charts aren't secure, and it's our job to alert if somebody tries to run them. We shouldn't be contributing to the problem we are trying to address. |
Thank you @kris-nova for the explanation. I do agree with you on some cases but I think all depends how to look on Falco and its deployment. I'm not a Linux kernel expert but from my perspective Falco is just a parser and forwarder of specific types of events, Kubernetes Audit logs and system calls. Helm or Kustomize doesn't define security of what you're deploying. It's up to the creator of the configuration to use least privileged primitives and provide sufficient configuration (least privileged Pod Security Policy, seccomp filters, SELinux/Apparmor profiles). Falco's current Helm chart can be improved in so many ways. Some of them relate to different type of deployment strategy. A privileged container is not required and avoided by properly narrowing Linux capabilities and allowed system calls (via seccomp filters) that Falco require to run in Single Falco daemon covering everything (k8s and syscalls) would work for small deployments. I'm thinking about dedicated instances of it depending on the functionality. This mean an exposed Deployment with no permissions running as non-root user for Kubernetes Audit logs and DaemonSet with all required capabilities and permissions for system calls. This isolates syscall processing Falco and k8s audit processing one is treated as any other service running in the cluster. Another benefit of this is managing updates of Falco runtime (not kernel module or eBPF probe) and its rules. Tricky part is the kernel module or eBPF probe. As you mentioned both could be loaded at boot time via any bootstrapping tool or they can be part of the "pre-baked" system image as part of an immutable infrastructure. Like with kernel updates updating any of those components would require rolling out new system image but I presume those things wouldn't update as often as the runtime. If that is not possible always Regarding mTLS in Kubernetes, service meshes tend to cover all the problems related to certificate rotation, enforcement, etc. I'm not suggesting dropping it since not everybody use service meshes. |
I'm just trying to point out that standardised DevEx is quite important and it drives adoption. |
You are very welcome. Thank you for taking the time to read and understand my thoughts it here. It's very important to me. Thank YOU @danmx for bringing these issues up.
I completely agree. 💯 Which is why I think having a one-stop-shop (falcoctl) that can do the following
seems to be the clear winner here. Privilege escalation in any form is a deal breaker in my mind, Falco shouldn't alert against itself, and we should support the "Falco before Kubernetes" and "Falco without Kubernetes" models. Introducing more dependencies like with a service mesh brings us back to square 1. I want to give our end users a clear, concise, reliable, easy to use story for setting up runtime security in Linux. Then if they happen to be running Kubernetes, we will work well with them. In my mind having a tool like |
I am not saying these will be the exact commands, but look at the user experience here. ssh [email protected]
apt-get install falco falcoctl kubeadm kubectl kubelet docker.io
systemctl enable falco
systemctl start falco
kubeadm init
falcoctl install falco # <--- Creates kubernetes resources for the first time
falcoctl audit configure # <--- Configures Kubernetes audit and restarts API server
falcoctl install tls # <--- mTLS baby
falcoctl install rule <rule> # <--- Authenticated rules against man in the middle
falcoctl token generate # <---- Generate a token for Falco pods to use to consume alerts
exit
helm install prometheus
helm install prometheus-exporter --set token=<token from earlier>
helm install whatever I would much rather be having conversations around the user experience with what tools are installed when and how in Linux than conversations around how to privilege escalate to perform these same tasks. |
I think it'll be a hard sell for some people. I hope you prove me wrong 😄
So in the end you'll be running with full permissions in host environment. It is exactly the same as running a privileged container.
I don't think many K8s operators will go for that. Especially if they keep their infrastructure as code. |
If they have their infrastructure as code then they shouldn't need to do it 😉 |
So I know at a glance it seems like I am being pedantic by separating the container layer with privilege escalation to the host layer, but it's actually a really large concern for some end-users. The thesis here is that we need to be disciplined and respect isolation boundaries for production users. By having Falco set up on the host system (only) we ensure that a production user disables the ability to privilege escalate they can still run Falco successfully. Again - just because you can - doesn't mean you should. As a security tool we owe it to our users not to make any assumptions about their systems, and respect even the most rigid of security policy in a system. Also as a reminder this is a thread about what Falco will support for production users. Not about what we might document or offer on the side. This is about what the Falco community is committing to maintaining for production users. If someone wants to run Falco by privilege escalating they are more than welcome to - just the project won't advertise to triage or support any issues they have by doing so. |
I totally agree with @kris-nova especially about "production users" vs. other use cases. I believe that the helm chart is very easy and useful for several use cases (in particular for development), indeed I contributed to improving the chart and wrote a blog post endorsing its usage. Nevertheless, I really think that is not enough for production users and mission-critical installations - reasons are explained in previous comments. IMHO, it perfectly makes sense that the Falco community should mainly focus on the best, strongest, most secure approach. Furthermore, I believe that by doing so other "unofficial third-party installation" methods will benefit too. Having few official and well-curated installation approaches is a perfect guidance for folks willing to support other installation strategies. |
@leogr do you plan to make a blog post describing in more detail this mission critical production use case (threat model, limitations, etc.)? I'd be very interested to see how other people run it in production. |
@danmx not sure when, but probably we do a blog post once the official installation methods are well described and the toolchain has been improved accordingly. |
For minikube, I think the BPF driver might eventually replace the Kernel driver And then it would probably also work better with the new "docker" driver, without any VM on Linux. |
Closing in favor of #1184 |
I would like to submit a proposal for the Falco project to adopt the following scope for build artifacts.
As it stands the current installation documentation calls out a vast number of ways to install Falco.
As the adoption of Falco grows, we should be very clear and deliberate about which artifacts the project officially supports and maintains, and which are third-party supported installation methods.
I would like to begin separating officially supported artifacts from third-party maintained artifacts so that the Falco maintainers can focus on offering concise stable artifacts that can then be used by third-party integrations and tooling.
I would propose the following.
Officially supported
All officially supported installations should perform the following:
The official artifacts for these installations would be
Given these core artifacts, all of the existing integrations will remain possible. This will allow the Falco community to focus on supporting the more fundamental components necessary.
Unofficial third-party installation index
These are currently found in the documentation but would potentially be moved to a third-party index with pointers to the third-party installation guides.
The text was updated successfully, but these errors were encountered: