Kubescape
$ kubescape 基金会 低风险kubescape 可针对在线 Kubernetes 集群、本地 YAML 清单、Helm Chart 与容器镜像执行 NSA、MITRE 和 CIS 框架扫描。它支持 --format json、--output、命名空间过滤以及离线框架检查。
brew install kubescape kubescape scan 可直接针对本地文件或 kubeconfig 输出 --format json 合规报告,无需 MCP 中转。
Agent 友好度体检单
当前为静态评估(本机尚未安装或尚未运行探针)。可在本地运行 npm run data:probe 并提交 data/probes/ 升级为实测证据。
FCRS-1.0 六维评分拆解
支持 --format json、--output <file> 与命名空间过滤,但完整 JSON 报告体积较大,且默认首次运行会拉取规则框架。
kubescape scan --format json --output- Namespace filters
--include-namespaces/--exclude-namespaces
本地文件与集群 API 扫描默认均为只读;仅在显式开启 --enable-host-scan 或 --submit 时才会部署临时 DaemonSet 或外发报告。
- Read-only manifest and API server scanning by default
--enable-host-scandeploys a temporary cluster DaemonSet
跨 macOS、Linux、Windows 的单文件静态 Go 二进制,可通过 Homebrew 或 GitHub Releases 安装。
- Cross-platform binary via
brew install kubescape
单工具集成安全基线合规、RBAC 权限图谱分析与镜像 CVE 漏洞扫描。
- NSA/MITRE/CIS posture + RBAC + image vulnerability scanning
CNCF 孵化项目(kubescape/kubescape),采用 Apache-2.0 协议。
- CNCF
kubescape/kubescaperepository
仓库内的 docs/cli-reference.md 与 kubescape.io/docs/ 文档完善。
- Official docs and CLI reference markdown
安全边界、鉴权与放权指南
本地 YAML/镜像扫描无需鉴权;集群扫描读取 ~/.kube/config(--kube-context),下载的规则工件缓存于 ~/.kubescape/。
CLI 基于 Apache-2.0 免费开源;无需绑定任何云端商业 SaaS。
# Kubescape Agent Rules - Always pass `--format json --output <file>.json` so verbose ASCII tables do not flood context. - Scope live cluster scans with `--include-namespaces` and `--kube-context`. - Avoid `--enable-host-scan` unless explicitly approved, as it deploys a temporary DaemonSet into the cluster.
Agent 高频安全命令配方
只读查询(安全推荐)
kubescape scan framework nsa ./manifests --format json --output nsa-report.json
离线扫描本地 YAML 文件并生成机器可读的 JSON 合规报告。
kubescape scan --include-namespaces production --format json --output prod-scan.json
在不部署节点 DaemonSet 的前提下,仅针对指定命名空间执行只读审计。
核心优势
- + 本地清单与在线集群扫描均支持
--format json与--output。 - + 默认只读访问 API Server,无需预先在集群部署组件。
- + 集成 NSA、CIS、MITRE、RBAC 与镜像 CVE 检查于一体。
注意事项与踩坑点
- ! 全集群 JSON 报告体积较大,建议写入
--output <file>.json后配合jq提取摘要。 - ! 开启
--enable-host-scan会在节点部署 DaemonSet,而--submit会将结果上传至外部平台。