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

CFSSL

$ cfssl 官方出品 低风险
Cloudflare · 安全扫描与密钥管理 · BSD-2-Clause · macos / linux / windows

CFSSL(cfssl)是 Cloudflare 推出的命令行及 HTTP PKI 工具集,支持生成 CSR、签发证书、解析 X.509 元数据(cfssl certinfo)以及扫描线上 TLS 端点(cfssl scan)。几乎所有子命令都原生输出 JSON,便于 Agent 直接解析。

FCRS-1.0 综合评分
83 /100
良好 (Good)
中置信度 (源码/文档)
零摩擦安装命令
brew install cfssl
CLI vs MCP 选型建议 仅 CLI 可用

cfssl 直接在本地解析 X.509 文件、生成密钥/CSR 并探测 TLS 主机,原生输出 JSON 到标准输出。

Agent 友好度体检单

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

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

FCRS-1.0 六维评分拆解

Agent 友好度 21 / 25

certinfo、scan、gencert 与 genkey 均原生输出 JSON,且全参数驱动无交互阻塞。

  • Native JSON stdout across core subcommands
  • Zero interactive prompts
安全与权限边界 21 / 25

certinfo 与 scan 为纯只读操作,但 gencert/genkey 会在标准输出 JSON 中直接包含明文私钥内容。

  • Read-only TLS inspection commands
  • Stdout JSON from gencert contains private key material
安装与运行摩擦 13 / 15

提供静态 Go 二进制,可通过 brew、go install 与 GitHub Releases 安装,但拆分证书文件需配合 cfssljson。

  • Go binaries for macOS, Linux, and Windows
  • Common workflows expect cfssljson alongside cfssl
能力覆盖与边际价值 13 / 15

以 JSON 优先的流水线统一覆盖 CSR/CA 签发、X.509 解析与 TLS 端点扫描。

  • Unified PKI generation and TLS inspection
维护与来源背书 8 / 10

Cloudflare 官方仓库(cloudflare/cfssl),BSD-2-Clause 协议,产品成熟但发版节奏较缓。

  • First-party Cloudflare PKI project
文档与可验证性 7 / 10

子命令 --help 基本清晰,但部分高级 scan 类别和 JSON 字段结构需查阅源码或 Wiki。

  • README and subcommand usage summaries

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

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

通过命令行显式传入 JSON 格式的 CSR/CA 配置文件及本地私钥 .pem 文件运行。

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

BSD-2-Clause 开源 CLI,本地运行完全免费。

可复制到 CLAUDE.md / AGENTS.md 的安全护栏
# CFSSL (cfssl) Agent Rules
- Prefer `cfssl certinfo` and `cfssl scan` for read-only TLS inspection.
- Keep generated `*-key.pem` files outside version control and avoid printing private key JSON fields into logs.

Agent 高频安全命令配方

只读查询(安全推荐)

以 JSON 查看远程域名的 TLS 证书详情
cfssl certinfo -domain example.com

连接 example.com 并以 JSON 输出解析后的 X.509 主题、SAN、颁发者与有效期时间戳。

扫描主机的 TLS 协议与加密套件支持
cfssl scan -family=Connectivity,TLSHandshake example.com

针对 example.com 运行指定 TLS 诊断项,并输出结构化 JSON 扫描结果。

受控写入与预演

生成自签名根 CA 证书包
cfssl gencert -initca ca-csr.json | cfssljson -bare ca

基于 ca-csr.json 初始化根 CA,并通过 cfssljson 将输出的 JSON 拆分为 ca.pem 与 ca-key.pem。

核心优势

  • + cfssl certinfo 与 cfssl scan 原生输出 JSON,彻底替代脆弱的 openssl 文本解析。
  • + 全程非交互式运行,可通过 cfssljson 无缝管道处理。

注意事项与踩坑点

  • ! gencert 与 genkey 会在标准输出 JSON 中打印私钥 PEM 内容,应直接管道交给 cfssljson 落盘而不回显到 Agent 上下文。
  • ! 相较于 step 等新兴 PKI 工具,上游版本更新节奏较慢。

已验证兼容的 Agent 宿主

Claude Code Codex CLI Gemini CLI