Chuyển đến nội dung
Skillpedia
Bảo mật35k · #8128

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

Skill này làm gì

Công cụ này giúp bảo đảm mã phần mềm của bạn được xây dựng và phân phối an toàn. Nó tạo một bản ghi đáng tin cậy về mọi bước phát triển, chứng minh mọi thứ diễn ra đúng kế hoạch và không bị thay đổi trái phép.

Khi nào nên dùng

  • ✓Khi thiết lập bảo mật cho chuỗi cung ứng phần mềm của bạn.
  • ✓Khi cần chứng minh một image phần mềm đã tuân theo đúng quy trình xây dựng.
  • ✓Khi triển khai các biện pháp kiểm soát bảo mật để đáp ứng yêu cầu.

Liên kết skill

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

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/implementing-supply-chain-security-with-in-toto/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Làm thế nào để bảo đảm image container của tôi được xây dựng an toàn và không bị can thiệp?”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Công cụ hoạt động bằng cách định nghĩa các bước dự kiến để xây dựng phần mềm, ai được phép thực hiện chúng và những tệp nào nên được tạo hoặc chỉnh sửa. Mỗi bước tạo ra một chữ ký số chứng minh việc thực thi và kết quả của nó.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

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")

…
Câu hỏi thường gặp

“Chuỗi cung ứng phần mềm” là gì?

Đó là toàn bộ quy trình tạo và phân phối phần mềm, từ viết mã đến khi người dùng cuối cài đặt.

“Link metadata” là gì?

Đây là các bản ghi số đã ký, mô tả chi tiết điều gì đã xảy ra trong mỗi bước phát triển, ai thực hiện và những tệp nào được dùng hoặc tạo ra.

Điều này áp dụng cho container và Kubernetes như thế nào?

Nó bảo đảm các image container được triển khai lên Kubernetes đã tuân theo quy trình xây dựng được phê duyệt và không bị sửa đổi sau khi được xây dựng.

Chi tiết

Mô tả gốc của tác giả

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

Độ phổ biến

Sao GitHub
35k
Vị trí xếp hạng
#8128
Giấy phép
Apache-2.0
Cập nhật
31/8/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự