docker-security

Audit Docker containers for secure build, runtime, and supply-chain integrity.

1|1|Updated Mar 25, 2026
One-click install
npx skills add https://github.com/penghang1223/niannian-workspace --skill docker-security-penghang1223
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: docker-security
Source: https://github.com/penghang1223/niannian-workspace/tree/main/skills/docker-security
Command: npx skills add https://github.com/penghang1223/niannian-workspace --skill docker-security-penghang1223

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires docker, hadolint, trivy, cosign, jq, and includes scripts (resource) components.

What problem does it solve?

Docker containers introduce security risks across build, runtime, and supply chains; this skill provides structured auditing and hardening guidance to reduce exposure.

Core Features & Use Cases

  • Dockerfile static analysis with Hadolint to enforce secure defaults and minimize attack surface.
  • Runtime hardening, image vulnerability scanning with Trivy, and supply-chain verification via Cosign.
  • Use Case: Integrate into CI to audit images before deployment and enforce secure defaults.

Quick Start

Run the docker-security-full-audit.sh script to perform an end-to-end container security audit.

Frequently Asked Questions about docker-security

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I audit Docker containers for secure build and runtime configuration?

You can audit Docker containers by running static analysis on Dockerfiles with Hadolint, scanning images for vulnerabilities with Trivy, and verifying supply-chain signatures with Cosign to enforce secure defaults.

What is Docker supply-chain integrity verification and when do I need it?

Docker supply-chain integrity verification validates image signatures and attestations using Cosign. You need it in CI/CD pipelines before deployment to ensure images have not been tampered with and originate from trusted sources.

How do I scan Docker images for vulnerabilities in a CI/CD pipeline?

To scan Docker images for vulnerabilities in CI/CD, integrate Trivy to assess image layers and generate SBOM attestations, blocking deployments if critical security issues are detected during the pipeline execution.

Do I need Hadolint, Trivy, and Cosign installed to perform end-to-end Docker security auditing?

Yes, you need Hadolint, Trivy, Cosign, Docker, and jq installed locally or in your pipeline environment, as these tools provide the static analysis, vulnerability scanning, and signature validation required for the audit.

What is the best way to harden Dockerfiles and minimize the container attack surface?

The best way to harden Dockerfiles is using Hadolint for static analysis to enforce secure defaults, combined with Trivy runtime vulnerability scanning to identify and minimize the container attack surface.

Can I validate SBOM attestations and verify signatures for Docker images locally?

Yes, you can validate SBOM attestations and verify signatures locally by running the docker-security-full-audit.sh script, which applies Cosign to check supply-chain integrity during local development.