Lion Cipher Lab

Lint a Dockerfile for security with hadolint — catch the mistakes before the image exists

Why it matters

Almost every container vulnerability class starts as one line in a Dockerfile that nobody linted. `FROM ubuntu:latest` means your 'reproducible' build silently changes under you and you can't say which base you shipped. An `apt-get install curl` with no version pin means two builds a week apart contain different packages. A hardcoded `ARG DB_PASSWORD=...` bakes a secret into an image layer that anyone who pulls the image can extract. No `USER` line means your app runs as root inside the container, so a single app bug is a root bug. An `ADD https://…` pulls a remote artifact into the image…

What you'll learn

Steps in this lab

  1. From zero: what hadolint is, and how it differs from Trivy and Checkov
  2. Get hadolint running — the Docker image (easiest) or the binary
  3. Write the deliberately-bad Dockerfile
  4. Run hadolint, read the codes, and COUNT the findings (the BEFORE)
  5. Fix each real issue — and know WHY each matters for security
  6. Re-run hadolint and confirm the AFTER: the count is the measurement
  7. Judgment: triage findings and inline-ignore the ones you consciously accept
  8. The honest negative: a clean lint is NOT a secure image
  9. Where hadolint fits, in one honest opinion

Open the full interactive lab →