Grype syft sbom scanner

From seaworld008/Commonly-used-high-value-skills · View interactive version

Grype syft sbom scanner is an AI agent skill from the GitHub repository seaworld008/Commonly-used-high-value-skills. Use when generating an SBOM with Syft and scanning images, filesystems, packages, archives, or existing SBOMs for known vulnerabilities with Grype.

How to use this skill

Skill file

Grype + Syft SBOM Scanner

Trigger / When to Use

Use this skill when the user wants SBOM-first vulnerability management, container image scanning, package inventory, or repeatable vulnerability scans using Anchore open-source tools Syft and Grype.

Good trigger phrases:

Core Capabilities

Workflow

1. Pick the SBOM Strategy

Use one of these modes:

Prefer SBOM-first when the result will be attached to a release, shared with customers, or compared later.

2. Verify Tools

syft version
grype version

Record both installed versions. If either tool is missing, identify the required package and installation scope. Install from the official Anchore distribution only when the current task authorizes it.

3. Generate an SBOM

For a container image:

syft registry.example.com/app:1.2.3 -o cyclonedx-json=sbom.cdx.json

For a local source or filesystem directory:

syft dir:. -o spdx-json=sbom.spdx.json

For Syft JSON:

syft packages . -o syft-json=sbom.syft.json

4. Scan with Grype

Scan an image directly:

grype registry.example.com/app:1.2.3

Scan a directory:

grype dir:.

Scan an SBOM:

grype sbom:sbom.cdx.json

Fail on high-severity findings in CI:

grype registry.example.com/app:1.2.3 --fail-on high

5. Produce Reports

grype sbom:sbom.cdx.json -o json > grype-results.json
grype sbom:sbom.cdx.json -o sarif > grype-results.sarif
grype sbom:sbom.cdx.json -o table

Retain:

6. Triage Findings

For each finding, capture:

Prioritize runtime packages over build-only layers unless the build system is also in scope.

Common Patterns

Release Evidence Bundle

release-security/
  image-digest.txt
  sbom.cdx.json
  grype-results.json
  grype-results.sarif
  scanner-versions.txt
  accepted-risk.md

GitHub Actions Example

Set SBOM_TOOLS_IMAGE to a reviewed, digest-pinned CI image containing a shell and the required Syft and Grype versions.

name: sbom-vuln-scan
on: [pull_request]
jobs:
  scan:
    runs-on: ubuntu-latest
    container:
      image: ${{ vars.SBOM_TOOLS_IMAGE }}
    steps:
      - uses: actions/checkout@v4
      - name: Record scanner versions
        run: |
          syft version
          grype version
      - name: Generate SBOM
        run: syft dir:. -o cyclonedx-json=sbom.cdx.json
      - name: Scan SBOM
        run: grype sbom:sbom.cdx.json --fail-on high

Image Comparison

syft old-image:tag -o syft-json=old.sbom.json
syft new-image:tag -o syft-json=new.sbom.json
grype sbom:old.sbom.json -o json > old.vulns.json
grype sbom:new.sbom.json -o json > new.vulns.json

Summarize deltas by new, fixed, unchanged, and severity-changed vulnerabilities.

Interpretation Rules

Boundaries

Reference Sources

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.