cloud-k8s – skill DevOps & Hạ tầng cho agent AI
Đánh giá bảo mật cloud, container và Kubernetes được ủy quyền: SSRF tới metadata, cấu hình IAM sai, các đường thoát khỏi container và rà soát RBAC của cluster.
Cài skill cloud-k8s bằng một lệnh
Chọn công cụ bạn đang dùng, copy lệnh và dán vào terminal. Skill sẽ nằm trong thư mục skills của công cụ đó và sẵn sàng dùng ở phiên làm việc tiếp theo.
Claude Code
mkdir -p ~/.claude/skills && curl -fsSL https://skill.dn1nguoi.com/z/cloud-k8s-410cb.tgz | tar xz -C ~/.claude/skills
Gọi trong Claude Code: /cloud-k8s – rồi mô tả công việc bạn muốn làm.
Codex
mkdir -p ~/.codex/skills && curl -fsSL https://skill.dn1nguoi.com/z/cloud-k8s-410cb.tgz | tar xz -C ~/.codex/skills
Gọi trong Codex: $cloud-k8s – rồi mô tả công việc bạn muốn làm.
Hermes Agent
mkdir -p ~/.hermes/skills && curl -fsSL https://skill.dn1nguoi.com/z/cloud-k8s-410cb.tgz | tar xz -C ~/.hermes/skills
Gọi trong Hermes Agent: /cloud-k8s – rồi mô tả công việc bạn muốn làm.
DeepSeek
mkdir -p ~/.deepcode/skills && curl -fsSL https://skill.dn1nguoi.com/z/cloud-k8s-410cb.tgz | tar xz -C ~/.deepcode/skills
Gọi trong DeepSeek: /cloud-k8s – rồi mô tả công việc bạn muốn làm.
Nội dung SKILL.md
Nội dung SKILL.md gốc bằng tiếng Anh.
> ⚠️ AUTHORIZED USE ONLY
> This skill is for educational purposes or authorized security assessments only.
> You must have explicit, written permission from the system owner before using this tool.
> Misuse of this tool is illegal and strictly prohibited.
> Mandatory confirmation gate
> Before running any command that probes, exploits, changes, persists on, extracts data from, or attempts credential access against a target:
> 1. Ask the user to state the exact target URL, IP, account, or resource.
> 2. Ask the user to confirm written authorization and the permitted scope.
> 3. Show the exact command(s) and explain their expected effect.
> 4. Wait for explicit confirmation in the current conversation.
>
> Without that confirmation, remain read-only and provide defensive guidance only. Prefer a sandbox, disposable VM, or controlled lab.
Cloud / Container / Kubernetes Security
When to Use
- Assessing cloud workload or Kubernetes cluster security within an approved scope.
- Reviewing IAM/RBAC configurations for privilege-escalation paths.
适用场景
- 云元数据 SSRF(169.254.169.254 / IMDS)
- IAM 过度权限、公开存储桶、错误安全组
- Docker/containerd 逃逸路径评估
- Kubernetes RBAC、Secrets、Admission、供应链镜像
- 容器镜像漏洞(可联动
supply-chain-security/)
工作流
Phase 1 — 身份与边界
□ 当前身份:云 AK/SK、K8s SA、节点 SSH?
□ 范围:单账号 / 单 cluster / 单 namespace
□ 网络档:authorized_target_onlyPhase 2 — 云控制面
# 示例(按厂商替换;MUST 在授权账号内)
aws sts get-caller-identity
aws s3 ls
# Azure / GCP 对应 identity 命令□ 公开桶 / 错误 ACL
□ 元数据:IMDSv1 vs v2;SSRF 链
□ 角色可扮演(PassRole)与横向Phase 3 — 容器
□ 是否 privileged / hostPath / hostNetwork
□ capabilities(SYS_ADMIN 等)
□ 可写宿主机路径 → 逃逸候选
□ 镜像历史与已知 CVE → TrivyPhase 4 — Kubernetes
kubectl auth can-i --list
kubectl --context AUTHORIZED_CONTEXT get pods,svc -n AUTHORIZED_NAMESPACE
# Inspect Secret metadata only if explicitly in scope; do not dump secret values.
kubectl get clusterrolebindings□ SA token 挂载与权限
□ 危险 admission webhook 缺失
□ etcd / dashboard 暴露
□ 网络策略是否默认放行工具链
| 工具 | 用途 | 自举 |
|------|------|------|
| kubectl | 集群交互 | 手动 |
| trivy | 镜像/IaC | bootstrap trivy 若可用 |
| kube-bench / kubeaudit | CIS/配置 | 手动 |
| pacu / scoutsuite | 云审计(授权) | 手动 |
| nuclei | 已知云漏洞模板 | bootstrap nmap/nuclei 生态 |
参考
references/k8s-cloud-checklist.md- CTF 对照:
../../CTF-Sandbox-Orchestrator/competition-agent-cloud/ ../supply-chain-security/../pentest-tools/
路由上下文
上游: MASTER R23
下游: 拿到节点 shell → attack-chain / windows-ad;镜像漏洞 → supply-chain
MUST NOT: 未授权扫公有云其他租户
任务完成自检
- [ ] 是否限定在授权账号/cluster?
- [ ] 发现是否含复现与影响?
- [ ] 是否避免破坏性操作?
- [ ] 报告 / journal?
Limitations
- Cloud provider API calls may incur cost and trigger alerts; coordinate with the owner.
- Escape-path validation must stay inside disposable lab clusters.
> Adapted from [zhaoxuya520/reverse-skill](https://github.com/zhaoxuya520/reverse-skill) (MIT).
Skill liên quan
- cloud-penetration-testing – Thực hiện đánh giá bảo mật toàn diện cho hạ tầng đám mây trên Microsoft Azure, Amazon…
- cloudflare-pages – Triển khai site tĩnh và ứng dụng full-stack trên Cloudflare Pages với preview, functions…
- pinggy-tunnel – Tạo tunnel localhost qua SSH không cần cài đặt bằng Pinggy.
- cloudflare-workers – Xây dựng và triển khai edge function với Cloudflare Workers và Wrangler. Dùng cho API…
- cloudformation – Triển khai tài nguyên AWS bằng template CloudFormation. Tạo stack, dùng nested stack và…
- cloudish – Triển khai Dockerfile, thư mục mã nguồn hoặc image có sẵn lên Cloudish dưới dạng…
- quantized-export – Xuất mô hình đã tinh chỉnh và đã được duyệt sang định dạng triển khai phù hợp…
- kubernetes-operator – Dùng khi xây dựng Kubernetes Operator — controller tùy chỉnh đối chiếu trạng thái CRD…