OpenSSF Scorecard
$ scorecard 基金会 低风险OpenSSF Scorecard(scorecard)针对分支保护、依赖固定、CI 令牌权限等供应链安全项对开源或内部仓库进行自动化评估。支持 --format=json、--format=sarif 与 --local 本地目录扫描,适合 Agent 执行确定性审计。
brew install scorecard scorecard 可直接运行完整供应链启发式检测并输出精简的 --format=json 或 --format=sarif 结果,无需额外的 MCP 工具 Schema 开销。
Agent 友好度体检单
当前为静态评估(本机尚未安装或尚未运行探针)。可在本地运行 npm run data:probe 并提交 data/probes/ 升级为实测证据。
FCRS-1.0 六维评分拆解
支持 --format=json、--format=sarif、--checks 过滤以及非交互式执行,退出码稳定可预期。
- Native
--format=jsonand--checkssub-selection - Fully headless execution via
GITHUB_AUTH_TOKENor--local
严格只读;--local 完全离线运行,远程扫描仅需只读权限的 GitHub 令牌。
- Zero repository or local filesystem mutations
- Supports offline
--localinspection
以单一 Go 二进制发布,可通过 brew、go install、Docker 和 GitHub Releases 跨平台安装。
- Single static Go binary with zero runtime dependencies
单条命令聚合 18+ 项供应链安全启发式检查,省去手写 GitHub API 检测脚本。
- Automated checks for pinning, branch protection, and workflows
由 OpenSSF 基金会维护(ossf/scorecard),采用 Apache-2.0 协议并持续发布。
- Maintained under OpenSSF governance
各检查项说明详尽,--help 参数文档清晰。
- Detailed check docs in
ossf/scorecardrepository
安全边界、鉴权与放权指南
远程 GitHub API 检查从环境变量读取 GITHUB_AUTH_TOKEN;--local 扫描可离线运行而无需凭据。
Apache-2.0 开源 CLI 免费;远程 GitHub 检测受 GITHUB_AUTH_TOKEN API 速率限制约束。
# OpenSSF Scorecard (scorecard) Agent Rules - Always pass `--format=json` (or `--format=sarif`) and filter with `--checks` when auditing targeted controls. - Set `GITHUB_AUTH_TOKEN` with read-only public/repo scope for remote `--repo` scans.
Agent 高频安全命令配方
只读查询(安全推荐)
scorecard --repo=github.com/owner/repo --format=json --show-details
对 github.com/owner/repo 运行全部检查,并通过 --show-details 输出带修复上下文的结构化 JSON。
scorecard --local=. --checks=Pinned-Dependencies,CI-Tests --format=json
使用 --local=. 进行离线分析,并通过 --checks 限定检查项以减少耗时和输出体积。
核心优势
- + 结构化的
--format=json与--format=sarif输出可直接接入 Agent 的安全分诊流程。 - + 离线
--local模式结合--checks过滤让本地审计快速且自包含。
注意事项与踩坑点
- ! 未配置
GITHUB_AUTH_TOKEN时,远程--repo评估容易失败或触发限流。