Overview

FieldValue
ID1072
NameManage NetworkPolicies in a namespace
Risk CategoryNetworkManipulation
Risk LevelHigh
Role TypeRole
API Groupsnetworking.k8s.io
Resourcesnetworkpolicies
Verbscreate, update, patch, delete
TagsDenialOfService NetworkManipulation NetworkPolicyManagement Tampering

Description

Permits creating, modifying, or deleting NetworkPolicies within a specific namespace. This allows control over network traffic flow for applications within that namespace, potentially bypassing intended segmentation or causing denial of service.

Abuse Scenarios

  1. Create a NetworkPolicy to allow all ingress traffic to pods in the namespace.
kubectl create -n <namespace> -f - <<EOF
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
  name: allow-all-ingress-ns
spec:
  podSelector: {}
  policyTypes:
  - Ingress
  ingress:
  - {}
EOF
# Example: kubectl create -n default -f - <<EOF ... EOF
  1. Delete a NetworkPolicy within the namespace, removing segmentation.
kubectl delete networkpolicy <networkpolicy-name> -n <namespace>
# Example: kubectl delete networkpolicy db-isolation -n production