cloud-k8s
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCloud / Container / Kubernetes Security
Cloud / Container / Kubernetes Security
ACTION REQUIRED(读完后立刻执行)
ACTION REQUIRED (Execute immediately after reading)
- : 读取
NOW— 云/K8s 测试必须书面授权../field-journal/precedent-pentest.md - : case-init + scope;明确账号边界、禁止破坏性操作
NOW - : 确认是云元数据/容器/K8s/IAM,而非普通 Web 扫(后者
NOW)pentest-tools/ - : tool-index;kubectl/aws/gcloud 等多为手动安装
NEXT - : 从「身份与暴露面」开始,禁止默认全网扫描
ACT
- : Read
NOW— Written authorization is mandatory for cloud/K8s testing../field-journal/precedent-pentest.md - : case-init + scope; Clarify account boundaries and prohibit destructive operations
NOW - : Confirm whether it involves cloud metadata/container/K8s/IAM, rather than regular web scanning (use
NOWfor the latter)pentest-tools/ - : tool-index; kubectl/aws/gcloud etc. are mostly installed manually
NEXT - : Start with "Identity and Exposure Surface", prohibit default full-network scanning
ACT
适用场景
Applicable Scenarios
- 云元数据 SSRF(169.254.169.254 / IMDS)
- IAM 过度权限、公开存储桶、错误安全组
- Docker/containerd 逃逸路径评估
- Kubernetes RBAC、Secrets、Admission、供应链镜像
- 容器镜像漏洞(可联动 )
supply-chain-security/
- Cloud metadata SSRF (169.254.169.254 / IMDS)
- IAM over-permissions, public storage buckets, incorrect security groups
- Docker/containerd escape path assessment
- Kubernetes RBAC, Secrets, Admission, supply chain images
- Container image vulnerabilities (can link with )
supply-chain-security/
工作流
Workflow
Phase 1 — 身份与边界
Phase 1 — Identity and Boundary
text
□ 当前身份:云 AK/SK、K8s SA、节点 SSH?
□ 范围:单账号 / 单 cluster / 单 namespace
□ 网络档:authorized_target_onlytext
□ Current identity: Cloud AK/SK, K8s SA, node SSH?
□ Scope: Single account / Single cluster / Single namespace
□ Network policy: authorized_target_onlyPhase 2 — 云控制面
Phase 2 — Cloud Control Plane
bash
undefinedbash
undefined示例(按厂商替换;MUST 在授权账号内)
Example (replace by vendor; MUST operate within authorized accounts)
aws sts get-caller-identity
aws s3 ls
aws sts get-caller-identity
aws s3 ls
Azure / GCP 对应 identity 命令
Corresponding identity commands for Azure / GCP
```text
□ 公开桶 / 错误 ACL
□ 元数据:IMDSv1 vs v2;SSRF 链
□ 角色可扮演(PassRole)与横向
```text
□ Public buckets / Incorrect ACLs
□ Metadata: IMDSv1 vs v2; SSRF chains
□ Roles that can be assumed (PassRole) and lateral movementPhase 3 — 容器
Phase 3 — Containers
text
□ 是否 privileged / hostPath / hostNetwork
□ capabilities(SYS_ADMIN 等)
□ 可写宿主机路径 → 逃逸候选
□ 镜像历史与已知 CVE → Trivytext
□ Whether privileged / hostPath / hostNetwork is enabled
□ Capabilities (such as SYS_ADMIN)
□ Writable host paths → Escape candidates
□ Image history and known CVEs → TrivyPhase 4 — Kubernetes
Phase 4 — Kubernetes
bash
kubectl auth can-i --list
kubectl get pods,secrets,svc -A
kubectl get clusterrolebindingstext
□ SA token 挂载与权限
□ 危险 admission webhook 缺失
□ etcd / dashboard 暴露
□ 网络策略是否默认放行bash
kubectl auth can-i --list
kubectl get pods,secrets,svc -A
kubectl get clusterrolebindingstext
□ SA token mounting and permissions
□ Missing dangerous admission webhooks
□ etcd / dashboard exposure
□ Whether network policies allow traffic by default工具链
Toolchain
| 工具 | 用途 | 自举 |
|---|---|---|
| kubectl | 集群交互 | 手动 |
| trivy | 镜像/IaC | bootstrap |
| kube-bench / kubeaudit | CIS/配置 | 手动 |
| pacu / scoutsuite | 云审计(授权) | 手动 |
| nuclei | 已知云漏洞模板 | bootstrap nmap/nuclei 生态 |
| Tool | Purpose | Bootstrap |
|---|---|---|
| kubectl | Cluster interaction | Manual |
| trivy | Image/IaC scanning | Bootstrap |
| kube-bench / kubeaudit | CIS/configuration checks | Manual |
| pacu / scoutsuite | Cloud audit (authorized) | Manual |
| nuclei | Known cloud vulnerability templates | Bootstrap nmap/nuclei ecosystem |
参考
References
references/k8s-cloud-checklist.md- CTF 对照:
../../CTF-Sandbox-Orchestrator/competition-agent-cloud/ ../supply-chain-security/../pentest-tools/
references/k8s-cloud-checklist.md- CTF reference:
../../CTF-Sandbox-Orchestrator/competition-agent-cloud/ ../supply-chain-security/../pentest-tools/
路由上下文
Routing Context
上游: MASTER R23
下游: 拿到节点 shell → / ;镜像漏洞 → supply-chain
MUST NOT: 未授权扫公有云其他租户
下游: 拿到节点 shell →
attack-chainwindows-adMUST NOT: 未授权扫公有云其他租户
Upstream: MASTER R23
Downstream: Obtain node shell → / ; Image vulnerabilities → supply-chain
MUST NOT: Unauthorized scanning of other tenants in public clouds
Downstream: Obtain node shell →
attack-chainwindows-adMUST NOT: Unauthorized scanning of other tenants in public clouds
任务完成自检
Task Completion Self-Check
- 是否限定在授权账号/cluster?
- 发现是否含复现与影响?
- 是否避免破坏性操作?
- 报告 / journal?
- Is it limited to authorized accounts/clusters?
- Do findings include reproduction steps and impacts?
- Have destructive operations been avoided?
- Report / journal completed?