自 2025 年 3 月 27 日起,我们建议您使用 android-latest-release
而非 aosp-main
构建 AOSP 并为其做出贡献。如需了解详情,请参阅 AOSP 的变更。
创建软件物料清单 (SBOM)
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
2022 年 2 月,美国国家标准与技术研究院 (NIST) 发布了安全软件开发框架 (SSDF) 1.1 版,这是一套有关安全软件开发实践的全面指南,以响应 2021 年信息安全行政命令 (EO) 14028。
作为这些要求的一部分,美国政府可能会要求提供软件物料清单 (SBOM),其中列出软件版本的组件。
SBOM 是系统自动为 Android 持续集成 (Android CI) build 生成的。如果您使用其中一个 CI build,请按照以下步骤为 build 获取 SBOM。不然的话,请按照相应步骤生成自定义 SBOM。
获取预生成的 SBOM
如需获取预生成的 SBOM,请执行以下操作:
在浏览器中,前往 ci.android.com
。
在 Enter a branch name 字段中,输入 aosp-main
。
对于任一个处于绿色状态的 build,点击查看工件下拉箭头。“构建工件”界面将会显示。
在“构建工件”界面中,使用 find 命令找到 SBOM JSON 文件(按 CTRL+F 键或 CMD+F 键)。
生成自定义 SBOM
对于平台的任何新增内容(包括任何二进制文件或 build 和发布工具链),您提供的产品 SBOM 表述必须符合软件物料清单 (SBOM) 的最少必需元素。如需生成自定义 SBOM:
运行下方的命令以设置您的环境并构建 SBOM:
$ source build/envsetup.sh
$ lunch TARGET
$ m sbom # Generates an SBOM
TARGET
是指您用于构建 Android 的同一构建目标,例如 aosp_arm64-userdebug
。
为确保正确构建 SBOM,请执行:
$ ls out/dist/sbom*
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-03-26。
[null,null,["最后更新时间 (UTC):2025-03-26。"],[],[],null,["# Create a software bill of materials (SBOM)\n\nIn February 2022, the National Institute of Standards and Technology (NIST)\npublished version 1.1 of the\n[Secure Software Development Framework (SSDF)](https://csrc.nist.gov/Projects/ssdf),\na set of comprehensive guidelines on secure software development practices in\nresponse to the\n[2021 Cybersecurity Executive Order (EO) 14028](https://www.federalregister.gov/documents/2021/05/17/2021-10460/improving-the-nations-cybersecurity).\n\nAs part of these requirements, the US government might request\na *software bill of materials (SBOM)*, which lists components of a software\nrelease.\n| **Note:** SBOMs generated using the steps on this page include the [Minimal Elements for a Software Bill of Materials (SBOM)](https://www.ntia.doc.gov/report/2021/minimum-elements-software-bill-materials-sbom) as published by the National Telecommunications and Information Administration (NTIA). Additionally, Android-based SBOM tooling and product SBOMs are compatible with the [Software Package Data Exchange (SPDX) 2.3](https://spdx.github.io/spdx-spec/v2.3/) format for communicating the component and metadata information associated with software packages.\n\nSBOMs are automatically generated for Android Continuous Integration\n(Android CI) builds. If you use one of the CI builds, use the following steps\nto\n[obtain an SBOM for a build](#obtain).\nOtherwise, follow the steps to\n[generate a custom SBOM](#generate).\n\nObtain a pregenerated SBOM\n--------------------------\n\nTo obtain a pregenerated SBOM:\n\n1. In your browser, navigate to `ci.android.com`.\n\n2. In the **Enter a branch name** field, type `aosp-android-latest-release`.\n\n3. For any of the builds with green status, click the **View artifacts**\n down arrow. The Build artifacts screen appears.\n\n4. In the Build artifacts screen, use a find command to locate the SBOM JSON\n folder (**CTRL+F** or **CMD+F**).\n\nGenerate a custom SBOM\n----------------------\n\nFor any additions to the platform, including any binary or build and release\ntool chains, you must provide a SBOM representation of your product that meets\nthe\n[Minimal Elements for a Software Bill of Materials (SBOM)](https://www.ntia.doc.gov/report/2021/minimum-elements-software-bill-materials-sbom).\nTo generate a custom SBOM:\n\n1. Run the following commands to set up your environment and build the SBOM:\n\n $ source build/envsetup.sh\n $ lunch \u003cvar translate=\"no\"\u003eTARGET\u003c/var\u003e\n $ m sbom # Generates an SBOM\n\n The \u003cvar translate=\"no\"\u003eTARGET\u003c/var\u003e refers to the same build target that you\n are using to build Android, such as `aosp_arm64-userdebug`.\n2. To ensure the SBOM built correctly, execute:\n\n $ ls out/dist/sbom*"]]