Communitygithub.com

cloud-k8s

用于授权的云、容器和Kubernetes安全评估,包括元数据SSRF、IAM配置错误、容器逃逸路径和集群RBAC审查。

cloud-k8s 是什么?

该技能专为云、容器和Kubernetes环境的安全评估而设计,适用于已获得明确书面授权的审计场景。它涵盖云元数据SSRF(如IMDSv1/v2)、IAM过度权限、公开存储桶、错误安全组,以及Docker/containerd逃逸路径、Kubernetes RBAC、Secrets、Admission控制、镜像供应链漏洞等关键领域。工作流分为四个阶段:身份与边界确认、云控制面审计、容器逃逸评估、Kubernetes集群安全审查,并提供对应的命令行示例和检查清单。技能支持多个平台(AWS、Azure、GCP、K8s),并依赖kubectl、trivy、kube-bench、pacu等工具链,其中部分工具需手动安装。核心原则是严格遵守授权范围,禁止对未授权租户或集群进行扫描,确保操作的合法性与安全性。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/zhaoxuya520/reverse-skill/tree/main/skills/cloud-k8s

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

Cloud / Container / Kubernetes Security

操作要求(读完后立刻执行)

  1. NOW: 读取 ../field-journal/precedent-pentest.md — 云/K8s 测试必须书面授权
  2. NOW: 初始化案例与范围;明确账号边界、禁止破坏性操作
  3. NOW: 确认是云元数据/容器/K8s/IAM,而非普通 Web 扫描(后者请使用 pentest-tools/)
  4. NEXT: 索引工具;kubectl/aws/gcloud 等多为手动安装
  5. ACT: 从「身份与暴露面」开始,禁止默认全网扫描

适用场景

  • 云元数据 SSRF(169.254.169.254 / IMDS)
  • IAM 过度权限、公开存储桶、错误安全组
  • Docker/containerd 逃逸路径评估
  • Kubernetes RBAC、Secrets、Admission控制、供应链镜像
  • 容器镜像漏洞(可联动 supply-chain-security/)

工作流

阶段 1 — 身份与边界

□ 当前身份:云 AK/SK、K8s ServiceAccount、节点 SSH?
□ 范围:单账号 / 单集群 / 单命名空间
□ 网络限制:仅允许授权的目标

阶段 2 — 云控制面

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

阶段 3 — 容器

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

阶段 4 — Kubernetes

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

工具链

工具用途自举方式
kubectl集群交互手动安装
trivy镜像/IaC 扫描若可用则自动安装 trivy
kube-bench / kubeauditCIS基准/配置检查手动安装
pacu / scoutsuite云审计(授权)手动安装
nuclei已知云漏洞模板自动安装 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 禁止: 未授权扫描公有云其他租户

任务完成自检

  • 是否限定在授权账号/集群内?
  • 发现结果是否包含复现步骤与影响说明?
  • 是否避免破坏性操作?
  • 是否已写入报告或日志?

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

api-security

Use for authorized security assessment of REST, GraphQL, WebSocket, or SOAP APIs, including discovery, authentication, authorization, rate-limit, and CI/CD testing.

apk-reverse

在 CLI 环境下做 Android APK 逆向时使用。适用于 APK 解包、Java 反编译、smali 修改、重打包、Frida 动态 Hook,以及按需切换到 so/native 分析。优先使用本机已安装的 jadx、apktool、frida、adb、ida-reverse、radare2。

attack-chain

Use for authorized multi-stage attack-path planning and orchestration when a task spans reconnaissance, initial access, privilege escalation, lateral movement, or impact assessment. Route single-stage tasks directly to their specialist skill.

binary-diff

|

binary-ninja-reverse

Use for authorized binary analysis in Binary Ninja, including HLIL/MLIL/LLIL inspection, strings/imports/exports, cross-references, types, patch review, Python API automation, and optional Binary Ninja MCP or localhost HTTP integration.

browser-automation

|

browser-extension-reverse

Use for authorized reverse engineering of browser extensions (Chrome/Firefox) including manifest analysis, background workers, and extension-based credential or traffic logic recovery.

case-review

Reviews a reverse-skill case package for scope readiness, Evidence to Finding to Path traceability, work item coverage, timeline references, and optional artifact hash integrity before report handoff.

code-audit

Use for authorized source-code security review and SAST workflows including Semgrep, CodeQL patterns, dangerous API hunting, and fix verification.

ctf-sandbox

Thin PRIMARY for CTF / AWD / 靶场 multi-type orchestration. Hands off to the sidecar CTF-Sandbox-Orchestrator. Use when the user says CTF, AWD, 靶场, or 比赛题 and no more specific pwn/APK/IDA route already won.

database-security

Use for authorized database security assessment covering PostgreSQL/MySQL/MSSQL/Mongo/Redis exposure, authz, UDF/command paths, and misconfiguration review.

diagram-generator

generate, refine, validate, and render diagrams from natural language, notes, code snippets, schemas, tables, or existing diagram source. use for flowcharts, swimlanes, sequence diagrams, state diagrams, er diagrams, class diagrams, architecture/c4-style diagrams, dependency graphs, gantt charts, mind maps, user journeys, sankey-style flows, org charts, network graphs, and other visual models. supports mermaid by default, graphviz dot for complex graph layout, plantuml for uml-heavy engineering diagrams, and svg output when direct markup is more reliable.

digital-forensics

Use for authorized digital forensics including memory dumps, disk timelines, PCAP investigation, artifact triage, and IR evidence preservation.

docs-generator

|

dotnet-reverse

.NET / C# 二进制逆向。当目标是 .NET assembly(PE 头含 CLR、.exe/.dll 托管程序)、C# 编译产物(含 NativeAOT)、红队 Sharp* 工具(Rubeus / SharpHound / SharpHound 等)、.NET 混淆程序(ConfuserEx / SmartAssembly / Babel / Eazfuscator)、.NET loader / info-stealer / 套壳 malware 时使用。优先用 dnSpyEx + de4dot,需要 AI 直接操作时联动 dnSpy MCP。不用于纯 native 二进制(走 reverse-engineering / ida-reverse)。

edr-bypass-re

|

email-security

Use for authorized email security review including phishing analysis, header authentication (SPF/DKIM/DMARC), BEC patterns, and mailbox token abuse research.

firmware-pentest

|

ghidra-reverse

Use for free/open reverse engineering with Ghidra (headless or GUI), including decompile, cross-refs, and optional Ghidra MCP workflows when IDA is unavailable.

go-rust-reverse

Use for reverse engineering stripped Go and Rust binaries including runtime recognition, pclntab/moduel data recovery, panic strings, and idiomatic decompilation recovery.

相关技能