🎄 Join our Annual Holiday wargame and win prizes!


Lack of Network Restriction

Containers in a pod do not have egress or ingress network restrictions. A compromised container could be exploited for activities such as unauthorised data exfiltration, establishing a reverse shell to maintain access to the cluster, or launching attacks against containers in different namespaces. Kubernetes namespaces, in particular, do not inherently restrict network access. This can allow lateral movement within a cluster.

Remediation

Apply network policy. The following examples restricts all egress traffic from "appspace" namespace.

apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
  name: default-deny
  namespace: appspace
spec:
  podSelector: {}
  policyTypes:
  - Egress

---
apiVersion: v1
kind: Namespace
metadata:
  name: appspace

Metadata

  • Severity: low
  • Slug: lack-of-network-restriction

CWEs

  • 284: Improper Access Control

OWASP

  • A01:2021: Broken Access Control

Available Labs

Select a language to explore available labs for this vulnerability.

No matching labs found

Try adjusting your language filter.

Deco line
Deco line

Play AppSec WarGames

Want to skill-up in secure coding and AppSec? Try SecDim Wargames to learn how to find, hack and fix security vulnerabilities inspired by real-world incidents.

Deco line
Deco line

Got a comment?

Join our secure coding and AppSec community. A discussion board to share and discuss all aspects of secure programming, AppSec, DevSecOps, fuzzing, cloudsec, AIsec code review, and more.

Read more