Skip to content
Info disclosure Write-up Intermediate

In Cloud we “Trust”: Wrong Kubernetes implementation by Google Cloud Platform & Microsoft Azure affecting customers

The deprecated Kubernetes read-only port 10255 was left enabled by default on Azure AKS and Google GKE, allowing any container to access it and leak information about other containers in the same namespace, including secrets stored as environment variables. The author reported it to both providers; Microsoft eventually fixed it, but Google had not fixed it at the time of writing.

Chen Cohen Follow

Published on faun.pub

Docker

Chen Cohen, on faun.pub

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 5 min read.

Context

Kubernetes is the leading container orchestration platform for SMB and enterprises, providing fast deployment, load balancing, high availability and resource monitoring, and it is widely offered as a service by different cloud providers. This write-up looks at how two of those managed offerings, Azure Kubernetes Service (AKS) and Google Kubernetes Engine (GKE), handled a deprecated Kubernetes feature: the read-only port 10255, which was designed for metrics and health checks.

The problem is that this port was still reachable by default on both services, and Kubernetes had disabled the feature by default a few months earlier in an official release. The author found the issue during a security analysis of a customer's container environment running on AKS, then checked other providers while waiting for Microsoft to respond.

Setup

The work was done against a customer's containers environment running on Azure AKS, and later against GKE. No specific tooling beyond the ability to reach the port from inside a container is described; the author notes the port can be easily accessed via curl. The precondition that matters is the default network behaviour of the cloud providers: they do not restrict connectivity between containers (pods) and the host machines (nodes), so any container without restrictions to the host IP addresses can reach the node's port 10255.

Finding it

During the security analysis of the AKS environment, the author found that the deprecated read-only port 10255 was in use by default. Because pods can reach their node by default, any container in the cluster can query that port. The port is read-only and intended for metrics and health checks, but it exposes information about the containers in the same namespace, including:

  • container names
  • container IP addresses
  • ports in use
  • images used for container deployment
  • secrets stored as environment variables on the Kubernetes built-in vault
  • and more

This looked wrong for two reasons: Kubernetes had already disabled the feature by default in an official release, and a managed service should not leave a deprecated, information-leaking endpoint reachable from every pod.

Exploitation

Step 1: Reach the read-only port from a container

From any container that has no restrictions to the host IP addresses, the node's port 10255 can be queried. The author notes it can be easily accessed via curl. The response leaks the container details listed above, including secrets stored as environment variables.

Step 2: Report to Microsoft

In the beginning of October 2019 the issue was reported through Microsoft Security Center with detailed information. Microsoft's first answer avoided taking responsibility: the report was closed as "N/A" and the issue was defined as the responsibility of Azure clients.

Microsoft’s answer for the first report From the original on faun.pub

Microsoft's answer for the first report

Step 3: Push back

The author did not accept leaving the issue open without Microsoft taking responsibility, arguing that clients are not responsible for the Kubernetes deployment because Azure AKS is Kubernetes-as-a-service and Microsoft should take care of the services it deploys rather than put its customers at risk. A second report was sent a few days later, and Microsoft answered again.

From the original on faun.pub

On November 14, 2019, Microsoft confirmed that the issue was resolved and marked the case as completed.

From the original on faun.pub

Step 4: Check the state of AKS

At the time of writing, the issue still affected all AKS clusters running a version prior to "1.16.1 - preview version". The default version suggested when deploying a new Kubernetes cluster on Azure was "1.14.8". The only mitigation described is upgrading the AKS cluster version to 1.16.1 or higher.

Step 5: Check other providers

While waiting for Microsoft's answer, the author checked whether the deprecated read-only port was still used by other cloud providers, specifically Google Cloud Platform and Amazon Web Services. The port was still in use by GKE (Google Kubernetes Engine). Since Google are the original author of Kubernetes, the author expected them to be the first to implement updates to their Kubernetes services.

