Sbom Syft 标志

Sbom Syft

组织
AgentSecOps
sbom-syft

使用 Syft 为容器镜像、文件系统和归档文件生成软件物料清单(SBOM)。可检测 28+ 个生态系统中的软件包,并支持多种输出格式(CycloneDX、SPDX、syft-json)。可用于漏洞评估、许可证合规和供应链安全。适用于:(1)为容器镜像或应用生成 SBOM;(2)分析软件依赖项和软件包,以进行漏洞扫描;(3)跟踪各项依赖的许可证合规情况;(4)将 SBOM 生成集成到 CI/CD 中,保障供应链安全;(5)创建已签名的 SBOM 证明,以记录软件来源。

Add to TypingMind

概览

发布者AgentSecOps
代码仓库SecOpsAgentKit
技能名称sbom-syft
星标数
225
复刻数
44
附带文件
4
链接
  • Markdown 格式的指令

    模型按需加载 SKILL.md 文件,因此只有在请求确实与该技能匹配时才会消耗 Token。

  • 兼容任何大语言模型

    AI 技能采用纯 Markdown,而非特定提供商的代码,因此可搭配 GPT、Claude、Gemini、Grok 或本地模型使用。

  • 4 个附带文件

    模型执行任务时可读取的脚本、模板和参考资料。这些文件为只读文件,绝不会被执行。

  • 开源

    由 AgentSecOps 发布于 GitHub。请在安装前查看技能的源文件。

安装

在 TypingMind 中安装 Sbom Syft AI 技能,即可搭配任意大语言模型使用;也可以将其放入其他支持读取 SKILL.md 的智能体中。

1

安装到 TypingMind

TypingMind 可直接从 GitHub 文件夹安装技能:读取 SKILL.md,打包资源文件,并将结果保存在本地。

  1. 打开应用,前往“插件 → 技能”。
  2. 选择“从 GitHub 安装”。
  3. 粘贴下方的技能文件夹 URL 并确认。
    https://github.com/AgentSecOps/SecOpsAgentKit/tree/main/skills/secsdlc/sbom-syft
  4. 请在每个需要使用该技能的聊天中启用它。
依次选择“插件 → 技能 → 添加技能 → 从 GitHub URL 导入”,然后粘贴文件夹 URL 并点击“继续”。
2

安装到其他智能体

任何支持 Agent Skills 格式的智能体都可以使用此技能,只需将文件夹复制到该智能体的技能目录中。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/AgentSecOps/SecOpsAgentKit.git /tmp/SecOpsAgentKit
mkdir -p .claude/skills
cp -r /tmp/SecOpsAgentKit/skills/secsdlc/sbom-syft .claude/skills/sbom-syft
复制后,请重启 Claude Code,以加载新技能。

在 TypingMind 中使用此技能

在任意 TypingMind 聊天中启用 Sbom Syft,后续即可交由模型处理。技能的名称和描述会放在系统提示词中,一旦请求匹配,模型就会自动加载完整指令,无需您手动调用,且在实际使用前不会消耗 Token。

一旦请求与技能匹配,模型就会自动加载 Sbom Syft。

兼容任何 AI 模型

AI 技能是纯 Markdown 指令,而非特定提供商的代码,因此 Sbom Syft 不局限于最初适配的模型。只需在 TypingMind 中安装一次,即可搭配 GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 或您自行运行的本地模型使用,全程使用您自己的 API 密钥。

  • 仅在需要时加载

    系统提示词中仅包含技能名称和描述。首次遇到匹配的请求时才会加载完整指令,因此技能未使用时,这些指令不会消耗 Token。

  • 在聊天中切换模型

    技能是指令而非代码,因此切换模型不会导致技能失效,新模型会读取同一个 SKILL.md。

技能指令

这是模型会加载的 SKILL.md 内容。请在安装前阅读,因为技能就是模型将遵循的指令。

Syft SBOM Generator

Overview

