CLI 目录 横向对比 FCRS-1.0 标准 /llms.txt
← 返回 CLI 目录

Fairwinds Polaris

$ polaris 官方出品 低风险
Fairwinds · 云原生与基础设施 · Apache-2.0 · macos / linux / windows

polaris(FairwindsOps/polaris)可对本地 Kubernetes 清单、Helm Chart 与在线集群执行安全、健康探针与资源配额最佳实践审计。polaris audit 默认输出 JSON(--format json),支持 --audit-path 与阈值退出码。

FCRS-1.0 综合评分
90 /100
极佳 (Excellent)
中置信度 (源码/文档)
零摩擦安装命令
brew install polaris
CLI vs MCP 选型建议 优先选 CLI

polaris audit 原生默认输出 JSON,可在毫秒级完成本地 YAML/Helm 目录离线校验,远优于 MCP 往返。

Agent 友好度体检单

✓ 原生 JSON 输出
— 字段裁剪
✓ 无头非交互
— 支持 Dry-Run
— 只读模式开关
✓ 支持 NO_COLOR
✓ 自省/Schema 发现
— 官方 SKILL.md

当前为静态评估(本机尚未安装或尚未运行探针)。可在本地运行 npm run data:probe 并提交 data/probes/ 升级为实测证据。

FCRS-1.0 六维评分拆解

Agent 友好度 23 / 25

polaris audit 默认输出 JSON,支持 --only-show-failed-tests、--color=false 以及 --set-exit-code-on-danger / --set-exit-code-below-score 退出码门控。

  • --format json is the default on polaris audit
  • Supports --only-show-failed-tests and --set-exit-code-on-danger
安全与权限边界 23 / 25

覆盖本地文件、Helm Chart 与在线集群的纯只读审计,不产生任何集群变更。

  • Purely read-only validation of manifests and clusters
安装与运行摩擦 15 / 15

跨 macOS、Linux、Windows 的单文件静态 Go 二进制,可通过 Homebrew 或 GitHub Releases 安装。

  • Cross-platform binary via brew install polaris
能力覆盖与边际价值 13 / 15

单次执行即可全面核查健康探针、CPU/内存限额、securityContext 与镜像标签规范。

  • Built-in best-practice checks + custom JSON Schema checks
维护与来源背书 8 / 10

由 Fairwinds 官方(FairwindsOps/polaris)基于 Apache-2.0 协议维护。

  • Official FairwindsOps/polaris repository
文档与可验证性 8 / 10

polaris.docs.fairwinds.com 文档站点提供完整的检查项目录与 CLI 参数说明。

  • Official docs at polaris.docs.fairwinds.com

安全边界、鉴权与放权指南

鉴权方式
无需鉴权 本地配置文件
凭证存储位置

使用 --audit-path 或 --helm-chart 离线扫描无需凭证;仅在审计在线集群时读取 ~/.kube/config(KUBECONFIG)。

潜在副作用
只读查询 本地写入
费用与配额提示

CLI 基于 Apache-2.0 免费开源,本地运行无需外部 SaaS。

可复制到 CLAUDE.md / AGENTS.md 的安全护栏
# 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 高频安全命令配方

只读查询(安全推荐)

离线审计本地清单并仅以 JSON 输出失败项
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 会包含大量已通过的检查记录。

已验证兼容的 Agent 宿主

Claude Code Codex CLI Gemini CLI