मुख्य सामग्री पर जाएँ
Skillpedia
एजेंट35k · #8356

scanning-container-images-with-grype

यह क्या करती है

Grype एक टूल है जो प्रोग्राम इमेज (जैसे जो सर्वर पर इस्तेमाल होती हैं) में जानी-मानी सुरक्षा खामियाँ (जिन्हें CVE कहते हैं) ढूँढता है। यह खामियों की जानकारी वाले databases का इस्तेमाल करता है और अगर कोई गंभीर समस्या मिले तो आपको अलर्ट कर सकता है।

कब इस्तेमाल करें

  • ✓प्रोडक्शन में डालने से पहले किसी प्रोग्राम की सुरक्षा जाँचने के लिए।
  • ✓जब आपको किसी संभावित सुरक्षा खामी का अलर्ट मिले।
  • ✓अपने प्रोग्राम्स पर नियमित सुरक्षा जाँच करने के लिए।

Skill का लिंक

https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/scanning-container-images-with-grype/SKILL.md

इसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।

कैसे इस्तेमाल करें

सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।

पेस्ट करने के लिए तैयार मैसेज

इस skill से मेरी मदद करो: https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/scanning-container-images-with-grype/SKILL.md इस लिंक की SKILL.md फ़ाइल पढ़ो और मेरे काम में उसके निर्देशों का पालन करो।
क्या आप चाहते हैं कि आपका AI ऐसी skills खुद ढूँढे?मुफ़्त Skillpedia MCP इंस्टॉल करें: बस एक लाइन, और हर काम से पहले यह 15,000+ skills में खोजता है।1 मिनट में इंस्टॉल करें →

AI से क्या माँगें: उदाहरण

“'my-app:latest' इमेज में सुरक्षा कमज़ोरियाँ स्कैन करो।”

हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।

यह कैसे काम करती है

Grype किसी प्रोग्राम के हिस्सों की तुलना जानी-मानी सुरक्षा खामियों की सूची से करता है। मिलान होने पर वह खामी और उसकी गंभीरता (severity) बताता है।

तकनीकी सामग्री (मूल SKILL.md)

लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।

Scanning Container Images with Grype

Overview

Grype is an open-source vulnerability scanner from Anchore that inspects container images, filesystems, and SBOMs for known CVEs. It leverages Syft-generated SBOMs to match packages against multiple vulnerability databases including NVD, GitHub Advisories, and OS-specific feeds.

When to Use

  • When conducting security assessments that involve scanning container images with grype
  • When following incident response procedures for related security events
  • When performing scheduled security testing or auditing activities
  • When validating security controls through hands-on testing

