Get a Demo
Under Attack?
Diagram showing a command prompt with kubectl exec leading to a blue kube-system namespace node. Dashed red and blue lines indicate connections or paths, with the upwind logo at the top left.

Detect Suspicious ‘exec’ Commands in kube-system Namespace

<br />
<b>Warning</b>:  Undefined variable $photo in <b>/nas/content/live/landing173/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code</b> on line <b>24</b><br />
<br />
<b>Warning</b>:  Trying to access array offset on value of type null in <b>/nas/content/live/landing173/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code</b> on line <b>24</b><br />
Denise Ashur April 10, 2024

Detect Suspicious ‘exec’ Commands in kube-system Namespace

We are excited to announce the release of a new threat detection type – exec command in a kube-system namespace.

This detection alerts you that kubectl exec has run a command in your environment in the kube-system namespace, which may indicate a suspicious activity. 

What is Kubectl Exec?

Kubectl is a command line tool used to communicate with Kubernetes clusters via the Kubernetes API. This is an admin tool for Kubernetes clusters that can be used to monitor Kubernetes status, manage and edit resources. 

Kubectl exec gives you full shell access to the container, meaning you can execute commands inside a container directly from kubectl. Before you use kubectl exec to execute a command in a container, you need to know the container namespaces in the cluster. kubectl exec is a powerful tool, it is primarily used for inspecting containers and viewing containers’ status and contents.

Indicators of Compromise

While kubectl exec is used for improving container monitoring and performance, it can also be used by bad actors even if one token of your kubernetes has gotten into the wrong hands. 

Screenshot-2024-04-04-at-3.21.14%E2%80%AFPM-1024x560

One sign of compromise can be if kubectl exec is used to execute a command in the kube-system namespace. The kube-system namespace is a default namespace that is used mostly for system-level components like kube-dns and kube-proxy. It is very unusual to execute commands inside pods or containers in the kube-system namespace because they should be immutable at runtime and acquire high permissions by default and have access to secrets and control-plane resources.

A kube-system attack often includes:

  1. An attacker uses kubectl exec in the kube-system namespace, which has high permissions by default
  2. The attacker then uses kubectl exec to run the exec command in a pod and establish a temporary shell session
  3. Using kubectl exec and a temporary shell session then gives the attacker the ability to execute any process or command in the pod. 
  4. The attacker then uses the interactive shell to run commands and gain access into the pod’s data, including permissions and secrets. 

Upwind leverages runtime data to rapidly identify unusual kubectl exec commands run in the kube-system namespace and immediately alert you to suspicious activity. Read more about Kubectl Exec detections in the Upwind Documentation Center.

Contents

Further Reading

OpenAI Breach

Everyone Read the OpenAI Breach as a Model Story, But It Was a Runtime Story

Key Takeaways Autonomous AI agents can now break out of a sandbox, cross an internal network, and breach a production system with no human at the keyboard. OpenAI's evaluation that hacked Hugging Face this month is the clearest proof on record. Most of the coverage read it as a story about a model turning dangerous.…
upwind-identities

Introducing the Upwind Identity Graph: End-to-End Identity Security

Identity used to be treated as a directory problem: find the user, inspect the groups, review the assigned roles, and decide whether the account has too much access. That model no longer matches the cloud. A single person may authenticate through Okta, inherit permissions from multiple groups, receive role assignments in more than one cloud,…
AI-Graph

Introducing the Upwind AI Graph: Extending AI Inventory Beyond Cloud Infrastructure

As enterprise adoption of artificial intelligence accelerates, modern AI infrastructure has expanded far beyond traditional cloud perimeters. Securing enterprise AI today requires complete visibility across four distinct operational layers: Traditional cloud security tools stop at the cloud provider boundary. When enterprise teams connect directly to external AI Providers, security teams lose sight of access paths,…
Add the Upwind RSS Feed to Slack
Connect the Upwind RSS Feed to your Slack.
Follow the how-to here.
Threat RSS
Add the Upwind RSS Feed to Slack
Connect the Upwind RSS Feed to your Slack.
Follow the how-to here.
Main RSS