首页
学习
活动
专区
圈层
工具
发布
社区首页 >专栏 >安全:SBOM的价值

安全:SBOM的价值

作者头像
CNCF
发布于 2022-03-28 14:12:12
发布于 2022-03-28 14:12:12
1.5K0
举报
文章被收录于专栏:CNCFCNCF

你不可能经常重构一个成功的项目,但我们在两年前就这样做了。Flux 项目[1]那时候已经有个良好的开端,有许多满意的用户[2],我们将它的许多设计原则放在了我们的脑海中:

  • 拉与推:如果你还没有读过这篇 2018 年的关于你为什么想要拉的文章[3],它所说的仍然是正确的。
  • 最少的特权。
  • 重用最佳实践、库和工具,例如 client-go 和 helm API。
  • 我们将在后面进一步解释。

我们为什么要重新设计和重写 Flux?Flux Legacy(v1)版本在 2016 年年中启动,虽然它工作得很好,而且现在看来仍然很好,但它并没有从 Kubernetes 领域的更近期的开发中获益,比如控制器运行时[4],因为它比 Kubernetes 的开发早得多。

另外,将 Flux 重写为一组非常有针对性的控制器是个独特的机会,可以减少这些独立子项目的范围(从而减少攻击面),并使测试和调试变得更加容易。以及可重用性。

综上所述,我们相信关于 Flux 及其安全性考虑和特性的博客系列是合适的,我们将从讨论 SBOM 开始。

SBOM 是什么?

由 Flux 0.26 版本开始,我们为每个单独的控制器发布了一个 SBOM。我们在每月更新[5]的博客文章中报道了这一点。

那么,SBOM 是什么?它是软件材料清单(Software Bill of Materials)的缩写。维基百科将其定义为

A software bill of materials (SBOM) is a list of components in a piece of software. Software vendors often create products by assembling open source and commercial software components. The SBOM describes the components in a product. It is analogous to a list of ingredients on food packaging: where you might consult a label to avoid foods that may cause allergies, SBOMs can help organizations or persons avoid consumption of software that could harm them. The concept of a BOM is well-established in traditional manufacturing as part of supply chain management. A manufacturer uses a BOM to track the parts it uses to create a product. If defects are later found in a specific part, the BOM makes it easy to locate affected products.

对于 Flux 项目,我们在每个版本中都会发布一个软件材料清单(SBOM)。SBOM 通过Syft[6]软件生成SPDX[7]格式。

spdx.json 文件可以在 GitHub 发布页面下载,例如:

代码语言:javascript
复制
curl -sL https://github.com/fluxcd/flux2/releases/download/v0.25.3/flux_0.25.3_sbom.spdx.json | jq

检查 JSON 数据,你将看到,对于构建和发布版本所需的每个文件和库,你可以验证许可证、来源、版本和校验。

那些看似开销很大、不必要的记录,很快就会变成有用的信息,因为它允许你:

  • 验证工件的来源和完整性
  • 容易地检查依赖项的 CVE 和已知安全问题
  • 获得完整供应链的整体视图,了解你堆栈的依赖关系和开源项目使用状况

因为它是结构化数据,所以上面的所有操作都可以用自动化的编程方式完成。

大型组织,公司或政府,已经在采用 SBOM,并根据 SBOM 提供的信息做出决策。一些人开始要求使用中的软件采用 SBOM。一个很好的例子是美国政府要求软件供应商提供 SBOM[8]。

SBOM 用例

以下是一些更具体的例子,说明了 Flux 的 SBOM:

  • 依赖项的安全警报将是最明显的用例。如果检测到 CVE,你可以检查 SBOM,并查看你正在使用的组件是否受到任何方式的影响。
  • 很容易确定某个组件是何时创建的以及如何创建的。除此之外,拥有了所有组件的许可信息,知道权利和义务(重新分发、更改等)。
  • 自动化允许你在检测到遵从性问题时发送警报,例如,如果更新/替换依赖关系的许可发生更改。
  • 缺少组件或需要的构建文件。不兼容的许可证等等。

将所有这些自动化的一个例子是将 SBOM 存储在https://grafeas.io/中。这样,你可以搜索:

  • 从已知有安全问题的特定 Github 提交构建的镜像。
  • 由某个被入侵的构建器的某个版本构建的所有镜像。
  • 在项目中找到所有受 CVE-1234 影响的镜像。

对于策略实施,kritis[9]可以用来利用 Grafeas 内部的 SBOM 提供的信息来实施集群内部的策略,从而实现应用程序的自动阻塞,例如,当应用程序容易受到特定 CVE 的攻击时。

如果你已经读到这里,并且你正在组织中使用 SBOM,也请让我们知道你从 SBOM 中得到了什么!

