1

I'm trying to improve my security knowledge on containers environments.

Recently I was playing around with Kubernetes cluster. I saw this absolutely awesome link: https://schd.ws/hosted_files/kccncna17/d8/Hacking%20and%20Hardening%20Kubernetes%20By%20Example%20v2.pdf

  • From a compromised container, how can I know the Node IP addresses? Is always the gateway of my compromised container the IP of the node containing it?
  • From a compromised container, how can I know the cluster API IP address?
schroeder
  • 123,438
  • 55
  • 284
  • 319
OscarAkaElvis
  • 5,185
  • 3
  • 17
  • 48

1 Answers1

1

Getting to the Node address from a compromised container can be non-obvious, depending on which Container Network Interface (CNI) plugin is in use.

You can try traceroute from the container and in some cases the first hop will be the node IP address.

Getting to the Cluster API address is generally much simpler. The default in all clusters is to create a service for Kubernetes and to inject the Service IP address into each container as an environment variable. If you look for KUBERNETES_SERVICE_HOST that should show you an IP address you can connect to.

Rory McCune
  • 60,923
  • 14
  • 136
  • 217