Step 6: Report to Google

A report was sent immediately through the Google issue tracker and was triaged within 2 days. Two weeks later Google responded again, saying it was already a tracked bug. The author then asked for an ETA for the fix and received the following answer.

From the original on faun.pub

As seen in the picture, Google's answer was commented on November 15 stating that the bug would likely be fixed by the end of the year. As of the date of writing (January 9, 2020) the bug was not yet fixed on Google Cloud and was affecting all GKE customers, including the latest "1.15.4-gke.22" version.

Step 7: Check AWS

Amazon EKS customers were not affected.

Root cause

The mistake is a deployment default: the managed Kubernetes services left the deprecated read-only port 10255 enabled, even though Kubernetes had disabled the feature by default in an official release a few months earlier. The exposure is made worse by the default network policy of the cloud providers, which does not restrict connectivity between pods and nodes, so every container can reach the port on its host.

Impact

Any user who can access port 10255 can leak information about containers in the same namespace: container names, container IP addresses, ports in use, images used for container deployment, and secrets stored as environment variables on the Kubernetes built-in vault, among other things. The condition is that the attacker has a container in the cluster without restrictions to the host IP addresses, which is the default. On Azure the issue affected all AKS clusters running a version prior to "1.16.1 - preview version", with "1.14.8" as the default version offered for new clusters. On Google Cloud it affected all GKE customers, including the latest "1.15.4-gke.22" version at the time of writing. Amazon EKS customers were not affected.

Fix

Microsoft confirmed on November 14, 2019 that the issue was resolved and marked the case as completed. For existing clusters, the only mitigation described is upgrading the AKS cluster version to 1.16.1 or higher. Google said the bug would likely be fixed by the end of the year, but as of January 9, 2020 it was not yet fixed on Google Cloud.

Variants to test

  1. Query port 10255 from a pod on any managed Kubernetes service and look for container names, IP addresses, ports, images and environment variables in the response.
  2. A positive result is a default version older than the fix.
  3. A positive result is a successful connection from a pod to the node on a port that should not be exposed.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 13 min read.

What happened, in plain words

Imagine you rent a flat in a large building. The landlord runs the building: the lifts, the water, the electricity, the front door. You just live there. If the landlord leaves the back door unlocked, you would not say it is your fault for living in the flat. That is the heart of this story.

Two large cloud companies, Microsoft (through a service called Azure) and Google (through a service called Google Cloud), rent out computing power the same way. You do not buy servers; you rent a slice of theirs. One of the most popular ways to run software on rented servers today is a tool called Kubernetes. It manages lots of small, self-contained pieces of software called containers, keeping them running, restarting them when they crash and spreading them across machines.

Kubernetes has a small feature: a numbered door (a port) that anyone on the same network can knock on to ask "what is running here?". The door is meant only for simple status information. The people who make Kubernetes decided this door was a bad idea and switched it off by default in a new release. But Microsoft and Google, who rent out Kubernetes as a managed service, left the door open on their systems. Anyone inside could knock and be told the names of the containers, their addresses, the software images they run, and even secret values such as passwords that were stored in the containers' settings.

The researcher who found this reported it to Microsoft in October 2019. Microsoft first said it was the customer's problem. The researcher pushed back, and Microsoft later confirmed the issue was resolved. Google was told too, said a fix would come by the end of the year, and at the time of writing had not fixed it. Amazon's equivalent service was not affected.

This article walks through the whole story for someone who has never touched a server. Every technical word is explained where it first appears, and there is a glossary at the end.

The background: what Kubernetes and containers are

Before the details, three ideas need to be clear.

A container is a way of packaging a piece of software together with everything it needs to run, so it behaves the same on any machine. Think of it as a lunchbox: the food, the cutlery and the napkin all travel together, and you can put the lunchbox on any table.

Kubernetes is the system that manages many lunchboxes at once. It decides which table (machine) each lunchbox goes on, replaces one that spoils, and keeps track of them all. The machines are called nodes, and each running container (or group of containers) is called a pod.