Syft is a CLI tool and Go library for generating comprehensive Software Bills of Materials (SBOMs) from container images and filesystems. It provides visibility into packages and dependencies across 28+ ecosystems, supporting multiple SBOM formats (CycloneDX, SPDX) for vulnerability management, license compliance, and supply chain security.

Supported Ecosystems

Languages & Package Managers: Alpine (apk), C/C++ (conan), Dart (pub), Debian/Ubuntu (dpkg), Dotnet (deps.json), Go (go.mod), Java (JAR/WAR/EAR/Maven/Gradle), JavaScript (npm/yarn), PHP (composer), Python (pip/poetry/setup.py), Red Hat (RPM), Ruby (gem), Rust (cargo), Swift (cocoapods)

Container & System: OCI images, Docker images, Singularity, container layers, Linux distributions

Quick Start

Generate SBOM for container image:

bash
# Using Docker
docker run --rm -v $(pwd):/out anchore/syft:latest <image> -o cyclonedx-json=/out/sbom.json

# Local installation
syft <image> -o cyclonedx-json=sbom.json

# Examples
syft alpine:latest -o cyclonedx-json
syft docker.io/nginx:latest -o spdx-json
syft dir:/path/to/project -o cyclonedx-json

Core Workflows

Workflow 1: Container Image SBOM Generation

For creating SBOMs of container images:

  1. Identify target container image (local or registry)
  2. Run Syft to generate SBOM:
    bash
    syft <image-name:tag> -o cyclonedx-json=sbom-cyclonedx.json
  3. Optionally generate multiple formats:
    bash
    syft <image-name:tag> \
      -o cyclonedx-json=sbom-cyclonedx.json \
      -o spdx-json=sbom-spdx.json \
      -o syft-json=sbom-syft.json
  4. Store SBOM artifacts with image for traceability
  5. Use SBOM for vulnerability scanning with Grype or other tools
  6. Track SBOM versions alongside image releases

Workflow 2: CI/CD Pipeline Integration

Progress: [ ] 1. Add Syft to build pipeline after image creation [ ] 2. Generate SBOM in standard format (CycloneDX or SPDX) [ ] 3. Store SBOM as build artifact [ ] 4. Scan SBOM for vulnerabilities (using Grype or similar) [ ] 5. Fail build on critical vulnerabilities or license violations [ ] 6. Publish SBOM alongside container image [ ] 7. Integrate with vulnerability management platform

Work through each step systematically. Check off completed items.

Workflow 3: Filesystem and Application Scanning

For generating SBOMs from source code or filesystems:

  1. Navigate to project root or specify path
  2. Scan directory structure:
    bash
    syft dir:/path/to/project -o cyclonedx-json=app-sbom.json
  3. Review detected packages and dependencies
  4. Validate package detection accuracy (check for false positives/negatives)
  5. Configure exclusions if needed (using .syft.yaml)
  6. Generate SBOM for each release version
  7. Track dependency changes between versions

Workflow 4: SBOM Analysis and Vulnerability Scanning

Combining SBOM generation with vulnerability assessment:

  1. Generate SBOM with Syft:
    bash
    syft <target> -o cyclonedx-json=sbom.json
  2. Scan SBOM for vulnerabilities using Grype:
    bash
    grype sbom:sbom.json -o json --file vulnerabilities.json
  3. Review vulnerability findings by severity
  4. Filter by exploitability and fix availability
  5. Prioritize remediation based on:
    • CVSS score
    • Active exploitation status
    • Fix availability
    • Dependency depth
  6. Update dependencies and regenerate SBOM
  7. Re-scan to verify vulnerability remediation

Workflow 5: Signed SBOM Attestation

For creating cryptographically signed SBOM attestations:

  1. Install cosign (for signing):
    bash
    # macOS
    brew install cosign
    
    # Linux
    wget https://github.com/sigstore/cosign/releases/latest/download/cosign-linux-amd64
    chmod +x cosign-linux-amd64
    mv cosign-linux-amd64 /usr/local/bin/cosign
  2. Generate SBOM:
    bash
    syft <image> -o cyclonedx-json=sbom.json
  3. Create attestation and sign:
    bash
    cosign attest --predicate sbom.json --type cyclonedx <image>
  4. Verify attestation:
    bash
    cosign verify-attestation --type cyclonedx <image>
  5. Store signature alongside SBOM for provenance verification

