Fairwinds Polaris
$ polaris 官方出品 低风险polaris(FairwindsOps/polaris)可对本地 Kubernetes 清单、Helm Chart 与在线集群执行安全、健康探针与资源配额最佳实践审计。polaris audit 默认输出 JSON(--format json),支持 --audit-path 与阈值退出码。
brew install polaris polaris audit 原生默认输出 JSON,可在毫秒级完成本地 YAML/Helm 目录离线校验,远优于 MCP 往返。
Agent 友好度体检单
当前为静态评估(本机尚未安装或尚未运行探针)。可在本地运行 npm run data:probe 并提交 data/probes/ 升级为实测证据。
FCRS-1.0 六维评分拆解
polaris audit 默认输出 JSON,支持 --only-show-failed-tests、--color=false 以及 --set-exit-code-on-danger / --set-exit-code-below-score 退出码门控。
--format jsonis the default onpolaris audit- Supports
--only-show-failed-testsand--set-exit-code-on-danger
覆盖本地文件、Helm Chart 与在线集群的纯只读审计,不产生任何集群变更。
- Purely read-only validation of manifests and clusters
跨 macOS、Linux、Windows 的单文件静态 Go 二进制,可通过 Homebrew 或 GitHub Releases 安装。
- Cross-platform binary via
brew install polaris
单次执行即可全面核查健康探针、CPU/内存限额、securityContext 与镜像标签规范。
- Built-in best-practice checks + custom JSON Schema checks
由 Fairwinds 官方(FairwindsOps/polaris)基于 Apache-2.0 协议维护。
- Official
FairwindsOps/polarisrepository
polaris.docs.fairwinds.com 文档站点提供完整的检查项目录与 CLI 参数说明。
- Official docs at polaris.docs.fairwinds.com
安全边界、鉴权与放权指南
使用 --audit-path 或 --helm-chart 离线扫描无需凭证;仅在审计在线集群时读取 ~/.kube/config(KUBECONFIG)。
CLI 基于 Apache-2.0 免费开源,本地运行无需外部 SaaS。
# Polaris Agent Rules - Prefer `--audit-path <dir>` or `--helm-chart <dir>` for offline manifest checks before applying to clusters. - Pass `--format json --only-show-failed-tests` to keep audit payloads concise. - Use `--set-exit-code-on-danger` in verification loops.
Agent 高频安全命令配方
只读查询(安全推荐)
polaris audit --audit-path ./deploy --format json --only-show-failed-tests
离线扫描本地 YAML 清单并仅返回未通过检查项的精简 JSON。
polaris audit --audit-path ./deploy --set-exit-code-on-danger --format json
一旦检测到高严重度(danger)最佳实践问题即返回非零退出码。
核心优势
- +
polaris audit默认即输出 JSON,配合--only-show-failed-tests可大幅节省 Token。 - + 零副作用支持本地 YAML、Helm Chart 与在线集群审计。
- + 内置
--set-exit-code-on-danger与--set-exit-code-below-score自动化门控开关。
注意事项与踩坑点
- ! 默认规则包含部分强主观告警(如未设置 CPU limit),通常需通过
-c config.yaml调优。 - ! 未传
--only-show-failed-tests时完整 JSON 会包含大量已通过的检查记录。