Kuboid
Open Luck·Kuboid.in
Security BSides2025
Open in YouTube ↗

Cloud & Containers: The Security Puzzle That Locks Tight

Security BSides London35 views15:22about 1 month ago

This talk explores the security challenges of containerized environments, focusing on the risks of shared kernel architectures and supply chain vulnerabilities. It highlights the necessity of implementing robust guardrails, such as network policies and runtime monitoring, to mitigate threats like container escapes and lateral movement. The presentation emphasizes the importance of adopting a zero-trust approach to container security, utilizing tools like eBPF for deep visibility and attestation.

Container Escapes and Supply Chain Poisoning: Why Your Build Pipeline is Leaking Trust

TLDR: Recent research highlights how misconfigured container runtimes and compromised CI/CD pipelines allow attackers to bypass standard security controls. By exploiting race conditions in mount operations and poisoning build artifacts, adversaries can achieve host-level access or inject malicious code that passes all automated security scans. Security teams must shift from "build-only" security to runtime enforcement using eBPF to detect these sophisticated, post-deployment threats.

Modern container security is often treated as a static problem. We scan images in the registry, we run static analysis on our Dockerfiles, and we call it a day. This approach is fundamentally broken because it ignores the reality of the Linux kernel and the dynamic nature of build environments. If you are a pentester or a researcher, you know that the "container" is a mirage. It is a collection of namespaces and cgroups sharing a single kernel. When that kernel is exposed through a misconfigured mount or a race condition, the entire isolation model collapses.

The Reality of Shared Kernel Exploitation

The core issue with container security is the shared kernel architecture. When you look at the recent wave of vulnerabilities like CVE-2024-21626, you see a clear pattern: attackers are targeting the way runtimes handle file descriptors and mount points. In these scenarios, a malicious container can escape its sandbox by manipulating the host's file system through a race condition.

For a pentester, this means that if you land a shell inside a container, your next step should not just be looking for environment variables or cloud metadata. You need to audit the mount points. If the container has access to sensitive host paths, or if the runtime is outdated, you are looking at a potential T1611-escape-to-host scenario. The vulnerability often lies in how the runtime handles the transition between the container's namespace and the host's file system during a runc execution. If you can trigger a race condition during this window, you can effectively break out of the container's root directory and gain access to the host's filesystem.

Supply Chain Poisoning and the "Signed Malware" Trap

We often trust our CI/CD pipelines implicitly. If a build passes Trivy or Checkov scans, we assume the artifact is clean. This is a dangerous assumption. The 3CX supply chain attack demonstrated that an attacker can compromise a build environment to inject malicious code that is then signed by the legitimate vendor.

From a research perspective, the problem is that automated scanners look for known vulnerabilities, not for malicious intent. If an attacker injects a backdoor into a build script, the resulting binary is technically "secure" because it contains no known CVEs. It is simply malicious. To combat this, we need to move toward Software Bill of Materials (SBOM) and rigorous attestation. If your pipeline does not verify the provenance of every dependency and every build step, you are essentially running unverified code in production.

Why Runtime Monitoring is Non-Negotiable

Static analysis is blind to runtime threats. If an attacker executes code directly in memory or uses living-off-the-land techniques, your registry scanner will never see it. This is where eBPF becomes the most powerful tool in your arsenal. By attaching probes at the kernel level, you can monitor system calls, file access, and network connections in real-time.

Tools like Falco allow you to define behavioral baselines. If a web server container suddenly tries to access /etc/shadow or initiates an outbound connection to an unknown IP, you can trigger an immediate alert or even kill the process. This is the only way to catch T1574-hijack-execution-flow or other post-exploitation activities that occur after the container has been deployed.

Practical Steps for Your Next Engagement

When you are testing a Kubernetes environment, stop treating the cluster as a black box. Start by mapping the network policies. If you find that pods can communicate across namespaces without restriction, you have found a massive A01:2021-Broken Access Control issue. Use Cilium to visualize these flows if possible.

Next, look for configuration drift. A container might be deployed with a secure configuration, but if it is running with privileged: true or has unnecessary capabilities, it is a ticking time bomb. Check for A05:2021-Security Misconfiguration by inspecting the pod specs. If you can find a way to mount the Docker socket or the host's /proc directory, you have effectively won the engagement.

The goal is to stop thinking about security as a gate at the end of the pipeline. It must be a continuous, observable process. If you are not monitoring what your containers are doing at the kernel level, you are not doing security. You are just hoping that your developers never make a mistake. Start by implementing strict network policies and runtime monitoring, and stop relying on the assumption that a clean scan means a secure system. The next time you are on an engagement, look for the gaps between the build and the runtime. That is where the real bugs are hiding.

Talk Type
talk
Difficulty
intermediate
Has Demo Has Code Tool Released


BSides London 2025 Rookie Track 1

14 talks · 2025
Browse conference →
Premium Security Audit

We break your app before they do.

Professional penetration testing and vulnerability assessments by the Kuboid Secure Layer team. Securing your infrastructure at every layer.

Get in Touch
Official Security Partner
kuboid.in