Pod is running with added capabilities Affecting Deployment service in Kubernetes


Severity

0.0
medium
0
10
    Severity Framework
    Snyk CCSS
    Rule category
    Containers / Capabilities

Is your enviroment affected by this misconfiguration?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
    Frameworks
    CIS-Kubernetes
  • Snyk ID SNYK-CC-00657
  • credit Snyk Research Team

Description

Adding capabilities beyond the default set increases the risk of container breakout attacks. In most cases applications are able to operate normally with all Linux capabilities dropped, or with the default set of capabilities.

How to fix?

Remove the added capabilities attribute in spec.containers.securityContext.

Example Configuration

apiVersion: v1
kind: Pod
metadata:
  name: valid2
spec:
  containers:
  - name: sec-ctx-4
    image: gcr.io/google-samples/node-hello:1.0
    securityContext:
      capabilities:
        drop:
          - ALL

Kubernetes

Terraform