Skip to content
scanning-container-security logo

Scanning Container Security

scanning-container-security

Execute use when you need to work with security and compliance.

SKILL.md

Full skill instructions

Scanning Container Security

Overview

Scan container images and Dockerfiles for vulnerabilities, misconfigurations, and compliance violations using Trivy, Grype, Snyk Container, and Hadolint. Analyze base images, OS packages, application dependencies, and runtime configurations to produce actionable security reports with remediation guidance.

Prerequisites

  • Container scanning tool installed: trivy, grype, snyk, or docker scout
  • Dockerfile linter: hadolint for Dockerfile best practice validation
  • Docker daemon running for local image scanning
  • Access to the container images to scan (local, registry, or tar archive)
  • jq for parsing JSON scan results

Instructions

  1. Identify target images for scanning: production images, base images, and CI-built images
  2. Lint Dockerfiles with hadolint Dockerfile to catch misconfigurations before build (privileged instructions, pinned versions, shell best practices)
  3. Scan built images for OS-level vulnerabilities: trivy image <image:tag> or grype <image:tag>
  4. Scan for application dependency vulnerabilities: check language-specific packages (npm, pip, Maven, Go modules) embedded in the image
  5. Check for secrets accidentally baked into image layers: trivy image --scanners secret <image:tag>
  6. Evaluate image against CIS Docker Benchmark: verify non-root user, read-only filesystem capability, health checks defined
  7. Generate a security report with severity classification (Critical, High, Medium, Low) and CVE identifiers
  8. Produce remediation steps: upgrade base image, pin package versions, replace vulnerable dependencies
  9. Integrate scanning into CI/​CD pipeline: fail builds on Critical/​High vulnerabilities, generate SARIF output for GitHub Security tab

Output

  • Vulnerability scan report in JSON, table, or SARIF format
  • Hadolint report with Dockerfile improvement recommendations
  • Remediation Dockerfile patches (updated base image, pinned package versions)
  • CI/​CD pipeline step configuration for automated image scanning
  • Security policy document defining acceptable risk thresholds

Error Handling

ErrorCauseSolution
trivy: unable to pull imageImage not found locally or registry auth failurePull image first with docker pull or configure registry credentials
CRITICAL vulnerability found but no fix availableUpstream package has no patch yetDocument as accepted risk, use --ignore-unfixed flag, or switch to an alternative base image
hadolint: DL3008 pin versions in apt-get installPackages installed without version pinningAdd version pins (e.g., apt-get install nginx=1.24.0-1) or use --no-install-recommends
Scan timeout on large imageImage has many layers or large filesystemUse --timeout 15m flag; scan a specific layer or use --skip-dirs to exclude test data
False positive CVEScanner database maps CVE to a package not actually exploitableAdd to .trivyignore or Grype ignore file with justification comment

Examples

  • "Scan all production Docker images for Critical and High CVEs, generate a report, and create Jira tickets for each finding."
  • "Lint the Dockerfile for best practices: ensure multi-stage build, non-root USER, no ADD for remote URLs, and pinned base image digest."
  • "Set up a GitHub Actions step that runs Trivy on every PR, fails on Critical vulnerabilities, and uploads results to the Security tab via SARIF."

Resources

More DevOps & CI/CD skills

Project scaffolding, deployment configuration, and CI/CD setup for Google ADK agents.

6K 472.6K
View

Set up tracing, logging, and monitoring for deployed ADK agents across Cloud Trace, BigQuery, and third-party platforms.

6K 472.6K
View

Enterprise Azure infrastructure architect generating Bicep or Terraform from workload descriptions.

1.5K 454.3K
View
azure-kubernetes logo
DevOps & CI/CD

azure-kubernetes

Plan and configure production-ready Azure Kubernetes Service clusters with Day-0 and Day-1 best practices.

1.5K 447.1K
View

Raw mechanical interfaces fusing Swiss typographic print with military terminal aesthetics. Rigid grids, extreme type scale contrast, utilitarian color, analog degradation effects. For data-heavy dashboards, portfolios, or editorial sites that need to feel like declassified blueprints.

92.7K 354.9K
View
just-scrape logo
DevOps & CI/CD

just-scrape

Web search, scraping, extraction, crawling, and monitoring via ScrapeGraph AI CLI.

69 245K
View

Skill for working with Firebase Hosting (Classic). Use this when you want to deploy static web apps, Single Page Apps (SPAs), or simple microservices. Do NOT use for Firebase App Hosting.

462 159.7K
View

Deploy and manage web apps with Firebase App Hosting. Use this skill when deploying Next.js/Angular apps with backends.

462 159.1K
View
deploy-to-vercel logo
DevOps & CI/CD

deploy-to-vercel

Deploy applications and websites to Vercel. Use when the user requests deployment actions like "deploy my app", "deploy and give me the link", "push this live", or "create a preview deployment".

31.9K 146.6K
View
programmatic-seo logo
DevOps & CI/CD

programmatic-seo

Build SEO-optimized pages at scale using templates, data, and proven playbook patterns.

53.3K 140.1K
View

Design and build isolated, reusable Convex backend components with clear boundaries and app-facing wrappers.

63 123.5K
View

Deploy and manage projects on Vercel using token-based authentication. Use when working with Vercel CLI using access tokens rather than interactive login — e.g. "deploy to vercel", "set up vercel", "add environment variables to vercel".

31.9K 116.1K
View

Coding & apps AI tools

Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View
I
Coding & apps

Imagica

Build a no-code AI app in minutes.

Freemium
View
E
Coding & apps

Emergent.sh

An IDE for code migration from legacy to modern frameworks through coding agents.

Freemium
View
Wonder Dynamics logo
Coding & apps

Wonder Dynamics

Automate CGI animation in live-action scenes

Paid
View
M
Coding & apps

Mixo

Launch a website in seconds with AI.

Paid
View
AI Code Convert logo
Coding & apps

AI Code Convert

Streamline Your Coding Experience with AI Code Helper

Free
View