Granite: GitHub Actions 权限的粒度运行时强制执行
Granite: Granular Runtime Enforcement for GitHub Actions Permissions
AI总结:
Granite通过在GitHub Actions中实现步骤级细粒度权限强制执行,有效降低CI/CD攻击面。
摘要:
现代软件项目使用自动化CI/CD流水线来优化其开发、构建和部署流程。GitHub Actions是流行的CI/CD平台,允许项目维护者通过可重用的组件(称为动作)创建自定义工作流——由连续步骤组成的步骤集合。由于完全特权动作带来的安全风险,GitHub提供了一种基于作业级别的权限模型,以控制工作流对仓库资源的访问。不幸的是,这种模型过于粗粒度,无法减少与权限滥用攻击相关的攻击面:作业内的所有动作共享授予作业的相同权限。这违反了最小权限原则,当受感染的动作利用授予的权限来破坏仓库资源时,可能导致更广泛的软件供应链攻击。在本文中,我们提出了Granite,这是一种基于运行时代理的系统,能够在工作流中以步骤粒度对GitHub Actions实施细粒度的权限。Granite在工作流执行期间透明地监控JavaScript和复合动作所发出的请求,并在运行时将其与预定义的步骤级策略进行检查。我们使用包含500个工作流、12,916个作业的数据集(来自使用GitHub Actions的最受欢迎的GitHub仓库)来评估Granite在兼容性、安全性和性能开销方面的表现。我们的分析显示,52.7%的工作流可以通过Granite保护免受权限滥用攻击。我们对20个最受欢迎的仓库(63个动作,58个工作流)进行了Granite的评估,通过10个权限滥用攻击在42个过度授权的工作流中验证了攻击防护,并测量了每个工作流平均55%(3.67秒)的开销,得出结论:Granite有效地减少了CI/CD攻击面。
英文摘要:
GitHub Actions is a popular CI/CD platform that lets maintainers build workflows from reusable third-party actions, organized into jobs of sequential steps. To control access to repository resources, GitHub enforces token permissions only at the job level. This violates the principle of least privilege: every step shares the job's full permissions, so a single compromised action can misuse all of them, as witnessed by the recent tj-actions compromise, enabling broader software supply chain attacks. We present Granite, the first system to enforce fine-grained, step-level permissions for GitHub Actions at runtime. Untrusted steps never hold the real token; a separate controller issues each step an identifier token and supplies the real token only to requests that meet the step's policy. Granite builds on GitHub's self-hosted runner, requires no workflow changes, and transparently handles JavaScript, composite, and Docker actions. Across 500 workflows (12,915 jobs) from the most-starred GitHub repositories, 46.3% of jobs are overprivileged and can be protected by Granite. On 46 repositories and 127 unique actions, Granite preserves the behavior of every job that runs on the unmodified runner, except one it blocks by design. Reproducing 10 permission-misuse attacks over 42 overprivileged jobs, including attempts to bypass its enforcement, Granite prevents all of them and removes write access from about 83.3% of the steps that hold it under GitHub's current model. Its average per-step overhead is 7.9%, making Granite a practical and effective tool to reduce the attack surface in CI/CD pipelines.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。