更多信息

如果你想了解更多关于 SBOM 的历史和发展,你可以阅读这篇来自ChainGuard 的优秀文章[10]。

在撰写本文时,Syft 还没有根据文件内容对许可证进行分类[11],但正在考虑中。

以下是所有最新 Flux 控制器和 CLI(2022 年 02 月 09 日)的 SBOM。

Project

SBOM

Dependencies & Licenses

flagger

1.17.0[12]

1.17.0[13]

flux2

0.26.2[14]

0.26.2[15]

helm-controller

0.16.0[16]

0.16.0[17]

image-automation-controller

0.20.0[18]

0.20.0[19]

image-reflector-controller

0.16.0[20]

0.16.0[21]

kustomize-controller

0.20.1[22]

0.20.1[23]

notification-controller

0.21.0[24]

0.21.0[25]

source-controller

0.21.2[26]

0.21.2[27]

这只是我们为确保你们的安全而采取的又一项措施。

参考资料

[1]Flux 项目: https://fluxcd.io/

[2]满意的用户: https://fluxcd.io/adopters/#flux-v1

[3]文章: https://www.weave.works/blog/why-is-a-pull-vs-a-push-pipeline-important

[4]控制器运行时: https://github.com/kubernetes-sigs/controller-runtime

[5]每月更新: https://fluxcd.io/blog/2022/01/january-update/#-security-enhancements

[6]Syft: https://github.com/anchore/syft

[7]SPDX: https://spdx.dev/

[8]美国政府要求软件供应商提供 SBOM: https://www.whitehouse.gov/briefing-room/presidential-actions/2021/05/12/executive-order-on-improving-the-nations-cybersecurity/

[9]kritis: https://github.com/grafeas/kritis

[10]ChainGuard 的优秀文章: https://blog.chainguard.dev/what-an-sbom-can-do-for-you/

[11]根据文件内容对许可证进行分类: https://github.com/anchore/syft/issues/656

[12]1.17.0: https://github.com/fluxcd/flagger/releases/download/v1.17.0/flagger_1.17.0_sbom.spdx.json

[13]1.17.0: https://deps.dev/go/github.com%2Ffluxcd%2Fflagger/v1.17.0/dependencies

[14]0.26.2: https://github.com/fluxcd/flux2/releases/download/v0.26.2/flux_0.26.2_sbom.spdx.json

[15]0.26.2: https://deps.dev/go/github.com%2Ffluxcd%2Fflux2/v0.26.2/dependencies

[16]0.16.0: https://github.com/fluxcd/helm-controller/releases/download/v0.16.0/helm-controller_0.16.0_sbom.spdx.json

[17]0.16.0: https://deps.dev/go/github.com%2Ffluxcd%2Fhelm-controller/v0.16.0/dependencies

[18]0.20.0: https://github.com/fluxcd/image-automation-controller/releases/download/v0.20.0/image-automation-controller_0.20.0_sbom.spdx.json

[19]0.20.0: https://deps.dev/go/github.com%2Ffluxcd%2Fimage-automation-controller/v0.20.0/dependencies

[20]0.16.0: https://github.com/fluxcd/image-reflector-controller/releases/download/v0.16.0/image-reflector-controller_0.16.0_sbom.spdx.json

[21]0.16.0: https://deps.dev/go/github.com%2Ffluxcd%2Fimage-reflector-controller/v0.16.0/dependencies

[22]0.20.1: https://github.com/fluxcd/kustomize-controller/releases/download/v0.20.1/kustomize-controller_0.20.1_sbom.spdx.json

[23]0.20.1: https://deps.dev/go/github.com%2Ffluxcd%2Fkustomize-controller/v0.20.1/dependencies

[24]0.21.0: https://github.com/fluxcd/notification-controller/releases/download/v0.21.0/notification-controller_0.21.0_sbom.spdx.json

[25]0.21.0: https://deps.dev/go/github.com%2Ffluxcd%2Fnotification-controller/v0.21.0/dependencies

[26]0.21.2: https://github.com/fluxcd/source-controller/releases/download/v0.21.2/source-controller_0.21.2_sbom.spdx.json

[27]0.21.2: https://deps.dev/go/github.com%2Ffluxcd%2Fsource-controller/v0.21.2/dependencies

[28]开发会议: https://fluxcd.io/community/#meetings

[29]CNCF Slack: https://slack.cncf.io/

[30]采用者: https://fluxcd.io/adopters/

本文参与 腾讯云自媒体同步曝光计划,分享自微信公众号。
原始发表:2022-02-14,如有侵权请联系 cloudcommunity@tencent.com 删除
目录
  • SBOM 是什么?
  • SBOM 用例
  • 更多信息
    • 参考资料
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档