container-scanning
container-scanning is an code AI skill with a core value of Scan container images for vulnerabilities using Trivy, Grype, and cloud-native tools. It
helps developers solve real-world problems in the code domain, boosting
efficiency, automating repetitive tasks, and optimizing workflows.
Scan container images for vulnerabilities using Trivy, Grype, and cloud-native tools.
Quick Facts
mkdir -p ./skills/container-scanning && curl -sfL https://raw.githubusercontent.com/sickn33/antigravity-awesome-skills/main/skills/container-scanning/SKILL.md -o ./skills/container-scanning/SKILL.md Run in terminal / PowerShell. Requires curl (Unix) or PowerShell 5+ (Windows).
Skill Content
# Container Scanning
Scan container images for vulnerabilities and security misconfigurations.
When to Use This Skill
Use this skill when:
- Building container images
- Implementing container security gates
- Scanning registry images
- Meeting compliance requirements
- Hardening container deployments
Prerequisites
- Container runtime (Docker, Podman)
- Container images to scan
- Scanning tool installation
Tool Comparison
| Tool | License | Speed | Features |
|------|---------|-------|----------|
| Trivy | OSS | Fast | Comprehensive, IaC |
| Grype | OSS | Fast | Accurate, SBOM |
| Clair | OSS | Medium | Registry integration |
| Snyk Container | Commercial | Fast | Fix suggestions |
| Docker Scout | Commercial | Fast | GitHub integration |
Trivy
Installation
# Linux
curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh -o /tmp/install-trivy.sh && sh /tmp/install-trivy.sh && rm /tmp/install-trivy.sh -s -- -b /usr/local/bin
# macOS
brew install trivy
# Docker
docker pull aquasec/trivyImage Scanning
# Scan local image
trivy image myapp:latest
# Scan remote image
trivy image nginx:1.25
# JSON output
trivy image --format json -o results.json myapp:latest
# Filter by severity
trivy image --severity HIGH,CRITICAL myapp:latest
# Ignore unfixed vulnerabilities
trivy image --ignore-unfixed myapp:latest
# Exit code on vulnerability
trivy image --exit-code 1 --severity CRITICAL myapp:latestFilesystem Scanning
# Scan project directory
trivy fs /path/to/project
# Scan Dockerfile
trivy config Dockerfile
# Scan Kubernetes manifests
trivy config k8s/Configuration
# trivy.yaml
timeout: 10m
severity:
- HIGH
- CRITICAL
ignore-unfixed: true
exit-code: 1
vulnerability:
type:
- os
- library
scan:
file-patterns:
- "Dockerfile"
- "*.yaml"CI Integration
# GitHub Actions
name: Container Security
on:
push:
branches: [main]
pull_request:
jobs:
scan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build image
run: docker build -t myapp:${{ github.sha }} .
- name: Run Trivy
uses: aquasecurity/trivy-action@master
with:
image-ref: 'myapp:${{ github.sha }}'
format: 'sarif'
output: 'trivy-results.sarif'
severity: 'CRITICAL,HIGH'
exit-code: '1'
- name: Upload results
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: 'trivy-results.sarif'Grype
Installation
# Linux/macOS
curl -sSfL https://raw.githubusercontent.com/anchore/grype/main/install.sh -o /tmp/install-grype.sh && sh /tmp/install-grype.sh && rm /tmp/install-grype.sh -s -- -b /usr/local/bin
# Homebrew
brew install grypeUsage
# Scan image
grype myapp:latest
# Scan from SBOM
grype sbom:./sbom.json
# JSON output
grype myapp:latest -o json > results.json
# Filter severity
grype myapp:latest --fail-on high
# Scan directory
grype dir:/path/to/projectConfiguration
# .grype.yaml
check-for-app-update: false
fail-on-severity: high
output: "json"
scope: "Squashed"
ignore:
- vulnerability: CVE-2023-12345
reason: "False positive"
expires: "2024-12-31"Docker Scout
Usage
# Enable Docker Scout
docker scout quickview myapp:latest
# Full CVE report
docker scout cves myapp:latest
# Compare images
docker scout compare myapp:v1 myapp:v2
# Recommendations
docker scout recommendations myapp:latestCI Integration
- name: Docker Scout
uses: docker/scout-action@v1
with:
command: cves
image: ${{ env.IMAGE_NAME }}
sarif-file: scout-results.sarif
summary: trueRegistry Integration
Amazon ECR
# Enable scan on push
aws ecr put-image-scanning-configuration \
--repository-name myapp \
--image-scanning-configuration scanOnPush=true🎯 Best For
- Claude users
- Software engineers
- Development teams
- Tech leads
💡 Use Cases
- Code quality improvement
- Best practice enforcement
📖 How to Use This Skill
- 1
Install the Skill
Copy the install command from the Terminal tab and run it. The SKILL.md file downloads to your local skills directory.
- 2
Load into Your AI Assistant
Open Claude and reference the skill. Paste the SKILL.md content or use the system prompt tab.
- 3
Apply container-scanning to Your Work
Open your project in the AI assistant and ask it to apply the skill. Start with a small module to verify the output quality.
- 4
Review and Refine
Review AI suggestions before committing. Run tests, check for regressions, and iterate on the skill output.
❓ Frequently Asked Questions
Is container-scanning compatible with Cursor and VS Code?
Yes — this skill works with any AI coding assistant including Cursor, VS Code with Copilot, and JetBrains IDEs.
Do I need specific dependencies for container-scanning?
Check the install command and Works With section. Most code skills only require the AI assistant and your codebase.
How do I install container-scanning?
Copy the install command from the Terminal tab and run it. The skill downloads to ./skills/container-scanning/SKILL.md, ready to use.
Can I customize this skill for my team?
Absolutely. Edit the SKILL.md file to add team-specific instructions, examples, or workflows.
⚠️ Common Mistakes to Avoid
Skipping validation
Always test AI-generated code changes, even for simple refactors.
Missing dependency updates
Check if the skill requires updated dependencies or new packages.