valorisa/GitHub-Actions-Audit

GitHub: valorisa/GitHub-Actions-Audit

用于审计和治理 GitHub Actions 工作流中浮动版本引用及 runtime 声明的 Python CLI 工具,弥补 Dependabot 在供应链版本治理方面的不足。

Stars: 1 | Forks: 0

# GitHub Actions 审计 GitHub Actions workflow 版本的审计和自动更新工具 — 包括 actions 和 runtimes(Go、Node...),能够清晰处理浮动 refs (`@master`、`@latest`)以及 GitHub Releases 生态系统之外的版本。 **状态:** 早期搭建阶段(parser、classifier、带缓存的 GitHub API resolver、本地 + 远程多 repo 发现)。版本比较、 YAML 重写、diff 生成和 PR 自动化尚未实现。 ## 为什么不直接使用 Dependabot? [Dependabot](https://docs.github.com/en/code-security/dependabot) 已经 开箱即用地处理了 GitHub Actions 的版本更新 —— 如果这正是你 所需要的,那就用它吧,它是免费的且零维护。`gha-audit` 的存在是为了 解决 Dependabot 未涵盖的问题:将浮动 branch refs 标记为安全 风险(而不仅仅是提示“无可用更新”),审计 workflow `env:` 块中声明的 runtime 版本,以及检测嵌入在 `run:` 步骤中的工具安装(`go install ...`)。 ## 架构 ``` gha_audit/ ├── models.py # dataclasses partagées (RefKind, ActionUsage, ...) ├── config.py # policy centrale (cache TTL, runtimes surveillés) ├── parser/ # extraction pure, aucun I/O réseau │ ├── ref_classifier.py # classification owner/repo@ref │ └── workflow_parser.py # extraction depuis le YAML (ruamel, round-trip) ├── resolver/ # résolution des dernières versions stables │ ├── cache.py # cache disque à TTL │ └── github_client.py # wrapper httpx + endpoints API GitHub └── discovery/ # où trouver les workflows ├── local_discovery.py # scan filesystem (ex: ~/Projets) └── remote_discovery.py # scan via API, sans clone ``` ## 开发 ``` pip install -e ".[dev]" pytest tests/ -v ``` ## GitHub Actions 审计 (FR) GitHub Actions workflow 版本的审计和自动更新工具 — 包括 actions 和 runtimes(Go、Node...),能够清晰处理浮动 refs (`@master`、`@latest`)以及 GitHub Releases 生态系统之外的版本。 **状态:** 早期搭建阶段(parser、classifier、带缓存的 GitHub API resolver、本地 + 远程多 repo 发现)。版本比较、 YAML 重写、diff 生成和 PR 自动化尚未实现。 ## 为什么不直接使用 Dependabot? [Dependabot](https://docs.github.com/en/code-security/dependabot) 已经 开箱即用地处理了 GitHub Actions 的版本更新 —— 如果这正是你 所需要的,那就用它吧,它是免费的且零维护。`gha-audit` 的存在是为了 解决 Dependabot 未涵盖的问题:将浮动 branch refs 标记为安全 风险(而不仅仅是提示“无可用更新”),审计 workflow `env:` 块中声明的 runtime 版本,以及检测嵌入在 `run:` 步骤中的工具安装(`go install ...`)。 ## 开发 ``` pip install -e ".[dev]" pytest tests/ -v ``` ## License MIT — 请参阅 [LICENSE](LICENSE)。
标签:DevSecOps, GitHub Actions, Python, StruQ, 上游代理, 安全可观测性, 安全规则引擎, 无后门, 版本控制, 自动笔记, 运行时操纵, 逆向工具