Back home
中文
H7 / SECURITY RESEARCH NOTES

Enumerating Kubernetes Secret Objects Through the Kubelet API Server

On this page1 sections

//: MD content is automatically formatted; be sure to follow standard MD writing conventions. //: A table of contents is generated automatically. Follow the levels marked below and be sure to remove any extras. //: Please modify the environment description fields to make the content easier to understand and reproduce. //: ****************************************************

Environment Description

IPHOSTNAMENOTE
10.10.10.91N/ACentOS

Environment Preparation

Install kubectl

curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
chmod +x ./kubectl
mv kubectl /usr/bin/kubectl

Enumerate kubernet secret Objects

  • A Kubernetes Secret is an object used to let users store and manage sensitive information, such as passwords and connection strings in kubernetes. A Secret can be used through references in a pod configuration. An attacker with permission to retrieve data from the API Server (for example, by using a pod service account) can access sensitive information such as credentials for various services.

Enumerate Namespaces Currently Used in the Kubernetes Cluster

kubectl get namespace
  • The result is shown below:

Obtain secret Objects in a Namespace

# 这里尝试获取kube-system下的secret对象
kubectl get secrets -n kube-system
  • The result is shown below: