Shielder, together with OSTIF and CNCF, performed a Security Audit on the Karmada project.
The audit resulted in six (6) findings ranging from high to informational severity. Most of them have been addressed by the Karmada core team, while two of them are marked for a future iteration.
Today, we are publishing the full report in our dedicated repository.
In September 2024, Shielder was hired to perform a Security Audit of Karmada, an open, multi-cloud, multi-cluster Kubernetes orchestration and management system. The audit has been sponsored by the CNCF and facilitated by the Open Source Technology Improvement Fund (OSTIF).
Karmada aims to provide a unified control plane for multi-cluster applications. To do so, it extends the Kubernetes API to support management of resources across multiple clusters, exposing a single interface (the Karmada API) for operations. It is mainly written in Go.
The Karmada source code is available at https://github.com/karmada-io/karmada, and the website provides documentation of the project at https://karmada.io/docs/.
The aim of the audit was to assess the overall security posture of Karmada, from its design to its implementation, also including the documentation and provided examples.
For the assessment, the Shielder team has modeled the following attackers:
In this context, the goals were to assess if the Karmada project:
The scope of this audit is the Karmada version v.1.11.0 released on August 31, 2024.
The overall security posture of the Karmada project is mature from a code point-of-view.
The project correctly re-uses battle-tested and standard APIs from the Kubernetes project, and mostly follows best practices in terms of security. The Shielder team was able to identify 1 (one) high, 1 (one) medium, 2 (two) low findings plus 2 (two) informational issues.
ID | Vulnerability | Severity | Status |
---|---|---|---|
1 | Insecure Design of Pull Mode | High | Closed |
2 | Multiple TarSlips in CRDs Archive Extraction | Medium | Closed |
3 | Insecure Default Configuration | Low | Closed |
4 | Bootstrap Token Leaked in Command Output | Informational | Closed |
5 | Denial of Service (DoS) in LuaVM Package | Low | Open1 |
6 | K8s Pods Executed with Unnecessary Privileges | Informational | Open2 |
1 The issue is caused by a third-party dependency (gopher-lua). The maintainer has been contacted, and the issue will be fixed in a future iteration. 2 The issue does not have a direct security impact, but it is a good practice to harden the security configuration of containers. It will be fixed in a future iteration.
If you are a developer or cloud engineer using Karmada, the recommendation is to, whenever possible, update it to the latest release or to prefer the Push Mode of deployment to make sure that member clusters are not capable of directly contacting the Karmada control plane.
The full details can be read in the report.
When assessing libraries, frameworks or more in general tools that are by-design highly flexible and customizable, it is crucial to perform effective threat modeling to understand where the most interesting attack surfaces lie.
In the context of multi-cloud, multi-cluster environments, it is important to assume that one of the clusters might be compromised (or operated by a malicious actor), and to design the system in a way that is resilient to that.
For Karmada, the main threats identified were caused by an insecure design of the Pull Mode, which allowed a member cluster to compromise other clusters in the federation, by a lack of input sanitization in the CRD archive extraction, and a DoS when custom Lua scripts are passed to the control plane, which might be used to stall or crash the control plane.
We would like to thank the Karmada core maintainers and community - notably Kevin Wang, Hongcain Ren and Zhuang Zhang - for being extremely collaborative in triaging and addressing the findings.
It was a pleasure for our team to work with OSTIF, the CNCF, and the Karmada core team.
Did you know OSTIF helps sensitive open-source projects in securing funds to perform security audits? They will also help you in scoping the assessment, finding a trusted partner to perform the analysis, and ensuring full transparency along the way.
P.S. if you need help in threat modeling and auditing your kubernetes-powered projects –> get in touch with us!