作者:最佳实践工作组[1],Laurent Simon(谷歌),Azeem Shaikh(谷歌),Jose Palafox(GitHub)

今天,开源安全基金会的两名成员谷歌[2]和GitHub[3]正在合作发布Scorecards V4[4],其中包括一个新的 GitHub Action,一个额外的安全检查,以及开源生态系统加大规模的扫描。

Scorecards 项目于去年作为一个自动化的安全工具启动,以帮助开源用户理解他们所使用的依赖项的风险。尽管世界是在开放源码软件上运行的,但许多开放源码项目至少有一种危险的行为[5]——例如,不启用分支保护、不固定依赖项或不启用自动依赖项更新。记分卡使得在使用包之前对其进行评估变得简单:使用一行代码的扫描运行将返回从 0 到 10 的各个分数,为项目的每个安全实践(“检查[6]”)打分,并为项目的总体安全性打分。今天发布的 Scorecards GitHub Action 使开发者比以往任何时候都更容易保持他们的安全态势。

帮助开发人员

Scorecards GitHub Workflow Action

以前,记分卡需要手动运行,以判断对项目的更改如何影响其安全性。新的Scorecards GitHub Action[7]会自动化这个过程:一旦安装,Action 会在任何仓库更改后运行 Scorecards 扫描。维护者可以在 GitHub 的扫描仪表板中查看安全警告,并纠正任何由更改引入的风险供应链实践。

如上例所示,每个警报包括风险的严重程度(低、中、高或严重)、出现问题的文件和行(如果适用),以及修复问题的补救步骤。

几个关键的开源项目已经采用了 Scorecards Action,包括Envoy[8]、distroless[9]、cosign[10]、rekor[11]、kaniko[12]。该 Action 可以自由使用,并可以按照说明[13]安装在任何公共仓库上。

新检查

我们不断地增加新的安全检查,以帮助开发人员评估他们项目的风险。这个版本增加了 License 检查,它检测项目许可证的存在,以及Dangerous-Workflow 检查[14],它检测使用pull_request_target[15]触发器的危险情况和 GitHub 工作流中脚本注入的风险。危险工作流(Dangerous Workflow)是第一个带有“严重(Critical)”风险等级等级的记分卡检查,因为这些模式很容易被利用——对于这些工作流,一个单一的 pull 请求就可以将被破坏的代码引入到项目中。新的记分卡检查通知用户他们的项目中存在这些漏洞,并提供修复该问题的指导。

扩大数据可用性

Scorecards 团队每周对一组关键开源项目进行扫描,在任何给定时间创建整个开源生态系统安全性的快照。在过去的几个月中,我们将扫描范围从 50,000 个项目增加到了 100 万个项目,这些项目根据直接依赖项的数量确定为最关键的项目,从而更详细地了解生态系统并加强供应链安全,用户看到依赖关系覆盖范围有所提高。使用 Scorecards V4,每周的扫描现在反映每个仓库的 0-10 评级等级,而不是以前版本的通过-失败结果,这为数据增加了更多的粒度。扫描结果可通过 ScorecardsAPI[16]、OpenSSF 指标仪表板[17]和[Open Source Insights](Open Source Insights "Open Source Insights")公开获得。

日益增长的社区

自从我们最初发布以来,我们一直在改进我们的代码库,这要感谢不断扩大的 Scorecards 社区。在 2021 年,我们增加到超过 40 位独立贡献者,平均每周超过 16 个提交(总共 860 个提交),并结束了 270 个问题。我们热烈欢迎新的贡献者;如果你想加入到这个有趣的游戏中,看看这个列表,这是一个很好的新手问题[18]

以下是一些采用记分卡的项目的例子:

“kaniko is a popular open source container image builder for Kubernetes, so it’s very important to maintain the security of the repository and the codebase. The ossf/scorecard Github Action takes care of this for us and continuously monitors the repository. It took less than 5 minutes to install and quickly analyzed the repo and identified easy ways to make the project more secure.” – Priya Wadhwa, Kaniko

“We rely on scorecards in distroless to ensure we follow secure development best practices. Secure source and config means safer base images for all our users.” – Appu Goundan, Distroless

“Scorecards provides us the ability to rapidly litmus test new dependencies in the Envoy project. We have found this a valuable step in vetting new dependencies for well known attributes and we have integrated Scorecards into our dependency acceptance criteria. Machine checkable properties are an essential part of a sound security process.” – Harvey Tuch, Envoy

强化供应链

我们预计,2022 年将是人们对供应链安全的重要性日益认识的一年。如果你的新年决心是更加关注你的项目的安全性,使用 Scorecards GitHub Action 是最简单的开始方法之一。只需在仓库上安装[19]工作流,并按照修复说明处理出现的问题。每一个增量的改进都有助于为每个人加强开源生态系统。

如需更多信息,请参阅版本说明[20],如有任何问题或建议,请与我们联系[21]

参考资料

[1] 最佳实践工作组: https://github.com/ossf/wg-best-practices-os-developers

[2] 谷歌: https://security.googleblog.com/2022/01/reducing-security-risks-in-open-source.html

[3] GitHub: https://github.blog/2022-01-19-reducing-security-risk-oss-actions-opensff-scorecards-v4/

[4] Scorecards V4: https://github.com/ossf/scorecard

[5] 少有一种危险的行为: https://security.googleblog.com/2021/07/measuring-security-risks-in-open-source.html

[6] 检查: https://github.com/ossf/scorecard#scorecard-checks

[7] Scorecards GitHub Action: https://github.com/marketplace/actions/ossf-scorecard-action

[8] Envoy: https://github.com/envoyproxy/envoy

[9] distroless: https://github.com/GoogleContainerTools/distroless

[10] cosign: https://github.com/sigstore/cosign

[11] rekor: https://github.com/sigstore/rekor

[12] kaniko: https://github.com/GoogleContainerTools/kaniko

[13] 说明: https://github.com/marketplace/actions/ossf-scorecard-action

[14] Dangerous-Workflow 检查: https://github.com/ossf/scorecard/blob/main/docs/checks.md#dangerous-workflow

[15] pull_request_target: https://securitylab.github.com/research/github-actions-preventing-pwn-requests/

[16] API: https://github.com/ossf/scorecard#public-data

[17] OpenSSF 指标仪表板: https://metrics.openssf.org/

[18] 新手问题: https://github.com/ossf/scorecard/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22

[19] 安装: https://github.com/ossf/scorecard-action#installation

[20] 版本说明: https://github.com/ossf/scorecard/releases/tag/v4.0.0

[21] 联系: https://github.com/ossf/scorecard#connect-with-the-scorecards-community

声明:本文来自LFAPAC,版权归作者所有。文章内容仅代表作者独立观点,不代表安全内参立场,转载目的在于传递更多信息。如有侵权,请联系 anquanneican@163.com。