本文へスキップ
Skillpedia
セキュリティ35k · #8128

implementing-supply-chain-security-with-in-toto

できること

このツールは、ソフトウェアのコードが安全にビルドされ、配布されるようにするためのものです。開発の各ステップについて信頼できる記録を作成し、すべてが計画どおりに行われたこと、そして不正に変更されていないことを証明します。

使う場面

  • ✓ソフトウェアのサプライチェーンのセキュリティを設定するとき。
  • ✓ソフトウェアイメージが正しいビルド手順に従ったことを証明する必要があるとき。
  • ✓要件を満たすためにセキュリティ対策を実装するとき。

スキルのリンク

https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/implementing-supply-chain-security-with-in-toto/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/implementing-supply-chain-security-with-in-toto/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“コンテナイメージが安全にビルドされ、改ざんされていないことを確認するにはどうすればよいですか?”

毎週5つの新しいスキル。1分で読めます。

仕組み

ソフトウェアをビルドするために想定される手順、それを実行できる人、作成または変更されるべきファイルを定義することで動作します。各ステップは、その実行と結果を証明するデジタル署名を生成します。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

Implementing Supply Chain Security with in-toto

Overview

in-toto is a CNCF graduated project that ensures the integrity of software supply chains from initiation to end-user installation. It creates a verifiable record of the entire software development lifecycle by generating cryptographically signed attestations (called "link metadata") at each step, proving what happened, who performed it, and what artifacts were produced. For container environments, in-toto verifies that images deployed to Kubernetes followed approved build processes and have not been tampered with.

When to Use

  • When deploying or configuring implementing supply chain security with in toto capabilities in your environment
  • When establishing security controls aligned to compliance requirements
  • When building or improving security architecture for this domain
  • When conducting security assessments that require this implementation

Prerequisites

  • Python 3.8+ or Go runtime for in-toto client libraries
  • GPG or Ed25519 keys for signing attestations
  • Container build pipeline (Docker, Buildah, or Kaniko)
  • Container registry (Docker Hub, ECR, GCR, or Harbor)
  • Kubernetes cluster for deployment verification

Core Concepts

Supply Chain Layout

The layout is the central policy document that defines:

  • Steps: Ordered operations in the supply chain (clone, build, test, package, push)
  • Functionaries: Authorized entities (people or CI systems) that perform each step
  • Inspections: Client-side verification checks performed at verification time
  • Expected artifacts: Input/output relationships between steps
from in_toto.models.layout import Layout, Step, Inspection
from securesystemslib.interface import import_ed25519_privatekey_from_file

# Create the supply chain layout
layout = Layout()
layout.set_relative_expiration(months=3)

# Define the code clone step
step_clone = Step(name="clone")
step_clone.expected_materials = []
step_clone.expected_products = [["CREATE", "src/*"]]
step_clone.pubkeys = [clone_functionary_keyid]
step_clone.expected_command = ["git", "clone"]
step_clone.threshold = 1

# Define the build step
step_build = Step(name="build")
step_build.expected_materials = [["MATCH", "src/*", "WITH", "PRODUCTS", "FROM", "clone"]]
step_build.expected_products = [["CREATE", "image.tar"]]
step_build.pubkeys = [build_functionary_keyid]
step_build.expected_command = ["docker", "build"]
step_build.threshold = 1

# Define the scan step
step_scan = Step(name="scan")
step_scan.expected_materials = [["MATCH", "image.tar", "WITH", "PRODUCTS", "FROM", "build"]]
step_scan.expected_products = [["CREATE", "scan-report.json"]]
step_scan.pubkeys = [scan_functionary_keyid]
step_scan.threshold = 1

layout.steps = [step_clone, step_build, step_scan]

Link Metadata

Each step execution generates a link file containing:

  • Materials consumed (input artifacts with hashes)
  • Products created (output artifacts with hashes)
  • Command executed
  • Cryptographic signature of the functionary

Verification Process

At deployment time, the verifier checks:

  1. All required steps were performed
  2. Each step was signed by an authorized functionary
  3. Artifact hashes chain correctly between steps
  4. No unauthorized modifications occurred between steps

Implementation

Step 1: Generate Signing Keys

# Generate Ed25519 key pairs for each functionary
mkdir -p keys

# Project owner key (signs the layout)
in-toto-keygen --type ed25519 keys/owner

# CI builder key
in-toto-keygen --type ed25519 keys/builder

# Security scanner key
in-toto-keygen --type ed25519 keys/scanner

Step 2: Create the Supply Chain Layout

#!/usr/bin/env python3
"""Generate in-toto supply chain layout for container builds."""

from in_toto.models.layout import Layout, Step, Inspection
from in_toto.models.metadata import Envelope
from securesystemslib.signer import CryptoSigner
from securesystemslib.interface import import_ed25519_publickey_from_file

def create_container_build_layout():
    layout = Layout()
    layout.set_relative_expiration(months=6)

    # Load functionary public keys
    builder_key = import_ed25519_publickey_from_file("keys/builder.pub")
    scanner_key = import_ed25519_publickey_from_file("keys/scanner.pub")

    layout.keys = {
        builder_key["keyid"]: builder_key,
        scanner_key["keyid"]: scanner_key,
    }

    # Step 1: Source code checkout
    checkout = Step(name="checkout")

…
よくある質問

「ソフトウェアサプライチェーン」とは何ですか?

コードの作成からユーザーによる最終的なインストールまで、ソフトウェアを作成して届けるまでの一連の全体的な流れのことです。

「リンクメタデータ」とは何ですか?

各開発ステップで何が起きたか、誰が実行したか、どのファイルを使用または生成したかを詳しく記録した、署名付きのデジタル記録です。

これはコンテナやKubernetesにどのように関係しますか?

Kubernetesにデプロイされるコンテナイメージが、承認されたビルド手順に従っており、ビルド後に変更されていないことを確認できます。

詳細

作者による元の説明

Implements supply chain integrity verification for container builds with the in-toto framework: generating signing keys, defining a supply chain layout, recording pipeline steps as signed link metadata, verifying before deployment, enforcing at Kubernetes admission, and integrating with SLSA. Use when attesting CI/CD pipeline steps, proving an image followed the approved build process, or enforcin

repo: mukul975/Anthropic-Cybersecurity-Skills

人気

GitHubのスター
35k
ランキング
#8128
ライセンス
Apache-2.0
更新日
2026/8/31

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル