Vulnerability incoming
Detection as Code - for Kubernetes
Rules or Profiles for getting a detection rule deployed using gitOps (25.11.2026)
Förderjahr 2025 / Projekt Call #20 / ProjektID: 7918 / Projekt: Sovereign SOC

Platform teams have shift-left covered: scanners on every PR, admission control, SBOM+VEXs on every image. Then a high-severity CVE drops with "patch coming soon," and all of it goes quiet for days while a known-exploitable workload sits in prod ....

The Kubernetes story has been one of turning operational concerns into declarative resources: workloads, networking, policy, configuration, secrets, certificates. Runtime detection is one of the last operational concerns that still lives outside that model for most teams, handled by a separate tool, owned by a separate group, reasoned about in a separate language. The cost of that separation shows up exactly when it hurts most, in the days between a CVE landing and a patch being available, when the platform team and the security team are looking at the same problem with two different vocabularies.

Ben Hirschberg and Constanze Roedig demonstrate that detection belongs in the same workflow as the rest of the cluster. Constanze shows work developped under this grant, part of which is already GA now.

Two problems: TeamPCP (Trivy incident) and PHP2Shell

 

gitops for detection as code

Two types of system, that are being attacked:

- github runners (the systems on which we build our software) is affected by malware smuggled into the trivy-scanner by a malicious actor

- wordpress is affected by PHP2Shell 

We will detect both with rules-as-code and profiles-as-code and compare what worked better for each

1) When your build-system is affected by malicious tradecraft -> use detection rules

A compromised build-system is bad news, your keys can be stolen, your software become backdoored and worst of all: build-systems are hard to profile as they change very frequently and must support highly priviledged operations in almost all software ecosystems.

That means, the behavior is generally not bounded. 

And that, in turn means, that we need clear and actionable signals to distinguish the important alerts from the noise.

sidebyside detection alerts

Above, we see the comparison between a slack-alert channel, (left) where Ben transformed an official advisory into a detection rule (expressed in Common Expression Language) and (right) the equivalent detection from baseline profiles.

rules versus profiles

Identical facts are detected

Rules are much more informative and relevant and more actionable.

2) When you have a php application the usage you know -> use profiles 

A lot of companies rely on wordpress and other php-applications, some of which have plugins that spawn shells. Why is that relevant?

If you want to detect a signal, you need to be able to tell the difference between what you application does `normally` versus what the vulnerability does. But wait a second: php2shell is a heap-corruption, how would eBPF see that?

It doesn't in this case, what we can see, however, is the process tree. And our wordpress may be used to shells executing certain commands. However, **not** the typical commands an attacker would find useful in post-exploitation. So, as long as the entire nested tree of commands is not identical, we can tell them apart.

sbob summary

 

So whats the lesson here: if you have one of those applications of a rather `classical architecture` when direct integration with the Operating System is allowed. Please, record what commands these plugins use

We are committed to developing tooling to make this easier -> https://github.com/k8sstormcenter/bob 

 

 

php2shell SBOB detection

 

summary

Watch the YouTube Video of the PHP exploit being detected here https://youtu.be/XgG4nmJfp0w?si=hsOkoby8-Rkh0UHm 

 

 

Summary: For good detection, we need to adapt quickly these days

To find the relevant alerts in our SOC quickly and accurately, we must choose the right approach. In the Sovereign SOC, we use both methods and hope that we will continue to improve the ease-of-use of either method for the end user.

Constanze Roedig

Profile picture for user constanze.roedig
Constanze is an astrophysicist turned entrepreneur: she spent over 15 years designing and implementing resilient complex systems for finance and government. CS lecturer and key researcher. Created the K8s Stormcenter for Open Threat Intelligence. Her research is on improving security using modern and emerging technologies such as eBPF, WebAssembly and AI. Her vision is to create practical and achievable security implementations usable in defendable systems for a resilient society.

Skills:

eBPF
CAPTCHA
Diese Frage dient der Überprüfung, ob Sie ein menschlicher Besucher sind und um automatisierten SPAM zu verhindern.

    Weitere Blogbeiträge