SiteShadow
Back to vulnerability library

DOCKER01/02 Dockerfile and Compose Risky Patterns

This page covers:

What this means

SiteShadow flagged container build/runtime configuration that increases blast radius or makes secrets easier

to leak.

Why it matters

Container misconfiguration can turn a small bug into host compromise, lateral movement, or broad data

exposure.

Safer examples

1) Run as non-root and pin base images (Dockerfile)

FROM node:20.11.1-alpine

RUN addgroup -S app && adduser -S app -G app
USER app
WORKDIR /app
COPY --chown=app:app . .
CMD ["node", "server.js"]

2) Avoid curl | bash and verify downloads

Prefer package managers and signed artifacts. If you must download, verify checksums/signatures.

3) Harden compose runtime settings (docker-compose.yml)

services:
  web:
    image: myapp:1.2.3
    read_only: true
    security_opt:
      - no-new-privileges:true
    cap_drop:
      - ALL
    ports:
      - "8080:8080"

How SiteShadow detects it (high level)

References

---

← Back to Vulnerability Library

Request access View coverage