SuperAPI AI Directory

cloud-k8s

Security & auditing

View repository

Updated 10-14 18:54

About this skill

Cloud / Container / Kubernetes Security

ACTION REQUIRED (execute immediately after reading)

  1. NOW: Read ../field-journal/precedent-pentest.md — Cloud/K8s testing requires written authorization
  2. NOW: case-init + scope; clarify account boundaries, prohibit destructive operations
  3. NOW: Confirm it is cloud metadata/container/K8s/IAM, not ordinary web scanning (the latter pentest-tools/)
  4. NEXT: tool-index; kubectl/aws/gcloud etc. are mostly manually installed
  5. ACT: Start from "identity and exposure surface", do not scan the entire network by default

Applicable Scenarios

  • Cloud metadata SSRF (169.254.169.254 / IMDS)
  • IAM excessive permissions, public storage buckets, misconfigured security groups
  • Docker/containerd escape path assessment
  • Kubernetes RBAC, Secrets, Admission, supply chain images
  • Container image vulnerabilities (can be linked with supply-chain-security/)

Workflow

Phase 1 — Identity and Boundaries

□ 当前身份:云 AK/SK、K8s SA、节点 SSH?
□ 范围:单账号 / 单 cluster / 单 namespace
□ 网络档:authorized_target_only

Phase 2 — Cloud Control Plane

# 示例(按厂商替换;MUST 在授权账号内)
aws sts get-caller-identity
aws s3 ls
# Azure / GCP 对应 identity 命令
□ 公开桶 / 错误 ACL
□ 元数据:IMDSv1 vs v2;SSRF 链
□ 角色可扮演(PassRole)与横向

Phase 3 — Containers

□ 是否 privileged / hostPath / hostNetwork
□ capabilities(SYS_ADMIN 等)
□ 可写宿主机路径 → 逃逸候选
□ 镜像历史与已知 CVE → Trivy

Phase 4 — Kubernetes

kubectl auth can-i --list
kubectl get pods,secrets,svc -A
kubectl get clusterrolebindings
□ SA token 挂载与权限
□ 危险 admission webhook 缺失
□ etcd / dashboard 暴露
□ 网络策略是否默认放行

Toolchain

Tool Purpose Bootstrap
kubectl Cluster interaction Manual
trivy Image/IaC bootstrap trivy if available
kube-bench / kubeaudit CIS/Configuration Manual
pacu / scoutsuite Cloud audit (authorized) Manual
nuclei Known cloud vulnerability templates bootstrap nmap/nuclei ecosystem

References

  • references/k8s-cloud-checklist.md
  • CTF comparison:../../CTF-Sandbox-Orchestrator/competition-agent-cloud/
  • ../supply-chain-security/ ../pentest-tools/

Routing Context

Upstream: MASTER R23
Downstream: obtain node shell → attack-chain / windows-ad; image vulnerabilities → supply-chain
MUST NOT: unauthorized scanning of other tenants on public cloud

Task Completion Self-Check

  • Is it limited to authorized accounts/cluster?
  • Do findings include reproduction and impact?
  • Are destructive operations avoided?
  • Report / journal?