> For the complete documentation index, see [llms.txt](https://help.aikido.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.aikido.dev/docs/docs-ja/kdosukyan/miscellaneous/generate-sbom-based-on-open-source-packages.md).

# オープンソースパッケージに基づくSBOMを生成する

## SBOM のエクスポート

Aikido では両方をエクスポートできます **SBOM（Software Bill of Materials）** および **VEX（Vulnerability Exploitability eXchange）** ファイルです。これらのエクスポートにより、ソフトウェアコンポーネント（オープンソースコンポーネントを含む）を可視化でき、実際に修正が必要なものの優先順位付けに役立ちます。

**ユースケース:**

* **SBOM エクスポート** (CycloneDX 1.6、SPDX-2.3 または CSV)
  * M\&A、調達、または監査（例: ISO 27001、SOC2）時に第三者と共有します。
  * Cyber Resilience Act（CRA）、Medical Device Regulation（MDR）、Executive Order 14028 などの規制へのコンプライアンス。
  * 第三者リスク管理ツールや調達ツールに取り込む。
* **VEX エクスポート** (CycloneDX のみ)
  * どの脆弱性が **悪用可能** そして、どれが **該当しない**.
  * VEX はデューデリジェンスの証明として、既知の脆弱性を積極的に管理していることを第三者に示します。

### SBOM の場所 <a href="#where-to-find-the-sbom" id="where-to-find-the-sbom"></a>

**手順 1.** Reports > に移動 [Licenses & SBOM](https://app.aikido.dev/licenses)

**手順 2.** 右上の操作から SPDX、CycloneDX、または CSV の SBOM をダウンロードします

![フィルターと SBOM ダウンロードオプション付きの Python パッケージのライセンスリスク概要。](https://715870456-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyKbzcQGrx7UtrG0nPZZ7%2Fuploads%2Fgit-blob-46f4f8c55314ffff07437cd1b2ca77ea4c832a79%2Fucarecdn-74772dd0-d436-4829-9063-800bb19bb697.png?alt=media)

**任意。** さまざまな条件でライセンスをフィルタリングし、その後 SBOM をエクスポートします。エクスポートには選択したフィルター値が反映されます。

![ライセンス、言語、リスク、コンテナのオプションでリポジトリを検索するためのフィルターメニュー。](https://715870456-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyKbzcQGrx7UtrG0nPZZ7%2Fuploads%2Fgit-blob-6f6b8a2c274b7b7996cb1cd7814b34a3aa1062f8%2Fucarecdn-f7c910f2-edc1-4859-a464-b0155cc6d093.png?alt=media)

チームでフィルタリングしたい場合は、ページ上部の Team Filter を変更して行えます。

![Licenses & SBOM レポートを表示するためのチーム選択ドロップダウン。](https://715870456-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyKbzcQGrx7UtrG0nPZZ7%2Fuploads%2Fgit-blob-644f5ae98897b1517a5dcf159e59369384237810%2Fucarecdn-156d14a3-4155-4ba9-bc53-1f4dff0152b5.png?alt=media)

> マルチブランチスキャンを有効にしている場合は、ドロップダウンで特定のブランチのリポジトリを選択することで、ブランチごとに異なる SBOM を取得できます。詳細はアプリ内チャットからお問い合わせください。

#### API で生成してエクスポート <a href="#generate-and-export-via-api" id="generate-and-export-via-api"></a>

当社の [SBOM エクスポート API](https://apidocs.aikido.dev/reference/exportcoderepolicenses).

## 自動生成された SBOM の監視

Buildroot や Yocto などのツールで構築された組み込みシステムは、ビルド時に SBOM を生成できます。これらのシステムは標準のコンテナレジストリを持たないことが多いため、API 経由でこれらの自動生成 SBOM を Aikido にアップロードし、サプライチェーンのセキュリティとライセンスコンプライアンスを監視できます。

### Buildroot / Yocto を使った SBOM の生成

{% tabs %}
{% tab title="Buildroot" %}
Buildroot は、組み込みの [generate-cyclonedx](https://buildroot.org/downloads/manual/manual.html#_generating_cyclonedx_sbom) ユーティリティを介して CycloneDX SBOM を生成します。これは `make show-info`.

{% stepper %}
{% step %}

#### SBOM を生成

次のコマンドを実行します:

```bash
make show-info | utils/generate-cyclonedx > sbom.cdx.json
```

これにより、組み込み Linux システム内のすべてのパッケージを、そのバージョン、ライセンス、ソース情報とともに一覧化した単一の CycloneDX JSON ファイルが生成されます。
{% endstep %}
{% endstepper %}
{% endtab %}

{% tab title="Yocto SPDX 2.2 エンジン" %}

### Yocto の SPDX 2.2 エンジンの使用

Yocto は、その `create-spdx` クラスを通じてネイティブに SPDX 2.2 SBOM を生成します。これは Yocto 3.4（Honister）以降安定しており、デフォルトで有効です。

{% stepper %}
{% step %}

#### Yocto の SPDX 2.2 エンジンの設定

次を `conf/local.conf` に追加して、各レシピについて SPDX 2.2 ドキュメントを生成するよう Yocto に指示します:

```
INHERIT += "create-spdx"
```

{% hint style="warning" %}
Yocto のオプション [SPDX\_INCLUDE\_SOURCES](https://docs.yoctoproject.org/dev/ref-manual/variables.html#term-SPDX_INCLUDE_SOURCES) は、SBOM のサイズを不必要に増やすため、無効にすることを推奨します。
{% endhint %}
{% endstep %}

{% step %}

#### イメージのビルド

通常の BitBake ビルドを実行します:

```bash
bitbake <your-image-name>
```

ビルド成功後、SPDX ファイルは次の場所に書き込まれます:

```
tmp/deploy/spdx/<MACHINE>/
```

最上位のイメージドキュメント（例: `<IMAGE>-<MACHINE>.spdx.json`）は、同じディレクトリ内の各パッケージの SPDX ドキュメントへのリンクを持ちます。Aikido にアップロードする前に、各パッケージの SPDX ファイルを 1 つの SPDX ファイルにまとめることを推奨します。
{% endstep %}

{% step %}

#### 単一の SBOM への統合

Yocto は複数の `*.spdx.json` ファイル（レシピごとに 1 つ）を生成するため、手動で 1 つの SBOM ファイルに統合する必要があります。これは [SPDXMergeTool](https://github.com/philips-software/SPDXMerge) または [sbomasm - assemble](https://github.com/interlynk-io/sbomasm/blob/main/docs/assemble.md#merge-algorithms).
{% endstep %}
{% endstepper %}
{% endtab %}
{% endtabs %}

### SBOM を Aikido にアップロード

次を使用してください [Upload Container SBOM API](https://apidocs.aikido.dev/reference/uploadcontainersbom) を使用して生成したファイルをアップロードします。API キーの取得方法と使用方法の詳細については、 [API 認証ドキュメント](https://apidocs.aikido.dev/reference/authorization) をご覧ください。

```bash
#JSON ファイルの単語分割を防ぎます
SBOM=$(cat /path/to/sbom.spdx.json)

# CycloneDX と SPDX の JSON 形式の両方に対応しています
curl -X POST "https://app.aikido.dev/api/public/v1/containers/sbom" \
  -H "accept: application/json" \
  -H "Authorization: Bearer $AIKIDO_API_KEY" \
  -H "Content-Type: application/json" \
  -d "{\"sbom\": $SBOM, \"container_image_name\": \"$YOUR_CONTAINER_NAME\"}"
```

Aikido は、アップロードされた SBOM を **コンテナ** の下に、レジストリとともに一覧表示します *自己申告 SBOM* および **自動的にスキャンを開始** し、脆弱性とライセンスリスクを検出します。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://help.aikido.dev/docs/docs-ja/kdosukyan/miscellaneous/generate-sbom-based-on-open-source-packages.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
