Description
Summary
Add a security-focused container image flavor (Containerfile.security) that bundles code scanning, vulnerability detection, and supply chain security tools into the DocsClaw image. This complements the existing flavors proposed in #7 (docs, media, data, presentations, content).
Motivation
The base DocsClaw image is intentionally lean (curl + jq only), which is great for attack surface but means security scanning tasks fail because essential tools like git, semgrep, and trivy are missing. Today's test on OpenShift confirmed this: the agent tried git, apt-get, which, and python3 — all missing — before pivoting to web_fetch as a workaround.
A dedicated security flavor provides the right tools without bloating the general-purpose image.
Proposed tools
Base image: Fedora 42 or RHEL 10 UBI (user preference). All tools should be installable via dnf where possible; others via direct binary download in a multi-stage build.
Code scanning & static analysis
| Tool | Purpose | Install method |
|---|---|---|
semgrep |
Multi-language static analysis, OWASP rules | pip install semgrep |
gosec |
Go-specific security scanner | Binary from GitHub releases |
shellcheck |
Shell script analysis | dnf install ShellCheck |
bandit |
Python security linter | pip install bandit |
Secrets detection
| Tool | Purpose | Install method |
|---|---|---|
gitleaks |
Detect hardcoded secrets in git repos | Binary from GitHub releases |
trufflehog |
Secrets detection across git history, filesystems | Binary from GitHub releases |
Vulnerability & dependency scanning
| Tool | Purpose | Install method |
|---|---|---|
trivy |
Vulnerability scanner for code, containers, IaC | Binary from GitHub releases or dnf (Fedora) |
grype |
Vulnerability scanner for SBOMs | Binary from GitHub releases |
syft |
SBOM generation (pairs with grype) | Binary from GitHub releases |
Container & supply chain
| Tool | Purpose | Install method |
|---|---|---|
skopeo |
Container image inspection (no daemon needed) | dnf install skopeo |
cosign |
Container image signing and verification | Binary from GitHub releases |
Required base tools
| Tool | Purpose | Install method |
|---|---|---|
git |
Repository cloning and history analysis | dnf install git-core |
make |
Build system (needed by some scanners) | dnf install make |
python3 |
Runtime for semgrep, bandit | dnf install python3 python3-pip |
jq |
JSON processing | dnf install jq (already in base) |
curl |
HTTP client | dnf install curl (already in base) |
Design considerations
- Multi-stage build: Download and verify binaries in a builder stage, copy only the binaries to the runtime image. Keeps the final image smaller and avoids build dependencies in production.
- Version pinning: Pin all binary downloads to specific versions with SHA256 verification. Document versions in a
VERSIONSfile at the repo root or in the Containerfile. - Image naming:
ghcr.io/redhat-et/docsclaw:0.x.y-securityorghcr.io/redhat-et/docsclaw:security - Size budget: Expect 500MB-1GB (semgrep and trivy are the heaviest). This is acceptable for a specialized image — the base image stays lean.
- Non-root execution: All tools must work as non-root. Some scanners require writable temp/cache dirs — use emptyDir mounts on OpenShift as done for the base image workspace.
- Workspace isolation: Security tools should operate within
/tmp/agent-workspace(the agent's sandboxed workspace directory). Prevent tools from scanning the host filesystem.
Skill pairing
This image works best with a security-scanner skill (like the OCI-mounted quay.io/skillimage/security/security-scanner) that guides the agent through a structured scan workflow. The skill tells the agent what to do; the image provides the tools to do it.
Related
- Specialized Dockerfiles for agent flavors (docs, media, data, presentations, content) #7 — Specialized Dockerfiles for agent flavors (this adds a
securityflavor to that list) - feat: add OpenTelemetry tracing for agent execution #34 — OpenTelemetry tracing (security scans benefit from observability)
- refactor: use skillimage packages for skill.yaml parsing and discovery #40 — skillimage integration (security skill images)
Activity
feat: add security-focused container image flavor (#86)