Comparing the Leading Tools That Scan Against the CIS Kubernetes Benchmark Framework
CIS Benchmarks are a focused set of guidelines for the secure configuration, vulnerability detection, and...
Dec 1, 2022
A detailed overview of the Remote Code Execution (RCE) attacks, how it affects the Kubernetes infrastructure, and how the vulnerabilities of the K8 systems can be mitigated.
Remote Code Execution (RCE) is a vulnerability in systems that cybercriminals can exploit to perform attacks. In RCE attacks, hackers execute malicious code in target systems remotely, irrespective of their location on the network. That’s because they don’t need the target systems to have the execution functionality. As long as the criminals can access the network, they can perform RCE attacks.
Usually, the attackers locate the target system over the internet. Then they find the system’s loopholes and vulnerabilities, and exploit them using malicious code. Theoretically, RCE attacks can be carried out on any system that can be accessed remotely. A successful RCE attack can cause a range of issues to the victim’s system, as will be discussed later in this post.
RCE is a broad category. It comprises different types of attacks, which exploit a range of vulnerabilities and can lead to numerous issues. Let’s dive in.
In this type of RCE attack, the code exploits vulnerabilities in applications where user input is required. A good example is the infamous Log4j vulnerability. Many applications, including those deployed by leading technology companies, use the well-known Log4j Java library to log application messages and errors. To do this, it must communicate with directory services which is where a vulnerability can be exploited by hackers. They can do so by injecting malicious code that can download and install malware from a remote location.
Numerous websites and applications leverage serialization and deserialization modules to make internal and external communication seamless. Several data sources are combined into a single string or piece of information and later deserialized into their original format. Attackers format the input data so that it can be seen as a piece of code. Execution of that by deserialization programs can give attackers access.
This type of RCE attack is related to the memory allocated for user-provided data. If the memory allocation process has loopholes and gaps, then malicious users can write the input data outside this memory storage. Thus the attacker can give a carefully crafted input that the system will execute as a code and lead to a successful RCE attack.
The above three types of RCE attacks occur based on various system vulnerabilities. These loopholes in the system can be explained with Common Vulnerabilities and Exposure.
Common Vulnerabilities and Exposure is a list of commonly identified vulnerabilities within systems that are openly disclosed. IT professionals prioritize and mitigate these gaps in order to create a system with minimal risk. RCE attacks exploit a wide range of CVEs as follows:
Numerous variations of Apache vulnerabilities are associated with Log4Shell. This usually occurs due to the common logging library used by Apache and many applications that leverage Java. Due to this, a cyber attacker can create a malicious LDAP server and access it via JndiLookup Class. The CVE associated with Log4Shell/CVE-2021-44228 includes CVE-2021-45046, CVE-2021-45105, and maybe more. Log4j is the logging library.
Apple products such as iOS, watchOS, macOS, and Safari possess this vulnerability. Here, if the device/system accesses a fraudulent URL, the OS will execute and create a malicious payload on the system.
Microsoft Windows communication protocol, called NFS v3, has this CVE. Due to this, the NFS Server can act as a medium for the attacker to send the malicious payload or code to the target system.
WordPress 5.0.0 consists of the CVE, which enables cyber attackers to upload image files that comprise PHP code in the Exif metadata of the image. This would give them the necessary access to execute the operations.
While these are merely four examples of CVEs, there are over 700 CVEs across applications and systems such as banking, 4G routers, billing systems, apache, payment systems, and more.
The aforementioned attacks and impacts are generic and applicable to several systems and networks. The Kubernetes infrastructure is also vulnerable to these and has a significant impact. These involve:
The vulnerabilities in the Kubernetes infrastructure occur mainly due to misconfigurations of various components such as pods, etcd servers, API servers, and more. These must behave a certain way and mustn’t be accessible to external access directly.
The kubelet agent is present for every pod and is responsible for managing the pod’s functionalities. It also interacts with the API Server for operations; hence, exposed kubelets can give the attacker access to the various pods.
The etcd Server comprises configuration files for k8 systems and its other confidential data, so exposure to the server can hinder the Kube system.
The API Server is a crucial component that enables the communication between various components. An exposure of this would result in an RCE attack that might affect various modules of the infrastructure.
These three gateways into the Kube infrastructure, means RCE attacks can occur on different modules and lead to the following impact on the system.
Clouds that host Kube systems can be used to gain access to them if the attackers possess the account credentials of the cloud.
Containers comprise service account tokens that authenticate with API Servers. If these account tokens are stolen, individuals can control containers and API Servers and command them to perform various functions based on the intent.
Containers possess several sensitive capabilities that are crucial to the Kube infrastructure’s smooth functioning. If malicious users gain access to these containers, they can access the application’s core and control it entirely.
Containerized applications tend to run across resources that are spread in various namespaces. These namespaces can also be shared across hosts and containers. During this sharing process, the medium used is at risk of exposure and acts as a gateway for the cyber attacker to enter the container and even the host.
Protecting the Kube infrastructure can mitigate the aforementioned vulnerabilities and potential RCE attacks. For this, the following are the most common steps leveraged by developers.
The only runtime-driven, open-source first, cloud security platform Powered by Kubescape & eBPF
Continuously minimizes cloud attack surface
Based on runtime insights
Actively detecting and responding to cyberattacks
CIS Benchmarks are a focused set of guidelines for the secure configuration, vulnerability detection, and...
Originally appeared on The New Stack. More and more organizations rely on Kubernetes to deploy and manage...
The dynamic world of Kubernetes and cloud security is constantly evolving. As we explore this...