
Meet Orrin Billing, a fictional invoicing company whose customer wants evidence that its Docker containers are secure. See the container release path (build, scan, configure, run, sign, gate, watch) that this Docker security course follows, and what you will produce: a hardened image, a CI/CD release gate and a release evidence pack. All course resources are in this lecture.
Set up the Orrin lab kit on Docker Desktop or Podman Desktop, run the deliberately weak Flask API and Postgres stack with Docker Compose, and confirm it works. Every security tool in the course runs as a pinned container, so there are no cloud costs or local installs.
Learn how a container image is built from layers, why deleted files and secrets stay in image history, and how tags differ from immutable digests. Inspect the Orrin image with docker history and see what a registry really stores and serves.
Understand the Linux namespaces and cgroups that isolate containers, and why every container shares the host kernel. See which isolation boundaries matter for container security and how resource limits relate to denial of service.
Compare container isolation with virtual machine isolation, and learn where the security boundary actually sits. Understand container escape risk, why a container is not a VM, and when stronger isolation is worth it.
Threat model the weak Orrin stack: privileged containers, the Docker socket, baked-in secrets and exposed database ports. Build an attack-path map that the rest of the course closes, one Docker hardening control at a time.
Compare official, distroless and minimal base images, check publisher trust, and pin a base image by digest instead of a moving tag. Learn how to keep a pinned base image up to date safely.
Cut the packages, shells and tools an attacker could use inside a container. Measure the Orrin image's package count and attack surface before and after, and see how a smaller Docker image means fewer vulnerabilities to triage.
Use Docker multi-stage builds to keep compilers, build tools and caches out of the runtime image. Build Orrin's API on a distroless runtime stage and compare image size, layers and contents.
Run the container process as an unprivileged user with the Dockerfile USER instruction, fix file ownership and permissions, and see what root inside a container can still do. A core Docker hardening step.
Lint Dockerfiles with hadolint and docker build --check to catch insecure patterns such as secrets in ARG or ENV. Use .dockerignore to keep .env files, keys and Git history out of the build context.
Hands-on lab: rebuild the Orrin image with every Section 2 change, compare it with the original image, and prove the app still works. Produce the first page of the release evidence pack: a before-and-after table.
Learn how container vulnerability scanners match package databases against CVE feeds, and where they go blind: statically linked binaries, copied files, unfixed CVEs and false positives. A scan result is evidence, not a verdict.
Scan the Orrin image with Trivy and Grype, compare findings, and understand why two scanners disagree. Choose one scanner as the CI/CD gate and use the other for prioritization and cross-checking.
Prioritize container vulnerabilities with CVSS severity, EPSS exploit probability, the CISA KEV catalog and reachability. Decide whether a CVE actually applies to how the Orrin application runs.
Record not-affected decisions as VEX (Vulnerability Exploitability eXchange) statements, and manage accepted risk with an exception register in which every exception has an owner, a reason and an expiry date.
Choose between upgrading a package, replacing a base image or component, and accepting risk with a documented exception. Apply a repeatable vulnerability remediation decision to Orrin's findings.
Hands-on lab: triage Orrin's scan results, upgrade vulnerable Python packages with hash-locked requirements, switch to a production server, write VEX statements, and rescan to prove the fixes worked.
See how API keys and passwords leak into Docker images through ENV, ARG, COPY, build history and deleted files, and why removing a file in a later layer does not remove it from the image.
Hunt for baked-in secrets in image layers, image configuration and build history with Trivy secret scanning, custom rules and a layer-by-layer search. Extract Orrin's leaked credentials yourself.
Pass build-time secrets with Docker BuildKit secret mounts so they never land in a layer or the image history, and learn which build arguments are safe. Catch secrets in ARG or ENV with docker build --check.
Deliver runtime secrets as mounted files with Docker Compose secrets and the _FILE pattern instead of environment variables. Compare secret delivery options, including secrets managers, and their trade-offs.
Hands-on lab: remove secrets from the Orrin image, rotate the leaked database password, and prove the old credential no longer works and the new image is clean of secrets.
Understand why privileged containers give away the host, and how Linux capabilities split root's powers. Drop all capabilities with cap_drop and add back only what each container needs.
Run containers with a read-only root filesystem and tmpfs mounts for temporary files, and avoid dangerous host bind mounts. Stop attackers from writing tools or backdoors into a running container.
Set memory, swap, CPU and PIDs limits to contain denial-of-service and fork bombs, and block privilege escalation through setuid binaries with the no-new-privileges security option.
Learn how seccomp filters system calls and how AppArmor and SELinux confine containers. See Docker's default seccomp profile in action and why you should never run a container with seccomp unconfined.
Compare rootless Docker, user namespace remapping and Docker Desktop's isolation, and understand the limits of each. Build a production-host checklist for Docker daemon security.
Hands-on lab: apply every runtime hardening control to Orrin's Docker Compose file, then break-test it with real attack attempts to prove each control blocks, while the app keeps working.
Learn how Docker port publishing exposes services on every interface, how Docker can bypass host firewall rules, and how to bind ports to localhost only. Find Orrin's exposed database port.
Segment container networks with Docker Compose frontend and internal backend networks so the database is unreachable from the outside and cannot reach the internet. Test the segmentation with real connections.
See why mounting /var/run/docker.sock gives a container root on the host, demonstrate the attack in the lab, and use safer alternatives such as socket proxies when a tool truly needs Docker access.
Apply least privilege to container registry access, push and pull permissions, the docker group and administrative access, and protect release tags from being overwritten.
Hands-on lab: bind ports, segment networks and remove the Docker socket from the Orrin stack, then re-run the earlier break tests to prove nothing regressed and the attack paths are closed.
Generate a software bill of materials (SBOM) for the Orrin image in SPDX and CycloneDX formats, and use it to answer questions about what is inside an image and whether a new CVE affects you.
Learn how build provenance records who built an image, from which source and how, and how the SLSA framework grades supply-chain integrity. Attach provenance attestations to the Orrin image.
Sign container images by digest with Sigstore Cosign, attach SBOM and provenance attestations, and manage signing keys. Understand what a signature proves and what it does not.
Verify image signatures and attestations with Cosign before deployment, deploy by digest only, and catch an impostor image pushed over a release tag.
Learn from the March 2026 compromise of the Trivy security tool why a valid signature proves origin, not safety. Separate signing, scanning and pinning decisions in your container supply chain.
Hands-on lab: generate an SBOM, sign and attest the Orrin image with Cosign, verify it, then tamper with the image and watch verification fail.
Design a CI/CD security release gate: decide which container security checks block a release and which only warn, and set rules that a team will trust rather than ignore.
Build Orrin's release gate as a pipeline script that runs Dockerfile linting, build checks, secret scanning, compose policy checks, vulnerability scanning and image signing, with a GitHub Actions reference workflow.
Feed the exception register and VEX file into the release gate, block releases when an exception expires, and see how an expired exception stops a release candidate.
Pin CI/CD tools and actions by digest, verify the tools' own signatures, and update them deliberately. Protect the pipeline from supply-chain attacks like the Trivy compromise.
Keep a release evidence folder for every run, with a signed manifest of hashes, and prove that nobody changed it afterwards. Answer audit and customer questions months later.
Hands-on lab: feed the release gate six realistic bad changes (secrets, weak compose files, vulnerable and leaky images) and prove each one is blocked, while a good change still passes.
Capture a runtime baseline of processes, resources and file changes for running containers, and turn Docker events such as exec and OOM kills into security alerts.
Compare running containers against the baseline to detect drift and unexpected processes, check that what's running is still the signed image, and see why hardened containers make detection easier.
Contain a compromised container in the right order: collect volatile evidence, disconnect networks, pause, and preserve a forensic image and export with hashes and chain of custody.
Recover from a container incident: replace rather than clean, rebuild from source through the gate, redeploy a verified digest and rotate exposed secrets.
Hands-on lab: investigate a compromised container from the first alert to an incident report, answering what ran, what changed, what was taken and how it happened, with a real timeline.
Translate Docker hardening settings to Kubernetes securityContext, Secrets and NetworkPolicy, and learn which Docker defaults Kubernetes does not apply, such as seccomp and service account tokens.
Apply the Kubernetes Pod Security Standards (privileged, baseline, restricted) with namespace labels, configure securityContext correctly, and see two missing lines break the restricted profile.
Understand Kubernetes admission control and test Kyverno policies offline to require digests, approved registries, resource limits and restricted pod security before anything runs.
Capstone: decide every remaining vulnerability with evidence, pin and persist the database, ship release 1.5.0 through the gate with zero warnings, and re-test every attack path.
Assemble the signed release evidence pack that answers the customer's question, review the before-and-after results across the course, and set a routine to keep container security evidence current.
This course contains the use of artificial intelligence.
Learn Docker container security and DevSecOps the way security reviews expect it. Most container images pass their tests and still ship with problems: a root user, a baked-in API key, a privileged flag, a database port open to the world, and a release process nobody could prove. Then a customer's security review asks for evidence, and "it runs, and the tests pass" isn't an answer. This course takes you from that point to a hardened, signed, tested release, with the evidence to back every decision.
Learn by securing one real application
You'll follow Orrin Billing, a fictional invoicing company whose biggest customer wants proof that its containers are secure before renewing. Orrin's invoice API (Python and Flask) and its Postgres database start out deliberately weak. Section by section, you'll fix them on your own computer, and every result you see on screen comes from real runs, not mockups.
All labs run locally on Docker Desktop (or Podman Desktop). Every security tool runs as a pinned container, so there's nothing else to install and no cloud account to pay for.
What you'll cover
Container architecture and threat boundaries: images, layers, registries, namespaces, cgroups, the shared kernel, and an attack-path map
Secure image construction: trusted and pinned base images, distroless and multi-stage builds, non-root users, hadolint and .dockerignore
Vulnerability assessment with Trivy and Grype: CVSS, EPSS, CISA KEV, reachability, VEX statements and exceptions that expire
Secrets: finding secrets baked into layers, BuildKit secret mounts, runtime secret files, and rotating leaked credentials
Runtime hardening: Linux capabilities, read-only filesystems, resource limits, no-new-privileges, seccomp, AppArmor, SELinux and rootless mode
Network and admin access: published ports, network segmentation, the Docker socket, and registry permissions
Supply-chain integrity: SBOMs, provenance and SLSA, Cosign signing and verification, and why signed doesn't mean safe
CI/CD enforcement: a release gate that blocks or warns, exceptions in the pipeline, pinned tools and retained evidence
Monitoring and incident handling: baselines, Docker events, drift detection, evidence-safe containment and recovery
Kubernetes extension: securityContext, Pod Security Standards and admission policies with Kyverno
What's included
56 lectures across 10 sections, with a hands-on lab in every section from Section 2 on
The Orrin lab kit: the weak starting application, command files for every section, the release gate, policies and tools
An exception register template in Excel and PDF
A capstone in which you ship the final release through the gate and assemble a signed evidence pack
Every resource in the first lecture, ready to download
What makes this course different
One application from insecure to hardened, so every control is applied and tested in context
Every control is break-tested: you prove the app still works, and you prove the control actually blocks
Honest about limits: what scanners miss, what a signature does and doesn't prove, and what a gate can't see