Output Formats

Syft supports multiple SBOM formats for different use cases:

FormatUse CaseSpecification
cyclonedx-jsonModern SBOM standard, wide tool supportCycloneDX 1.4+
cyclonedx-xmlCycloneDX XML variantCycloneDX 1.4+
spdx-jsonLinux Foundation standardSPDX 2.3
spdx-tag-valueSPDX text formatSPDX 2.3
syft-jsonSyft native format (most detail)Syft-specific
syft-textHuman-readable console outputSyft-specific
github-jsonGitHub dependency submissionGitHub-specific
templateCustom Go template outputUser-defined

Specify with -o flag:

bash
syft <target> -o cyclonedx-json=output.json

Configuration

Create .syft.yaml in project root or home directory:

yaml
# Cataloger configuration
package:
  cataloger:
    enabled: true
    scope: all-layers  # Options: all-layers, squashed

  search:
    unindexed-archives: false
    indexed-archives: true

# Exclusions
exclude:
  - "**/test/**"
  - "**/node_modules/**"
  - "**/.git/**"

# Registry authentication
registry:
  insecure-skip-tls-verify: false
  auth:
    - authority: registry.example.com
      username: user
      password: pass

# Output format defaults
output: cyclonedx-json

# Log level
log:
  level: warn  # Options: error, warn, info, debug, trace

Common Patterns

Pattern 1: Multi-Architecture Image Scanning

Scan all architectures of multi-platform images:

bash
# Scan specific architecture
syft --platform linux/amd64 <image> -o cyclonedx-json=sbom-amd64.json
syft --platform linux/arm64 <image> -o cyclonedx-json=sbom-arm64.json

# Or scan manifest list (all architectures)
syft <image> --platform all -o cyclonedx-json

Pattern 2: Private Registry Authentication

Access images from private registries:

bash
# Using Docker credentials
docker login registry.example.com
syft registry.example.com/private/image:tag -o cyclonedx-json

# Using environment variables
export SYFT_REGISTRY_AUTH_AUTHORITY=registry.example.com
export SYFT_REGISTRY_AUTH_USERNAME=user
export SYFT_REGISTRY_AUTH_PASSWORD=pass
syft registry.example.com/private/image:tag -o cyclonedx-json

# Using config file (recommended)
# Add credentials to .syft.yaml

Pattern 3: OCI Archive Scanning

Scan saved container images (OCI or Docker format):

bash
# Save image to archive
docker save nginx:latest -o nginx.tar

# Scan archive
syft oci-archive:nginx.tar -o cyclonedx-json=sbom.json

# Or scan Docker archive
syft docker-archive:nginx.tar -o cyclonedx-json=sbom.json

Pattern 4: Comparing SBOMs Between Versions

Track dependency changes across releases:

bash
# Generate SBOMs for two versions
syft myapp:v1.0 -o syft-json=sbom-v1.0.json
syft myapp:v2.0 -o syft-json=sbom-v2.0.json

# Compare with jq
jq -s '{"added": (.[1].artifacts - .[0].artifacts), "removed": (.[0].artifacts - .[1].artifacts)}' \
  sbom-v1.0.json sbom-v2.0.json

Pattern 5: Filtering SBOM Output

Extract specific package information:

bash
# Generate detailed SBOM
syft <target> -o syft-json=full-sbom.json

# Extract only Python packages
cat full-sbom.json | jq '.artifacts[] | select(.type == "python")'

# Extract packages with specific licenses
cat full-sbom.json | jq '.artifacts[] | select(.licenses[].value == "MIT")'

# Count packages by ecosystem
cat full-sbom.json | jq '.artifacts | group_by(.type) | map({type: .[0].type, count: length})'

