docker-security
Secure Docker containers and images with hardening, scanning, and secrets management
What this skill does
# Docker Security Skill
Master container security hardening, vulnerability scanning, and secrets management following CIS Docker Benchmark.
## Purpose
Implement security best practices for Docker containers and images including non-root users, capability dropping, and vulnerability scanning.
## Parameters
| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| image | string | No | - | Image to scan |
| severity | enum | No | HIGH | CRITICAL/HIGH/MEDIUM/LOW |
| compliance | string | No | CIS | CIS/NIST/SOC2 |
## Security Hardening
### Non-Root User (MANDATORY)
```dockerfile
# Create non-root user
RUN addgroup -g 1001 app && \
adduser -u 1001 -G app -D app
# Set ownership
COPY --chown=app:app . /app
# Switch user
USER app
```
### Read-Only Filesystem
```bash
docker run --read-only \
--tmpfs /tmp:rw,noexec,nosuid \
myapp:latest
```
### Drop Capabilities
```bash
docker run \
--cap-drop ALL \
--cap-add NET_BIND_SERVICE \
myapp:latest
```
### Complete Hardened Run
```bash
docker run \
--security-opt no-new-privileges:true \
--cap-drop ALL \
--read-only \
--user 1001:1001 \
--pids-limit 100 \
--memory 512m \
myapp:latest
```
## Vulnerability Scanning
### Trivy
```bash
# Basic scan
trivy image myapp:latest
# Filter by severity
trivy image --severity CRITICAL,HIGH myapp:latest
# CI/CD integration (fail on critical)
trivy image --exit-code 1 --severity CRITICAL myapp:latest
# JSON output
trivy image --format json --output report.json myapp:latest
```
### Docker Scout
```bash
# Quick scan
docker scout cves myapp:latest
# Detailed report
docker scout cves --format markdown myapp:latest
```
## Secrets Management
### Docker Compose Secrets
```yaml
services:
database:
image: postgres:16-alpine
secrets:
- db_password
environment:
POSTGRES_PASSWORD_FILE: /run/secrets/db_password
secrets:
db_password:
file: ./secrets/db_password.txt
```
### BuildKit Secrets
```dockerfile
# syntax=docker/dockerfile:1
RUN --mount=type=secret,id=npmrc,target=/root/.npmrc \
npm install
```
```bash
docker build --secret id=npmrc,src=.npmrc .
```
## Secure Dockerfile
```dockerfile
FROM node:20-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm ci --only=production
COPY . .
RUN npm run build
FROM gcr.io/distroless/nodejs20-debian12
WORKDIR /app
COPY --from=builder /app/dist ./dist
COPY --from=builder /app/node_modules ./node_modules
USER nonroot
CMD ["dist/index.js"]
```
## Error Handling
### Common Errors
| Error | Cause | Solution |
|-------|-------|----------|
| `permission denied` | Non-root user | Fix file ownership |
| `read-only filesystem` | Read-only mode | Use tmpfs mounts |
| `operation not permitted` | Missing capability | Add specific cap |
### Fallback Strategy
1. Start without restrictions
2. Add security options incrementally
3. Test each restriction
## Troubleshooting
### Debug Checklist
- [ ] Running as non-root? `docker exec <c> id`
- [ ] Scanned for vulnerabilities?
- [ ] Capabilities dropped?
- [ ] Secrets not in env vars?
### CIS Benchmark
```bash
docker run --rm --net host --pid host \
-v /var/run/docker.sock:/var/run/docker.sock \
docker/docker-bench-security
```
## Usage
```
Skill("docker-security")
```
## Related Skills
- dockerfile-basics
- docker-production
Related in Cloud & DevOps
appbuilder-action-scaffolder
IncludedCreate, implement, deploy, and debug Adobe Runtime actions with consistent layout, validation, and error handling. Use this skill whenever the user needs to add actions to an App Builder project, understand action structure (params, response format, web/raw actions), configure actions in the manifest, use App Builder SDKs (State, Files, Events, database), deploy and invoke actions via CLI, debug action issues, or implement patterns such as webhook receivers, custom event providers, journaling consumers, large payload redirects, action sequence pipelines, and Asset Compute workers. Also trigger when users mention serverless functions in Adobe context, action logging, IMS authentication for actions, or cron-style scheduled actions.
orchestrating-datacloud
IncludedSalesforce Data Cloud product orchestrator for connect→prepare→harmonize→segment→act workflows. Use this skill when the user needs a multi-step Data Cloud pipeline, cross-phase troubleshooting, or data space and data kit management. TRIGGER when: user needs a multi-step Data Cloud pipeline, asks to set up or troubleshoot Data Cloud across phases, manages data spaces or data kits, or wants a cross-phase sf data360 workflow. DO NOT TRIGGER when: work is isolated to a single phase (use the matching phase-specific skill), the task is STDM/session tracing/parquet telemetry (use observing-agentforce), standard CRM SOQL (use querying-soql), or Apex implementation (use generating-apex).
github-project-automation
IncludedAutomate GitHub repository setup with CI/CD workflows, issue templates, Dependabot, and CodeQL security scanning. Includes 12 production-tested workflows and prevents 18 errors: YAML syntax, action pinning, and configuration. Use when: setting up GitHub Actions CI/CD, creating issue/PR templates, enabling Dependabot or CodeQL scanning, deploying to Cloudflare Workers, implementing matrix testing, or troubleshooting YAML indentation, action version pinning, secrets syntax, runner versions, or CodeQL configuration. Keywords: github actions, github workflow, ci/cd, issue templates, pull request templates, dependabot, codeql, security scanning, yaml syntax, github automation, repository setup, workflow templates, github actions matrix, secrets management, branch protection, codeowners, github projects, continuous integration, continuous deployment, workflow syntax error, action version pinning, runner version, github context, yaml indentation error
sf-datacloud
IncludedSalesforce Data Cloud product orchestrator for connect→prepare→harmonize→segment→act workflows. TRIGGER when: user needs a multi-step Data Cloud pipeline, asks to set up or troubleshoot Data Cloud across phases, manages data spaces or data kits, or wants a cross-phase `sf data360` workflow. DO NOT TRIGGER when: work is isolated to a single phase (use the matching sf-datacloud-* skill), the task is STDM/session tracing/parquet telemetry (use sf-ai-agentforce-observability), standard CRM SOQL (use sf-soql), or Apex implementation (use sf-apex).
fabric-cli
IncludedUse this skill for Fabric.so CLI workflows with the `fabric` terminal command: diagnose/install/login, search or browse a Fabric library, save notes/links/files, create folders, ask the Fabric AI assistant, manage tasks/workspaces, generate shell completion, check subscription usage, produce JSON output, and use Fabric as persistent agent memory. Do not use for Microsoft Fabric/Azure/Power BI `fab`, Daniel Miessler's Fabric framework, Python Fabric SSH, Fabric.js, or textile/fashion fabric.
lark
IncludedLark/Feishu CLI skills: lark-cli operations for docs, markdown, sheets, base, calendar, im, mail, task, okr, drive, wiki, slides, whiteboard, apps, approval, attendance, contact, vc, minutes, event. Use when the user needs to operate Lark/Feishu resources via lark-cli, send messages, manage documents, spreadsheets, calendars, tasks, OKRs, deploy web pages, or any Feishu/Lark workspace operations.