Skip to content

Kubernetes Enumeration

The Hatiyar Kubernetes enumeration suite provides comprehensive visibility into your Kubernetes clusters. Each module focuses on specific K8s resources, providing detailed discovery, configuration analysis, and security assessments.

ModuleDescription
EnumComprehensive cluster enumeration orchestrator (runs all specialized modules)
K8s PodsPod-specific enumeration: containers, volumes, security contexts, resources
SecretsSecrets enumeration and extraction
VolumesStorage enumeration: PVs, PVCs, StorageClasses
NamespacesNamespace enumeration with resource quotas and limits
Terminal window
# Start hatiyar shell
hatiyar shell
# List available Kubernetes modules
hatiyar> ls platforms.k8s
# Use a specific module
hatiyar> use platforms.k8s.enum

This setup applies to all Kubernetes enumeration modules.

Choose one of these authentication methods:

The most common method using your existing kubeconfig:

~/.kube/config
# No additional setup needed if you can already use kubectl
set KUBECONFIG ~/.kube/config
set CONTEXT <name-of-context>

Verify access:

Terminal window
kubectl cluster-info
kubectl get nodes

If running hatiyar inside a Kubernetes pod:

Terminal window
# Use service account token automatically
# Set AUTH_METHOD to "in-cluster" in hatiyar

Using a service account token:

Terminal window
# Get token from service account
kubectl -n kube-system get secret $(kubectl -n kube-system get sa default -o jsonpath='{.secrets[0].name}') -o jsonpath='{.data.token}' | base64 -d
# Set in hatiyar:
set API_SERVER https://your-cluster:6443
set TOKEN your-token-here
set AUTH_METHOD token

Using certificate-based authentication:

Terminal window
set API_SERVER https://your-cluster:6443
set CLIENT_CERT_PATH /path/to/client.crt
set CLIENT_KEY_PATH /path/to/client.key
set CA_CERT_PATH /path/to/ca.crt
set AUTH_METHOD cert

2. Testing with Kind (Kubernetes in Docker)

Section titled “2. Testing with Kind (Kubernetes in Docker)”

Another lightweight option for local testing:

Terminal window
# Install Kind
# https://kind.sigs.k8s.io/docs/user/quick-start/
# Create cluster
kind create cluster --name hatiyar-test
# Verify
kubectl cluster-info --context kind-hatiyar-test
# Cleanup
kind delete cluster --name hatiyar-test

Terminal window
hatiyar> use platforms.k8s.pods
hatiyar> set namespace default
hatiyar> run
Terminal window
hatiyar> use platforms.k8s.pods
hatiyar> show options
# Target specific namespace
hatiyar> set namespace kube-system
# Or enumerate all namespaces
hatiyar> set all_namespaces true
# Configure output file
hatiyar> set OUTPUT_FILE k8s_pods_results.json
# Run enumeration
hatiyar> run

Want to add support for additional K8s resources? See our Contributing Guide