Security Considerations

  • Sensitive Data Handling: SBOMs may contain internal package names and versions. Store SBOMs securely and restrict access to authorized personnel
  • Access Control: Limit SBOM generation and access to build systems. Use read-only credentials for registry access
  • Audit Logging: Log SBOM generation events, distribution, and access for compliance tracking
  • Compliance: SBOMs support compliance with Executive Order 14028 (Software Supply Chain Security), NIST guidelines, and OWASP recommendations
  • Safe Defaults: Use signed attestations for production SBOMs to ensure integrity and provenance

Integration Points

CI/CD Integration

GitHub Actions:

yaml
- name: Generate SBOM with Syft
  uses: anchore/sbom-action@v0
  with:
    image: ${{ env.IMAGE_NAME }}:${{ github.sha }}
    format: cyclonedx-json
    output-file: sbom.json

- name: Upload SBOM
  uses: actions/upload-artifact@v3
  with:
    name: sbom
    path: sbom.json

GitLab CI:

yaml
sbom-generation:
  image: anchore/syft:latest
  script:
    - syft $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA -o cyclonedx-json=sbom.json
  artifacts:
    reports:
      cyclonedx: sbom.json

Jenkins:

groovy
stage('Generate SBOM') {
  steps {
    sh 'syft ${IMAGE_NAME}:${BUILD_NUMBER} -o cyclonedx-json=sbom.json'
    archiveArtifacts artifacts: 'sbom.json'
  }
}

Vulnerability Scanning

Integrate with Grype for vulnerability scanning:

bash
# Generate SBOM and scan in one pipeline
syft <target> -o cyclonedx-json=sbom.json
grype sbom:sbom.json

SBOM Distribution

Attach SBOMs to container images:

bash
# Using ORAS
oras attach <image> --artifact-type application/vnd.cyclonedx+json sbom.json

# Using Docker manifest
# Store SBOM as additional layer or separate artifact

Advanced Usage

Custom Template Output

Create custom output formats using Go templates:

bash
# Create template file
cat > custom-template.tmpl <<'EOF'
{{- range .Artifacts}}
{{.Name}}@{{.Version}} ({{.Type}})
{{- end}}
EOF

# Use template
syft <target> -o template -t custom-template.tmpl

Scanning Specific Layers

Analyze specific layers in container images:

bash
# Squashed view (default - final filesystem state)
syft <image> --scope squashed -o cyclonedx-json

# All layers (every layer's packages)
syft <image> --scope all-layers -o cyclonedx-json

Environment Variable Configuration

Configure Syft via environment variables:

bash
export SYFT_SCOPE=all-layers
export SYFT_OUTPUT=cyclonedx-json
export SYFT_LOG_LEVEL=debug
export SYFT_EXCLUDE="**/test/**,**/node_modules/**"

syft <target>

Troubleshooting

Issue: Missing Packages in SBOM

Solution: Enable all-layers scope or check for package manager files:

bash
syft <target> --scope all-layers -o syft-json

Verify package manifest files exist (package.json, requirements.txt, go.mod, etc.)

Issue: Registry Authentication Failure

Solution: Ensure Docker credentials are configured or use explicit auth:

bash
docker login <registry>
# Then run syft
syft <registry>/<image> -o cyclonedx-json

Issue: Large SBOM Size

Solution: Use squashed scope and exclude test/dev dependencies:

yaml
# In .syft.yaml
package:
  cataloger:
    scope: squashed
exclude:
  - "**/test/**"
  - "**/node_modules/**"
  - "**/.git/**"

Issue: Slow Scanning Performance

Solution: Disable unindexed archive scanning for faster results:

yaml
# In .syft.yaml
package:
  search:
    unindexed-archives: false

License Compliance

Extract license information from SBOM:

bash
# Generate SBOM
syft <target> -o syft-json=sbom.json

# Extract unique licenses
cat sbom.json | jq -r '.artifacts[].licenses[].value' | sort -u

# Find packages with specific licenses
cat sbom.json | jq '.artifacts[] | select(.licenses[].value | contains("GPL"))'