Prerequisites

  • Docker or Podman installed
  • Grype CLI installed (curl -sSfL https://raw.githubusercontent.com/anchore/grype/main/install.sh | sh -s -- -b /usr/local/bin)
  • Syft CLI (optional, for SBOM generation)
  • Network access to pull vulnerability databases

Core Commands

Install Grype

# Install via script
curl -sSfL https://raw.githubusercontent.com/anchore/grype/main/install.sh | sh -s -- -b /usr/local/bin

# Verify installation
grype version

# Install via Homebrew (macOS/Linux)
brew install grype

Scan Container Images

# Scan a Docker Hub image
grype nginx:latest

# Scan from Docker daemon
grype docker:myapp:1.0

# Scan a local archive
grype docker-archive:image.tar

# Scan an OCI directory
grype oci-dir:path/to/oci/

# Scan a Singularity image
grype sif:image.sif

# Scan a local directory / filesystem
grype dir:/path/to/project

Output Formats

# Default table output
grype alpine:3.18

# JSON output for pipeline processing
grype alpine:3.18 -o json > results.json

# CycloneDX SBOM output
grype alpine:3.18 -o cyclonedx

# SARIF output for GitHub Security tab
grype alpine:3.18 -o sarif > grype.sarif

# Template-based custom output
grype alpine:3.18 -o template -t /path/to/template.tmpl

Filtering and Thresholds

# Fail if vulnerabilities meet or exceed a severity
grype nginx:latest --fail-on critical

# Show only fixed vulnerabilities
grype nginx:latest --only-fixed

# Show only non-fixed vulnerabilities
grype nginx:latest --only-notfixed

# Filter by severity
grype nginx:latest --only-fixed -o json | jq '[.matches[] | select(.vulnerability.severity == "High")]'

# Explain a specific CVE
grype nginx:latest --explain --id CVE-2024-1234

Working with SBOMs

# Generate SBOM with Syft then scan
syft nginx:latest -o spdx-json > nginx-sbom.json
grype sbom:nginx-sbom.json

# Scan CycloneDX SBOM
grype sbom:bom.json

Configuration File (.grype.yaml)

# .grype.yaml
check-for-app-update: false
fail-on-severity: "high"
output: "json"
scope: "squashed"  # or "all-layers"
quiet: false

ignore:
  - vulnerability: CVE-2023-12345
    reason: "False positive - not exploitable in our context"
  - vulnerability: CVE-2023-67890
    fix-state: unknown

db:
  auto-update: true
  cache-dir: "/tmp/grype-db"
  max-allowed-built-age: 120h  # 5 days

match:
  java:
    using-cpes: true
  python:
    using-cpes: true
  javascript:
    using-cpes: false

CI/CD Integration

# GitHub Actions
- name: Scan image with Grype
  uses: anchore/scan-action@v4
  with:
    image: "myregistry/myapp:${{ github.sha }}"
    fail-build: true
    severity-cutoff: high
    output-format: sarif
  id: scan

- name: Upload SARIF
  uses: github/codeql-action/upload-sarif@v3
  with:
    sarif_file: ${{ steps.scan.outputs.sarif }}
# GitLab CI
container_scan:
  stage: test
  image: anchore/grype:latest
  script:
    - grype ${CI_REGISTRY_IMAGE}:${CI_COMMIT_SHA} --fail-on high -o json > grype-report.json
  artifacts:
    reports:
      container_scanning: grype-report.json

Database Management

# Check database status
grype db status

# Manually update vulnerability database
grype db update

# Delete cached database
grype db delete

# List supported database providers
grype db list

Key Vulnerability Sources

Source Coverage
NVD CVEs across all ecosystems
GitHub Advisories Open source package vulnerabilities
Alpine SecDB Alpine Linux packages
Amazon Linux ALAS Amazon Linux AMI
Debian Security Tracker Debian packages
Red Hat OVAL RHEL, CentOS
Ubuntu Security Ubuntu packages
Wolfi SecDB Wolfi/Chainguard images

Best Practices

  1. Pin image tags - Always scan specific digests, not latest

…

अक्सर पूछे जाने वाले सवाल

CVE क्या है?

CVE का पूरा नाम 'Common Vulnerabilities and Exposures' है। यह किसी ज्ञात सॉफ़्टवेयर सुरक्षा खामी की एक अनोखी पहचान है।

SBOM क्या है?

SBOM का मतलब 'Software Bill of Materials' है। यह सॉफ़्टवेयर की सामग्री की सूची जैसा है, जिसमें उसके सभी हिस्से और उनके वर्ज़न लिखे होते हैं।

Grype को कौन सी खामियाँ देखनी हैं, यह कैसे पता चलता है?

यह कई सार्वजनिक और निजी databases से जानकारी लेता है जिनमें ज्ञात खामियाँ दर्ज होती हैं, जैसे NVD और GitHub advisories।

जानकारी

लेखक का मूल विवरण

Scans container images, filesystems, and SBOMs for known CVEs with Anchore Grype, matching Syft-generated SBOM packages against NVD, GitHub Advisories, and OS-specific feeds with configurable severity thresholds and failure gates. Use when Grype or Syft is the chosen toolchain, when scanning an existing SBOM rather than an image, or when gating a build on severity. Keywords: Grype, Syft, SBOM, NVD

repo: mukul975/Anthropic-Cybersecurity-Skills

लोकप्रियता

GitHub स्टार
35k
रैंकिंग में स्थान
#8356
लाइसेंस
Apache-2.0
अपडेट की गई
31/8/2026

क्या यह skill काम की है?

0

लॉग इन करें वोट करने के लिए।

कमेंट

  • …

इस repository की और skills

मिलती-जुलती skills