A cloud provider is a company that rents out machines and services over the internet. Instead of running Kubernetes yourself, you can pay a provider to run it for you. That arrangement is called a managed service, or "Kubernetes-as-a-service". Microsoft's version is called Azure Kubernetes Service (AKS). Google's is called Google Kubernetes Engine (GKE). Amazon has one too, called Amazon EKS.

A port is a numbered channel on a machine, like a numbered door in a corridor. One door might be for web traffic (usually 80 or 443), another for remote administration. Software listens on a port, and other machines connect to that number.

The port in this story is 10255. It was designed as a read-only door: you can ask questions through it but not change anything. It was meant for metrics (numbers about how the system is doing, such as how busy it is) and health checks (a simple "are you alive?" question).

A namespace in Kubernetes is a way of grouping related resources together, a bit like a folder. Containers in the same namespace can be thought of as neighbours.

Finally, deprecated means "officially discouraged and on its way out". When the Kubernetes project marks something as deprecated, it usually plans to remove it, and often switches it off by default first. That is exactly what happened here: Kubernetes disabled this read-only port by default a few months before the story, in an official release.

The setup: where the researcher was looking

The work started during a security analysis of a customer's container environment running on Azure AKS. Later the researcher also looked at GKE. The write-up does not describe any special tooling beyond the ability to reach the port from inside a container; it notes the port can be easily accessed with curl.

curl is a small command-line program that fetches things from the internet or from another machine. You give it an address, it sends a request and prints the answer. If you have ever typed a web address into a browser, curl does the same thing without the pictures.

The important precondition is how the cloud providers set up their networks by default. By default, they do not restrict connectivity between containers (pods) and the host machines (nodes). In plain terms: every lunchbox can talk to the table it sits on, and nobody put a lock on that conversation. So any container without restrictions to the host IP addresses can reach the node's port 10255.

An IP address is the number that identifies a machine on a network, like a postal address for computers. "Host IP addresses" here means the addresses of the nodes, the machines the containers run on.

Finding it: the door was open

During the analysis of the AKS environment, the researcher found that the deprecated read-only port 10255 was in use by default. Because pods can reach their node by default, any container in the cluster can query that port.

The port is read-only and intended for metrics and health checks, but it exposes information about the containers in the same namespace, including:

  • container names
  • container IP addresses
  • ports in use
  • images used for container deployment
  • secrets stored as environment variables on the Kubernetes built-in vault
  • and more

A few of those need explaining.

An image is the template a container is created from, the recipe rather than the cooked meal. Knowing which image a container runs tells an attacker which software, and which version, is inside.

An environment variable is a named setting passed to a program when it starts, like a note taped to the lunchbox saying "the key is under the mat". Programs commonly receive configuration this way, and unfortunately people often put passwords and secrets in them.

A secret in this context is any sensitive value a program needs to work: a password, an access key, a token. The write-up refers to the "Kubernetes built-in vault", the place Kubernetes keeps such values. If those values are placed into environment variables, anyone who can read the container's details can read them too.

This looked wrong for two reasons. First, Kubernetes had already disabled the feature by default in an official release, so a managed service should have followed. Second, a managed service should not leave a deprecated, information-leaking endpoint reachable from every pod.

Exploitation: step by step

Step 1: Reach the read-only port from a container

From any container that has no restrictions to the host IP addresses, the node's port 10255 can be queried. The write-up notes it can be easily accessed via curl. The response leaks the container details listed above, including secrets stored as environment variables.

The reason this matters is the default network behaviour described earlier: containers can talk to their node, and the node is listening on 10255. So an attacker who gets a container running in the cluster can immediately ask the node about its neighbours.

Step 2: Report to Microsoft