# Generate license report
cat sbom.json | jq -r '.artifacts[] | "\(.name):\(.licenses[].value)"' | sort

Vulnerability Management Workflow

Complete workflow integrating SBOM generation with vulnerability management:

Progress: [ ] 1. Generate SBOM for application/container [ ] 2. Scan SBOM for known vulnerabilities [ ] 3. Classify vulnerabilities by severity and exploitability [ ] 4. Check for available patches and updates [ ] 5. Update vulnerable dependencies [ ] 6. Regenerate SBOM after updates [ ] 7. Re-scan to confirm vulnerability remediation [ ] 8. Document accepted risks for unfixable vulnerabilities [ ] 9. Schedule periodic SBOM regeneration and scanning

Work through each step systematically. Check off completed items.

References

附带文件

技能加载后,模型会按需读取这些文件。它们仅作为可读文件提供,绝不会被执行。

常见问题

Sbom Syft AI 技能有什么作用?

使用 Syft 为容器镜像、文件系统和归档文件生成软件物料清单(SBOM)。可检测 28+ 个生态系统中的软件包,并支持多种输出格式(CycloneDX、SPDX、syft-json)。可用于漏洞评估、许可证合规和供应链安全。适用于:(1)为容器镜像或应用生成 SBOM;(2)分析软件依赖项和软件包,以进行漏洞扫描;(3)跟踪各项依赖的许可证合规情况;(4)将 SBOM 生成集成到 CI/CD 中,保障供应链安全;(5)创建已签名的 SBOM 证明,以记录软件来源。

为什么在 TypingMind 中使用 Sbom Syft?

因为您只需安装一次,就能搭配任何模型使用。Sbom Syft 采用纯 Markdown 格式,而非特定提供商专用的代码,因此同一技能可用于 GPT-5、Claude、Gemini、Grok 或本地模型。您甚至可以在聊天中途切换模型,而不会影响技能的正常使用。TypingMind 使用您自己的 API 密钥,因此您直接向提供商付费,而不是按席位订阅;您的技能和聊天记录也都保留在您自己的存储空间中。

如何在 TypingMind 中安装 Sbom Syft?

在 TypingMind 中打开“插件 → 技能 → 从 GitHub 安装”,然后粘贴 https://github.com/AgentSecOps/SecOpsAgentKit/tree/main/skills/secsdlc/sbom-syft。TypingMind 会读取其中的 SKILL.md,打包相关文件,并将其安装为技能,供您在各个聊天中按需启用。

哪些 AI 模型可以使用 Sbom Syft?

您在 TypingMind 中连接的任何模型都可以。AI 技能采用纯 Markdown 指令,而非特定提供商专用的代码,因此 GPT、Claude、Gemini、Grok 和本地模型都能在请求匹配时加载此技能。

Sbom Syft 可以搭配多少个 AI 模型使用?

数量不限。只要模型支持技能,您就可以将它与 Sbom Syft 搭配使用。GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 等模型都可以通过您自己的 API 密钥接入 TypingMind。

Sbom Syft AI 技能免费吗?

AgentSecOps 已在 GitHub 上发布了该技能。请查看代码仓库了解许可条款。您只需向自己的 AI 提供商支付所用 Token 的费用。

什么是 AI 技能?

AI 技能是一组可复用的指令,用于教会 AI 模型完成某项特定任务。它遵循开放的 Agent Skills 格式:包含名称和描述的 SKILL.md 文件,以及模型可能需要的脚本、模板或参考文件。模型仅在您的请求与技能匹配时才会读取这些指令,因此已安装的技能在使用前不会产生任何费用。

AI 技能与插件或 MCP 服务器有何不同?

插件或 MCP 服务器为模型提供可调用的新工具,也就是在某处运行并返回结果的代码。AI 技能则为模型提供知识和流程:如何处理任务、遵循哪些步骤,以及怎样的输出才算优质。技能采用纯 Markdown 格式,因此不需要服务器、API 密钥或运行时环境,并且适用于任何模型。

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