container-grype
Grypeを活用し、コンテナイメージやファイルシステムの脆弱性をCVSSの深刻度、EPSSの悪用可能性、CISA KEV指標で評価し、SBOM分析やCI/CDパイプライン統合、脆弱性レポート作成を通じて、セキュリティリスクを効率的に特定・管理するSkill。
📜 元の英語説明(参考)
Container vulnerability scanning and dependency risk assessment using Grype with CVSS severity ratings, EPSS exploit probability, and CISA KEV indicators. Use when: (1) Scanning container images and filesystems for known vulnerabilities, (2) Integrating vulnerability scanning into CI/CD pipelines with severity thresholds, (3) Analyzing SBOMs (Syft, SPDX, CycloneDX) for security risks, (4) Prioritizing remediation based on threat metrics (CVSS, EPSS, KEV), (5) Generating vulnerability reports in multiple formats (JSON, SARIF, CycloneDX) for security toolchain integration.
🇯🇵 日本人クリエイター向け解説
Grypeを活用し、コンテナイメージやファイルシステムの脆弱性をCVSSの深刻度、EPSSの悪用可能性、CISA KEV指標で評価し、SBOM分析やCI/CDパイプライン統合、脆弱性レポート作成を通じて、セキュリティリスクを効率的に特定・管理するSkill。
※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。
下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o container-grype.zip https://jpskill.com/download/17021.zip && unzip -o container-grype.zip && rm container-grype.zip
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/17021.zip -OutFile "$d\container-grype.zip"; Expand-Archive "$d\container-grype.zip" -DestinationPath $d -Force; ri "$d\container-grype.zip"
完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。
💾 手動でダウンロードしたい(コマンドが難しい人向け)
- 1. 下の青いボタンを押して
container-grype.zipをダウンロード - 2. ZIPファイルをダブルクリックで解凍 →
container-grypeフォルダができる - 3. そのフォルダを
C:\Users\あなたの名前\.claude\skills\(Win)または~/.claude/skills/(Mac)へ移動 - 4. Claude Code を再起動
⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。
🎯 このSkillでできること
下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。
📦 インストール方法 (3ステップ)
- 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
- 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
- 3. 展開してできたフォルダを、ホームフォルダの
.claude/skills/に置く- · macOS / Linux:
~/.claude/skills/ - · Windows:
%USERPROFILE%\.claude\skills\
- · macOS / Linux:
Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。
詳しい使い方ガイドを見る →- 最終更新
- 2026-05-18
- 取得日時
- 2026-05-18
- 同梱ファイル
- 10
📖 Skill本文(日本語訳)
※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。
Grype を用いたコンテナ脆弱性スキャン
概要
Grype は、コンテナイメージ、ファイルシステム、および Software Bill of Materials (SBOM) ドキュメント内の既知のセキュリティ上の欠陥を識別するオープンソースの脆弱性スキャナです。オペレーティングシステムのパッケージ (Alpine、Ubuntu、Red Hat、Debian) と、言語固有の依存関係 (Java、Python、JavaScript、Ruby、Go、PHP、Rust) を脆弱性データベースと照合して分析し、CVE を検出します。
Grype は、以下を通じて実用的なセキュリティインサイトを重視します。
- リスク分類のための CVSS 深刻度評価
- 脅威評価のための EPSS エクスプロイト確率スコア
- CISA Known Exploited Vulnerabilities (KEV) インジケーター
- ツールチェーン統合のための複数の出力形式 (table、JSON、SARIF、CycloneDX)
クイックスタート
コンテナイメージをスキャンします。
grype <image-name>
例:
# 公式 Docker イメージをスキャン
grype alpine:latest
# ローカル Docker イメージをスキャン
grype myapp:v1.2.3
# ファイルシステムディレクトリをスキャン
grype dir:/path/to/project
# SBOM ファイルをスキャン
grype sbom:/path/to/sbom.json
コアワークフロー
基本的な脆弱性スキャン
- スキャン対象を特定: スキャン対象 (コンテナイメージ、ファイルシステム、SBOM) を決定します。
- Grype スキャンを実行:
grype <target>を実行して脆弱性を分析します。 - 結果を確認: CVE ID、深刻度、CVSS スコア、影響を受けるパッケージを調べます。
- 修正を優先順位付け: 重要な/高い深刻度、CISA KEV、高い EPSS スコアに焦点を当てます。
- 修正を適用: 脆弱なパッケージまたはベースイメージを更新します。
- 再スキャン: 脆弱性が解決されたことを確認します。
失敗閾値を使用した CI/CD 統合
自動化されたパイプラインセキュリティゲートの場合:
# 重要な脆弱性が見つかった場合、ビルドを失敗させる
grype <image> --fail-on critical
# 高または重要な深刻度で失敗させる
grype <image> --fail-on high
# さらなる処理のために JSON を出力
grype <image> -o json > results.json
パイプライン統合パターン:
- コンテナイメージをビルドします。
--fail-on閾値を使用して Grype スキャンを実行します。- スキャンが失敗した場合: デプロイメントをブロックし、セキュリティチームに警告します。
- スキャンが成功した場合: デプロイメントワークフローを続行します。
- スキャン結果をビルド成果物としてアーカイブします。
SBOM ベースのスキャン
Syft で生成された SBOM と Grype を使用して、より高速な再スキャンを実現します。
# Syft で SBOM を生成 (別の Skill: sbom-syft)
syft <image> -o json > sbom.json
# Grype で SBOM をスキャン (イメージの再分析よりも高速)
grype sbom:sbom.json
# Syft の出力を Grype に直接パイプ
syft <image> -o json | grype
SBOM ワークフローの利点:
- イメージレイヤーを再分析せずに、より高速な再スキャンが可能
- セキュリティツール間で SBOM を共有
- コンプライアンスと監査のために SBOM をアーカイブ
リスク優先順位付けワークフロー
進捗状況:
[ ] 1. JSON 出力で完全な Grype スキャンを実行: grype <target> -o json > results.json
[ ] 2. ヘルパースクリプトを使用して、高リスクの CVE を抽出: ./scripts/prioritize_cves.py results.json
[ ] 3. CISA KEV の一致 (積極的に悪用されている脆弱性) を確認
[ ] 4. KEV 以外の結果について、EPSS スコア (エクスプロイト確率) を確認
[ ] 5. 修正の優先順位付け: KEV > 高 EPSS > CVSS Critical > CVSS High
[ ] 6. CVE ID と影響を受けるパッケージを含む修正計画を文書化
[ ] 7. 修正を適用し、再スキャンして確認
各ステップを体系的に進めてください。完了した項目をチェックしてください。
出力形式
Grype は、さまざまなユースケースに対応するために、複数の出力形式をサポートしています。
Table (デフォルト): 人間が読めるコンソール出力
grype <image>
JSON: 自動化のための機械可読形式
grype <image> -o json
SARIF: IDE 統合のための Static Analysis Results Interchange Format
grype <image> -o sarif
CycloneDX: 脆弱性データを含む SBOM 形式
grype <image> -o cyclonedx-json
Template: Go テンプレートを使用したカスタム出力
grype <image> -o template -t custom-template.tmpl
高度な設定
フィルタリングと除外
特定のファイルパスを除外します。
grype <image> --exclude '/usr/share/doc/**'
深刻度でフィルタリングします。
grype <image> --only-fixed # 利用可能な修正がある脆弱性のみを表示
カスタム無視ルール
.grype.yaml を作成して、誤検知を抑制します。
ignore:
# 特定の CVE を無視
- vulnerability: CVE-YYYY-XXXXX
reason: "誤検知 - コンポーネントは使用されていません"
# 特定のパッケージの CVE を無視
- vulnerability: CVE-YYYY-ZZZZZ
package:
name: example-lib
version: 1.2.3
reason: "リスクは許容されます - 緩和策が実施されています"
データベース管理
脆弱性データベースを更新します。
grype db update
データベースのステータスを確認します。
grype db status
特定のデータベースの場所を使用します。
grype <image> --db /path/to/database
セキュリティに関する考慮事項
-
機密データの取り扱い: スキャン結果には、アプリケーションアーキテクチャを明らかにするパッケージ名とバージョンが含まれる場合があります。結果を安全に保管し、承認されたセキュリティ担当者のみがアクセスできるように制限します。
-
アクセス制御: Grype は、コンテナイメージをスキャンする際に Docker ソケットへのアクセスが必要です。不正なイメージアクセスを防ぐために、権限を制限します。
-
監査ログ: コンプライアンスとインシデント対応のために、タイムスタンプ、ターゲットの詳細、およびオペレーターの ID を含むすべての Grype スキャンをログに記録します。履歴脆弱性追跡のためにスキャン結果をアーカイブします。
-
コンプライアンス: 定期的な脆弱性スキャンは、SOC2、PCI-DSS、NIST 800-53、および ISO 27001 の要件をサポートします。スキャン頻度と修正 SLA を文書化します。
-
安全なデフォルト: 本番環境へのデプロイメントの最小閾値として
--fail-on criticalを使用します。脆弱なイメージが本番環境に到達するのを防ぐために、CI/CD で自動スキャンを設定します。
バンドルされたリソース
スクリプト (scripts/)
- prioritize_cves.py - Grype JSON 出力を解析し、脅威メトリクス (KEV、EPSS、CVSS) で CVE の優先順位を付けます。
- grype_scan.sh - ロギングと閾値設定を備えた一貫性のある Grype スキャンのためのラッパースクリプト
参考文献 (references/)
- cvss_guide.md - CVSS 深刻度評価システムとスコアの解釈
- cisa_kev.md - CISA Known Exploited Vulnerabilities カタログと修正
(原文がここで切り詰められています)
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開
Container Vulnerability Scanning with Grype
Overview
Grype is an open-source vulnerability scanner that identifies known security flaws in container images, filesystems, and Software Bill of Materials (SBOM) documents. It analyzes operating system packages (Alpine, Ubuntu, Red Hat, Debian) and language-specific dependencies (Java, Python, JavaScript, Ruby, Go, PHP, Rust) against vulnerability databases to detect CVEs.
Grype emphasizes actionable security insights through:
- CVSS severity ratings for risk classification
- EPSS exploit probability scores for threat assessment
- CISA Known Exploited Vulnerabilities (KEV) indicators
- Multiple output formats (table, JSON, SARIF, CycloneDX) for toolchain integration
Quick Start
Scan a container image:
grype <image-name>
Examples:
# Scan official Docker image
grype alpine:latest
# Scan local Docker image
grype myapp:v1.2.3
# Scan filesystem directory
grype dir:/path/to/project
# Scan SBOM file
grype sbom:/path/to/sbom.json
Core Workflow
Basic Vulnerability Scan
- Identify scan target: Determine what to scan (container image, filesystem, SBOM)
- Run Grype scan: Execute
grype <target>to analyze for vulnerabilities - Review findings: Examine CVE IDs, severity, CVSS scores, affected packages
- Prioritize remediation: Focus on critical/high severity, CISA KEV, high EPSS scores
- Apply fixes: Update vulnerable packages or base images
- Re-scan: Verify vulnerabilities are resolved
CI/CD Integration with Fail Thresholds
For automated pipeline security gates:
# Fail build if any critical vulnerabilities found
grype <image> --fail-on critical
# Fail on high or critical severities
grype <image> --fail-on high
# Output JSON for further processing
grype <image> -o json > results.json
Pipeline integration pattern:
- Build container image
- Run Grype scan with
--fail-onthreshold - If scan fails: Block deployment, alert security team
- If scan passes: Continue deployment workflow
- Archive scan results as build artifacts
SBOM-Based Scanning
Use Grype with Syft-generated SBOMs for faster re-scanning:
# Generate SBOM with Syft (separate skill: sbom-syft)
syft <image> -o json > sbom.json
# Scan SBOM with Grype (faster than re-analyzing image)
grype sbom:sbom.json
# Pipe Syft output directly to Grype
syft <image> -o json | grype
Benefits of SBOM workflow:
- Faster re-scans without re-analyzing image layers
- Share SBOMs across security tools
- Archive SBOMs for compliance and auditing
Risk Prioritization Workflow
Progress:
[ ] 1. Run full Grype scan with JSON output: grype <target> -o json > results.json
[ ] 2. Use helper script to extract high-risk CVEs: ./scripts/prioritize_cves.py results.json
[ ] 3. Review CISA KEV matches (actively exploited vulnerabilities)
[ ] 4. Check EPSS scores (exploit probability) for non-KEV findings
[ ] 5. Prioritize remediation: KEV > High EPSS > CVSS Critical > CVSS High
[ ] 6. Document remediation plan with CVE IDs and affected packages
[ ] 7. Apply fixes and re-scan to verify
Work through each step systematically. Check off completed items.
Output Formats
Grype supports multiple output formats for different use cases:
Table (default): Human-readable console output
grype <image>
JSON: Machine-parseable for automation
grype <image> -o json
SARIF: Static Analysis Results Interchange Format for IDE integration
grype <image> -o sarif
CycloneDX: SBOM format with vulnerability data
grype <image> -o cyclonedx-json
Template: Custom output using Go templates
grype <image> -o template -t custom-template.tmpl
Advanced Configuration
Filtering and Exclusions
Exclude specific file paths:
grype <image> --exclude '/usr/share/doc/**'
Filter by severity:
grype <image> --only-fixed # Only show vulnerabilities with available fixes
Custom Ignore Rules
Create .grype.yaml to suppress false positives:
ignore:
# Ignore specific CVE
- vulnerability: CVE-YYYY-XXXXX
reason: "False positive - component not used"
# Ignore CVE for specific package
- vulnerability: CVE-YYYY-ZZZZZ
package:
name: example-lib
version: 1.2.3
reason: "Risk accepted - mitigation controls in place"
Database Management
Update vulnerability database:
grype db update
Check database status:
grype db status
Use specific database location:
grype <image> --db /path/to/database
Security Considerations
-
Sensitive Data Handling: Scan results may contain package names and versions that reveal application architecture. Store results securely and limit access to authorized security personnel.
-
Access Control: Grype requires Docker socket access when scanning container images. Restrict permissions to prevent unauthorized image access.
-
Audit Logging: Log all Grype scans with timestamps, target details, and operator identity for compliance and incident response. Archive scan results for historical vulnerability tracking.
-
Compliance: Regular vulnerability scanning supports SOC2, PCI-DSS, NIST 800-53, and ISO 27001 requirements. Document scan frequency and remediation SLAs.
-
Safe Defaults: Use
--fail-on criticalas minimum threshold for production deployments. Configure automated scans in CI/CD to prevent vulnerable images from reaching production.
Bundled Resources
Scripts (scripts/)
- prioritize_cves.py - Parse Grype JSON output and prioritize CVEs by threat metrics (KEV, EPSS, CVSS)
- grype_scan.sh - Wrapper script for consistent Grype scans with logging and threshold configuration
References (references/)
- cvss_guide.md - CVSS severity rating system and score interpretation
- cisa_kev.md - CISA Known Exploited Vulnerabilities catalog and remediation urgency
- vulnerability_remediation.md - Common remediation patterns for dependency vulnerabilities
Assets (assets/)
- grype-ci-config.yml - CI/CD pipeline configuration for Grype vulnerability scanning
- grype-config.yaml - Example Grype configuration with common ignore patterns
Common Patterns
Pattern 1: Pre-Production Scanning
Scan before pushing images to registry:
# Build image
docker build -t myapp:latest .
# Scan locally before push
grype myapp:latest --fail-on critical
# If scan passes, push to registry
docker push myapp:latest
Pattern 2: Scheduled Scanning
Re-scan existing images for newly disclosed vulnerabilities:
# Scan all production images daily
for image in $(docker images --format '{{.Repository}}:{{.Tag}}' | grep prod); do
grype $image -o json >> daily-scan-$(date +%Y%m%d).json
done
Pattern 3: Base Image Selection
Compare base images to choose least vulnerable option:
# Compare Alpine versions
grype alpine:3.18
grype alpine:3.19
# Compare distros
grype ubuntu:22.04
grype debian:12-slim
grype alpine:3.19
Integration Points
- CI/CD: Integrate with GitHub Actions, GitLab CI, Jenkins, CircleCI using
--fail-onthresholds - Container Registries: Scan images from Docker Hub, ECR, GCR, ACR, Harbor
- Security Tools: Export SARIF for GitHub Security, JSON for SIEM ingestion, CycloneDX for DependencyTrack
- SDLC: Scan during build (shift-left), before deployment (quality gate), and scheduled (continuous monitoring)
Troubleshooting
Issue: Database Update Fails
Symptoms: grype db update fails with network errors
Solution:
- Check network connectivity and proxy settings
- Verify firewall allows access to Grype database sources
- Use
grype db update --verbosefor detailed error messages - Consider using offline database:
grype db import /path/to/database.tar.gz
Issue: False Positives
Symptoms: Grype reports vulnerabilities in unused code or misidentified packages
Solution:
- Create
.grype.yamlignore file with specific CVE suppressions - Document justification for each ignored vulnerability
- Periodically review ignored CVEs (quarterly) to reassess risk
- Use
--only-fixedto focus on actionable findings
Issue: Slow Scans
Symptoms: Grype scans take excessive time on large images
Solution:
- Use SBOM workflow: Generate SBOM once with Syft, re-scan SBOM with Grype
- Exclude unnecessary paths:
--exclude '/usr/share/doc/**' - Use local database cache:
grype db updatebefore batch scans - Scan base images separately to identify inherited vulnerabilities
References
同梱ファイル
※ ZIPに含まれるファイル一覧。`SKILL.md` 本体に加え、参考資料・サンプル・スクリプトが入っている場合があります。
- 📄 SKILL.md (10,092 bytes)
- 📎 assets/ci-config-template.yml (11,105 bytes)
- 📎 assets/grype-ci-config.yml (10,283 bytes)
- 📎 assets/grype-config.yaml (7,884 bytes)
- 📎 assets/rule-template.yaml (11,044 bytes)
- 📎 references/cisa_kev.md (7,438 bytes)
- 📎 references/cvss_guide.md (5,933 bytes)
- 📎 references/EXAMPLE.md (15,672 bytes)
- 📎 references/vulnerability_remediation.md (10,341 bytes)
- 📎 references/WORKFLOW_CHECKLIST.md (8,390 bytes)