In the beginning of October 2019 the issue was reported through Microsoft Security Center with detailed information. Microsoft's first answer avoided taking responsibility: the report was closed as "N/A" and the issue was defined as the responsibility of Azure clients.

Microsoft’s answer for the first report From the original on faun.pub

Microsoft's answer for the first report

"N/A" here means "not applicable", the tick-box Microsoft used to say the report did not qualify. The effect was to send the researcher away: the customer, in Microsoft's view, was responsible for the Kubernetes deployment.

Step 3: Push back

The researcher did not accept leaving the issue open without Microsoft taking responsibility. The argument was that clients are not responsible for the Kubernetes deployment, because Azure AKS is Kubernetes-as-a-service and Microsoft should take care of the services it deploys rather than put its customers at risk. A second report was sent a few days later, and Microsoft answered again.

From the original on faun.pub

On November 14, 2019, Microsoft confirmed that the issue was resolved and marked the case as completed.

From the original on faun.pub

This back-and-forth is a common part of reporting a bug.

Step 4: Check the state of AKS

At the time of writing, the issue still affected all AKS clusters running a version prior to "1.16.1 - preview version". The default version suggested when deploying a new Kubernetes cluster on Azure was "1.14.8". The only mitigation described is upgrading the AKS cluster version to 1.16.1 or higher.

A version number like 1.16.1 identifies a particular release of software. The numbers are ordered: 1.16.1 is newer than 1.14.8. "Preview" means an early release that is available before the final one. The point here is that the mitigation existed in a newer release, but the version Azure offered by default to new customers was older.

Mitigation means a way to reduce the risk, not necessarily a complete cure. Here the only mitigation described is upgrading the cluster to 1.16.1 or higher.

Step 5: Check other providers

While waiting for Microsoft's answer, the researcher checked whether the deprecated read-only port was still used by other cloud providers, specifically Google Cloud Platform and Amazon Web Services. The port was still in use by GKE (Google Kubernetes Engine). Since Google are the original author of Kubernetes, the researcher expected them to be the first to implement updates to their Kubernetes services.

This is a sensible habit in security work: if one provider made a mistake with a shared piece of software, check whether the others did too. The same open door might exist in several buildings.

Step 6: Report to Google

A report was sent immediately through the Google issue tracker and was triaged within 2 days. Two weeks later Google responded again, saying it was already a tracked bug. The researcher then asked for an ETA for the fix and received the following answer.

From the original on faun.pub

An issue tracker is a shared list where bugs and tasks are recorded and followed. Triaged means someone looked at the report and sorted it: decided how serious it is and who should handle it. ETA stands for estimated time of arrival, here meaning the expected date of the fix.

As seen in the picture, Google's answer was commented on November 15 stating that the bug would likely be fixed by the end of the year. As of the date of writing (January 9, 2020) the bug was not yet fixed on Google Cloud and was affecting all GKE customers, including the latest "1.15.4-gke.22" version.

So even the newest version Google offered at that moment still had the door open.

Step 7: Check AWS

Amazon EKS customers were not affected.

Root cause: why it happened

The mistake is a deployment default. The managed Kubernetes services left the deprecated read-only port 10255 enabled, even though Kubernetes had disabled the feature by default in an official release a few months earlier.

The exposure is made worse by the default network policy of the cloud providers, which does not restrict connectivity between pods and nodes, so every container can reach the port on its host.

"Attack surface" means all the ways an attacker could possibly get in or get information out. A door marked "read-only" feels harmless, so nobody counted it as part of the attack surface, even though reading was exactly the problem.

Impact: what an attacker could get

Any user who can access port 10255 can leak information about containers in the same namespace: container names, container IP addresses, ports in use, images used for container deployment, and secrets stored as environment variables on the Kubernetes built-in vault, among other things.

The condition is that the attacker has a container in the cluster without restrictions to the host IP addresses, which is the default. In other words, the attacker needs a container without restrictions to the host IP addresses, which is the default.

