Scan container images for vulnerabilities using Trivy, Grype, and cloud-native tools. Identify security issues in base images, packages, and configurations. Use when implementing container security, building secure images, or meeting compliance requirements.
npx skills add https://github.com/BagelHole/DevOps-Security-Agent-Skills --skill container-scanning
Scan container images for vulnerabilities and security misconfigurations.
Use this skill when:
| 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 |
# Linux
curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sh -s -- -b /usr/local/bin
# macOS
brew install trivy
# Docker
docker pull aquasec/trivy
# 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:latest
# Scan project directory
trivy fs /path/to/project
# Scan Dockerfile
trivy config Dockerfile
# Scan Kubernetes manifests
trivy config k8s/
# trivy.yaml
timeout: 10m
severity:
- HIGH
- CRITICAL
ignore-unfixed: true
exit-code: 1
vulnerability:
type:
- os
- library
scan:
file-patterns:
- "Dockerfile"
- "*.yaml"
# 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'
# Linux/macOS
curl -sSfL https://raw.githubusercontent.com/anchore/grype/main/install.sh | sh -s -- -b /usr/local/bin
# Homebrew
brew install grype
# 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/project
# .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"
# 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:latest
- name: Docker Scout
uses: docker/scout-action@v1
with:
command: cves
image: ${{ env.IMAGE_NAME }}
sarif-file: scout-results.sarif
summary: true
# Enable scan on push
aws ecr put-image-scanning-configuration \
--repository-name myapp \
--image-scanning-configuration scanOnPush=true
# Get scan findings
aws ecr describe-image-scan-findings \
--repository-name myapp \
--image-id imageTag=latest
# Start manual scan
aws ecr start-image-scan \
--repository-name myapp \
--image-id imageTag=latest
# Enable Defender for Containers
az security pricing create \
--name Containers \
--tier Standard
# View scan results in Azure Portal or:
az acr repository show \
--name myregistry \
--image myapp:latest
# Enable vulnerability scanning
gcloud artifacts repositories update myrepo \
--location=us-central1 \
--enable-vulnerability-scanning
# View vulnerabilities
gcloud artifacts docker images describe \
us-central1-docker.pkg.dev/project/myrepo/myapp:latest \
--show-package-vulnerability
apiVersion: templates.gatekeeper.sh/v1beta1
kind: ConstraintTemplate
metadata:
name: k8sallowedrepos
spec:
crd:
spec:
names:
kind: K8sAllowedRepos
validation:
openAPIV3Schema:
properties:
repos:
type: array
items:
type: string
targets:
- target: admission.k8s.gatekeeper.sh
rego: |
package k8sallowedrepos
violation[{"msg": msg}] {
container := input.review.object.spec.containers[_]
satisfied := [good | repo = input.parameters.repos[_]; good = startswith(container.image, repo)]
not any(satisfied)
msg := sprintf("container <%v> has an invalid image repo <%v>", [container.name, container.image])
}
apiVersion: kyverno.io/v1
kind: ClusterPolicy
metadata:
name: require-image-scan
spec:
validationFailureAction: enforce
rules:
- name: check-vulnerabilities
match:
resources:
kinds:
- Pod
verifyImages:
- image: "*"
attestations:
- predicateType: cosign.sigstore.dev/attestation/vuln/v1
conditions:
- all:
- key: "{{ scanner.result.summary.criticalCount }}"
operator: Equals
value: "0"
# scan-policy.yaml
policies:
- name: critical-vulnerabilities
description: Block images with critical CVEs
severity: CRITICAL
action: block
- name: high-vulnerabilities
description: Warn on high severity CVEs
severity: HIGH
action: warn
max_count: 5
- name: age-policy
description: Block images older than 30 days
max_age_days: 30
action: block
- name: base-image
description: Only allow approved base images
allowed_bases:
- alpine:3.18
- ubuntu:22.04
- python:3.11-slim
Problem: Scanner reports non-exploitable vulnerabilities
Solution: Use ignore files, validate with context
Problem: Scanning takes too long
Solution: Use caching, scan incrementally, optimize image layers
Problem: No patch available for CVE
Solution: Update base image, implement compensating controls
> This skill applies brand guidelines to content creation. It should be used when the user asks to "write an email", "draft a proposal", "create a pitch deck", "write a LinkedIn post", "draft a presentation", "write a Slack message", "draft sales content", or any content creation request where brand voice should be applied. Also triggers on "on-brand", "brand voice", "enforce voice", "apply brand guidelines", "brand-aligned content", "write in our voice", "use our brand tone", "make this sound like us", "rewrite this in our tone", or "this doesn't sound on-brand". Not for generating guidelines from scratch (use guideline-generation) or discovering brand materials (use discover-brand).
This skill should be used when the user asks to "write a post", "check my voice", "look up contact", "prepare for meeting", "weekly review", "track goals", or mentions personal brand, content creation, network management, or voice consistency.
Generate configurable chat motion overlays from a transcript or screenshot, including plain bubble scenes, app-style chat containers, optional device frames, preset or uploaded avatars, nickname display rules, and transparent-video-ready Remotion bundles. Use when Codex needs to create reusable short-form chat clips for Douyin, demo videos, story reenactments, social-message proof scenes, or embeddable alpha overlays for Hyperframe and Remotion workflows.
Realistic macOS notification banner with app icon, title, and body, suited to video overlays or product teasers.
Review content against your brand voice, style guide, and messaging pillars, flagging deviations by severity with specific before/after fixes. Use when checking a draft before it ships, when auditing copy for voice consistency and terminology, or when screening for unsubstantiated claims, missing disclaimers, and other legal flags.
List recent meetings and voice memos. Use when the user asks "what meetings did I have", "show my recent recordings", "any meetings today", "list my voice memos", or wants an overview of their meeting history. Also use when they need to find a specific meeting by browsing rather than searching.
List recent meetings and voice memos. Use when the user asks "what meetings did I have", "show my recent recordings", "any meetings today", "list my voice memos", or wants an overview of their meeting history. Also use when they need to find a specific meeting by browsing rather than searching.
Start or stop recording a meeting, call, or voice memo. Use this whenever the user says "record", "start recording", "capture this meeting", "stop recording", "I'm in a meeting", "take notes on this call", or wants to transcribe live audio. Also use when they ask about recording status or want to know if something is being recorded.
Take bagelhole/container-scanning from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.
The instructions reference brew.
Without those the skill loads but fails at the first command.