On Azure the issue affected all AKS clusters running a version prior to "1.16.1 - preview version", with "1.14.8" as the default version offered for new clusters. On Google Cloud it affected all GKE customers, including the latest "1.15.4-gke.22" version at the time of writing. Amazon EKS customers were not affected.

Why does leaked information matter if nothing was changed? Because names, addresses, ports and images are a map of the inside of the cluster, and secrets are the keys. A map plus keys is often all an attacker needs to go further.

Fix: what was done

Microsoft confirmed on November 14, 2019 that the issue was resolved and marked the case as completed. For existing clusters, the only mitigation described is upgrading the AKS cluster version to 1.16.1 or higher.

Google said the bug would likely be fixed by the end of the year, but as of January 9, 2020 it was not yet fixed on Google Cloud.

Variants to test: how to look for the same mistake elsewhere

  1. Query port 10255 from a pod on any managed Kubernetes service and look for container names, IP addresses, ports, images and environment variables in the response. A positive result is any of that data coming back from a node the pod does not own. The idea: if the node answers with information about other people's containers, the door is open.
  2. Check the default Kubernetes version offered when creating a new cluster on each provider, and compare it with the version in which the read-only port was disabled by default. A positive result is a default version older than the fix. The idea: a provider can have fixed the software but still hand new customers an old version.
  3. Test whether pods can reach their node's IP addresses without restriction on other providers, since that default connectivity is what makes the port reachable. A positive result is a successful connection from a pod to the node on a port that should not be exposed. The idea: the open door only matters if you can walk to it.
  4. Repeat the check on other managed services that wrap upstream components, looking for deprecated features that upstream has disabled by default but the managed offering still enables. The idea: whenever a provider packages someone else's software, compare its defaults with the original project's defaults.

Glossary

  • AKS (Azure Kubernetes Service): Microsoft's managed Kubernetes service, where Microsoft runs Kubernetes for you on Azure.
  • Amazon EKS: Amazon's managed Kubernetes service.
  • Attack surface: all the ways an attacker could get in or get information out of a system.
  • Cloud provider: a company that rents out computing power and services over the internet.
  • Container: a packaged piece of software with everything it needs to run, isolated from the rest of the machine.
  • curl: a command-line program that sends requests to a machine and prints the response.
  • Deprecated: officially discouraged and on its way out, usually to be removed in a future release.
  • Environment variable: a named setting passed to a program when it starts, often used for configuration and sometimes for secrets.
  • ETA: estimated time of arrival, here the expected date for a fix.
  • GKE (Google Kubernetes Engine): Google's managed Kubernetes service.
  • Health check: a simple automated question asking whether a system is alive and working.
  • Host: the machine that something runs on; here, the node that runs the containers.
  • Image: the template a container is created from, including the software and its version.
  • IP address: the number that identifies a machine on a network.
  • Issue tracker: a shared list where bugs and tasks are recorded and followed.
  • Kubernetes: the leading system for managing containers across many machines.
  • Kubernetes-as-a-service: a cloud service where the provider runs Kubernetes for the customer.
  • Managed service: a service a provider runs and maintains on your behalf.
  • Metrics: numbers describing how a system is performing, such as load or usage.
  • Mitigation: a way to reduce a risk, not necessarily a complete cure.
  • Namespace: a grouping of related Kubernetes resources, like a folder.
  • Node: a machine in a Kubernetes cluster that runs containers.
  • Pod: the smallest unit Kubernetes runs, one or more containers grouped together.
  • Port: a numbered channel on a machine that software listens on and others connect to.
  • Preview version: an early release made available before the final version.
  • Read-only: can be read but not changed.
  • Secret: a sensitive value such as a password, key or token that a program needs.
  • Triaged: looked at and sorted by seriousness and owner.
  • Version number: an identifier for a particular release of software, ordered so newer releases have higher numbers.

More by Chen Cohen

View all

2 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Information disclosure

The lesson behind this report.

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.