
Welcome to Container Security Essentials: Docker, Kubernetes & CI/CD. This opening lecture introduces the course, explains why container security has become a core skill for modern engineering teams, and shows how each section builds toward a secured, end-to-end containerized application.
We begin with the shift that makes this topic important. Organizations package applications as containers, run them on Docker hosts and Kubernetes clusters, and ship them through automated pipelines many times a day. That speed brings great benefits, but it also means that a weak base image, an exposed secret, an over-privileged pod, or an unchecked pipeline can reach production quickly and affect many systems at once.
You will see the learning path. We start with fundamentals and build a safe local lab around a sample application called SecureCart. Then we secure images, scan for vulnerabilities, harden Docker runtime settings, and manage secrets and the software supply chain. Next we move to Kubernetes, covering workload hardening, policies, RBAC, network controls, and secrets. Finally we add runtime threat detection with Falco, security automation in GitHub Actions, security operations, and a final capstone.
Each section pairs clear concepts with a hands-on lab, so you practice every control on a real application. By the end of this lecture you will understand what the course covers, which tools you will use, and how to get the most out of every lesson and exercise.
What is container security, and why does it matter so much? This lecture defines the discipline and explains why it deserves dedicated attention rather than being treated as a minor extension of server security.
Container security is the practice of protecting containerized applications across their full lifecycle: the images you build, the registries that store them, the hosts and runtimes that execute them, the orchestration platforms that manage them, and the pipelines that deliver them. It combines ideas from application security, infrastructure security, and supply chain security.
We discuss why it matters. Containers are widely used, which makes them an attractive target. They share the host kernel, so a weakness in isolation can affect the whole machine. Images are built from layers of third-party code, so vulnerabilities and malicious content can be inherited without anyone noticing. Containers are created and destroyed quickly, which makes traditional, slow security processes hard to apply. Misconfiguration, such as running as root, mounting sensitive host paths, or exposing the Docker socket, is a leading cause of problems.
We also introduce the shared responsibility between developers, platform teams, and security teams, and the idea of shifting security left so that issues are found while building rather than after deployment.
Finally, we preview the main control areas covered in the course. By the end of this lecture you will be able to explain what container security covers and why a structured, layered approach is necessary.
Containers and virtual machines both isolate workloads, but they do so in very different ways, and those differences shape security decisions. This lecture compares them in detail.
We begin with virtual machines. A hypervisor runs multiple virtual machines on one physical host, and each virtual machine has its own full guest operating system and kernel. Isolation is strong because the boundary between guests is enforced by the hypervisor and hardware virtualization features, though the cost is higher resource use and slower start times.
Next, we describe containers. Containers run as isolated processes on a shared host kernel. Linux features such as namespaces limit what a process can see, control groups limit what it can consume, and additional mechanisms such as capabilities and system call filters restrict what it can do. Containers are lightweight, start quickly, and make efficient use of resources.
The security implication is that the kernel is shared. A kernel vulnerability or a misconfiguration, such as a privileged container, can allow an attacker to break out of the container and reach the host or other containers. In contrast, a virtual machine escape is generally harder.
We discuss how to choose. Use containers for speed and density, and add layers such as hardened configurations, sandboxed runtimes, or virtual machine isolation for untrusted or highly sensitive workloads. We also mention combining both, such as running containers inside virtual machines. By the end of this lecture you will be able to explain the tradeoffs clearly.
To secure containers, you must understand how they are built, stored, and run. This lecture explains the architecture of images, registries, runtimes, and hosts.
We begin with images. A container image is a read-only package made of layers that contains an application, its libraries, and its configuration. Images are described by a Dockerfile or a similar build file, and each instruction usually creates a layer. Images are identified by names and tags, and more precisely by content digests that act as fingerprints.
Next, we cover registries. A registry stores and distributes images. Public registries host community images, while private registries hold an organization's own. Pulling an image means trusting its publisher and the registry's integrity, which is why authentication, access control, and verification matter.
Then we describe runtimes. A container runtime creates and manages containers from images, handling isolation setup, networking, and storage. Common components include the Docker engine and lower-level runtimes that implement the container standards. Orchestrators such as Kubernetes schedule containers across hosts.
Finally, we discuss the host, the machine and operating system that run everything. The host kernel, the daemon, and the orchestration agents are all part of the trusted computing base.
For each element we note typical security questions: what is inside, who can change it, who can run it, and what can it reach. By the end of this lecture you will have a clear mental model of the container ecosystem.
An attack surface is the sum of all the ways in which an attacker could try to reach or harm a system, and this lecture maps the attack surface of containerized applications.
We begin with the image. It may contain vulnerable packages, outdated libraries, embedded secrets, unnecessary tools, and a root user. Next, the build process and registry are part of the surface: a compromised build system or an unprotected registry can introduce malicious images, and tags can be overwritten without notice.
At runtime, the surface includes the container configuration. Privileged mode, excess capabilities, host path mounts, host network access, and exposure of the Docker socket can weaken isolation. The application itself has network ports, APIs, and dependencies that attackers can target. The shared kernel and the container runtime are also potential targets.
In orchestrated environments, we add the Kubernetes API server, the control plane components, node agents, service accounts and their tokens, role bindings, network paths between pods, secrets storage, and ingress points. Observability and management tools, such as dashboards, may also be exposed.
Finally, the delivery pipeline adds source repositories, build runners, pipeline credentials, and deployment mechanisms.
We discuss how to reduce the surface: remove what you do not need, restrict what remains, and monitor everything. By the end of this lecture you will be able to describe the surface in each layer and prioritize which parts to protect first.
Learning from common failures helps you recognize risk before it causes harm, and this lecture reviews typical container security threats and the failure scenarios behind them.
We start with image-related issues. Teams pull a convenient public image without checking its origin, inherit known vulnerabilities from an outdated base image, or accidentally include credentials in a layer. Images tagged latest change without notice, so the same name can refer to different content over time.
Next, we cover configuration failures. Containers run as root with all capabilities, privileged mode is enabled to make something work, the Docker socket is mounted into a container, sensitive host directories are shared, or no resource limits are set, which allows one container to exhaust the host. In Kubernetes, default service accounts with broad permissions, missing network policies that let every pod talk to every other pod, and exposed dashboards or API endpoints are frequent causes of incidents.
We discuss runtime and operational threats: cryptomining after a compromise, lateral movement between workloads, data theft through over-privileged access, and attacks that attempt to escape the container. Supply chain problems, including malicious packages and tampered pipelines, also appear.
For each scenario, we describe the underlying cause, usually a missing control or an unsafe default, and the control that would have limited the damage. By the end of this lecture you will be able to recognize common failure patterns and connect them to the defenses you will build in the course.
No single control can protect a containerized environment, and this lecture introduces defense in depth and the container security lifecycle as the framework for the whole course.
Defense in depth means layering controls so that if one fails, another still limits the harm. For containers, the layers include secure images, trusted registries, hardened runtime configuration, host protection, orchestration policies, network segmentation, identity and access control, secrets protection, monitoring, and incident response.
Next, we present the lifecycle. In the build phase, you choose minimal base images, write secure Dockerfiles, scan for vulnerabilities and secrets, generate software bills of materials, and sign images. In the distribution phase, you protect registries, verify provenance, and control who can push and pull. In the deploy phase, you apply admission policies, security contexts, and least-privilege access. In the run phase, you monitor behavior, detect threats, and respond to incidents. In the maintain phase, you patch, rebuild, and redeploy as new vulnerabilities appear, and you review controls continuously.
We discuss the idea of shifting left, catching problems early when they are cheap to fix, while also shifting right with runtime detection for problems that slip through.
We map each course section to a stage of the lifecycle so you can see the path ahead. By the end of this lecture you will understand how layered controls fit together across the whole lifecycle.
In this hands-on exercise you will identify security risks in a containerized application, practicing the habit of assessing a system before attempting to harden it.
Begin with the sample application files provided in the lab package. Read the Dockerfile and look at the base image, the user that the container runs as, the packages installed, the files copied in, and any ports exposed. Review the Docker Compose file for volume mounts, environment variables, privileged settings, and network configuration. Look at the application configuration for hardcoded credentials or insecure defaults.
Next, create a simple risk table. For each issue you find, write the location, a description in plain language, the potential impact, and a rough severity rating. Examples might include a base image tagged latest, a container running as root, a secret stored in an environment variable, an unnecessary port, a missing health check, or no resource limits.
Then map each finding to a layer of the container security lifecycle and the type of control that would address it, such as image hardening, runtime restrictions, or secrets management. Do not fix anything yet. The goal is to practice observation and prioritization.
Finally, identify the three issues that you consider most serious and justify your choice. Save the table in your lab folder, because you will return to it in later sections to measure improvement after each control is applied.
This lecture introduces the Container Security Essentials hands-on lab package and the final project, so that you know what resources are available and how the course practice fits together.
We explain what is included. The package contains the SecureCart sample application with intentionally weak configurations, Dockerfiles, Compose files, Kubernetes manifests, example security policies, pipeline definitions, scripts, and checklists. Folders are organized by section, with starting files and reference solutions for each lab, so you can attempt each task yourself and then compare your result.
You will learn how to download and extract the package and where to place it on your computer. We recommend creating a Git repository for your working copy so that you can track each change and see exactly how every security improvement alters the configuration. We also explain naming conventions and how labs build on each other.
We then preview the final project. You will secure SecureCart end to end, hardening its images, applying runtime isolation, locking down Kubernetes workloads, access, and networking, adding runtime detection, integrating security gates into CI/CD, and validating and documenting the results. The project mirrors what a real security engineer would deliver.
We also cover good practices for the labs: work only in your own isolated environment, never use real credentials, and reset the lab between experiments when needed. By the end of this lecture you will know where everything is and how to approach the practice work.
Before installing tools, it helps to see the whole lab design. This lecture introduces the container security lab environment, the tools in it, and how they fit together.
We begin with the overall architecture. Your computer runs Docker, which builds and runs images and provides the foundation for the early sections. A local Kubernetes cluster created with kind runs inside Docker and gives you a safe, disposable cluster for the later sections. The kubectl command-line tool controls that cluster. Trivy scans images and configuration for vulnerabilities, misconfigurations, and secrets. Syft generates software bills of materials. Later, you will add Cosign for signing, Kyverno for policy enforcement, Falco for runtime detection, and GitHub Actions for automation.
We introduce the sample application, SecureCart, a small multi-service retail app with a web front end, an API, and a database. It is deliberately insecure at the start so that you can find and fix real problems. Everything runs locally and uses fake data and credentials.
We discuss system requirements, including memory, disk space, and virtualization support, and recommend closing heavy applications while running Kubernetes. We also explain how the lab is organized and how to reset it.
By the end of this lecture you will understand each component, why it is used, and what you need to prepare before the installation lessons.
Docker is the foundation of the lab, and in this lecture you will learn the difference between Docker Desktop and Docker Engine and how to install the option that suits your computer.
We begin with definitions. Docker Engine is the core component that builds images and runs containers, and it is typically installed directly on Linux servers. Docker Desktop is a packaged application for Windows and macOS, and also available for Linux, that bundles the engine with a lightweight virtual machine, a graphical interface, and integrations such as Kubernetes and Compose. We discuss licensing considerations for Docker Desktop in some organizations, and mention alternatives that provide compatible command-line behavior.
Next, you will install the appropriate option for your operating system. We cover enabling virtualization, adjusting memory and processor settings, and granting required permissions. We explain the difference between running Docker commands with and without elevated privileges, and why adding users to the Docker group effectively gives them root-level control over the host, a point that returns in the hardening section.
You will verify the installation by checking the version, running a test container, listing images and containers, and viewing logs. We also introduce Docker Compose, which defines multi-container applications in a file.
Finally, we cover common problems such as virtualization disabled in firmware, insufficient memory, and permission errors. By the end of this lecture you will have a working Docker installation and understand its security implications.
Kubernetes is a major focus of this course, and in this lecture you will install the tools that let you run a local cluster and control it: kubectl and kind.
We begin with kubectl, the command-line client for Kubernetes. It sends requests to the cluster's API server to create, inspect, and change resources. You will install it for your operating system, verify its version, and learn the basic command pattern: verb, resource type, and name. We cover commands for listing pods, describing resources, reading logs, and applying files.
Next, we introduce kind, which stands for Kubernetes in Docker. It creates a real Kubernetes cluster by running the cluster nodes as containers on your machine. This is ideal for learning and testing because clusters can be created and deleted in seconds without any cloud account. You will install kind, write a small configuration file, and create a cluster with a control plane and worker node. Then you will use kubectl to check the nodes and system pods.
We explain contexts, which kubectl uses to decide which cluster to talk to, and why you should always confirm the current context before running commands, to avoid acting on the wrong cluster.
We also mention resource usage, how to delete and recreate the cluster, and how to troubleshoot problems such as port conflicts and Docker memory limits. By the end of this lecture you will have a functioning local Kubernetes cluster ready for later labs.
Security tools help you see what is wrong with images and configurations, and in this lecture you will install Trivy, Syft, and the supporting utilities used throughout the course.
We begin with Trivy, an open-source scanner from Aqua Security. It can analyze container images, file systems, repositories, and infrastructure configuration files to find known vulnerabilities, misconfigurations, and exposed secrets. You will install it using the method for your platform and verify that it runs. We explain how Trivy downloads and caches its vulnerability database, and why keeping it updated matters.
Next, we introduce Syft, a tool that inspects an image or directory and produces a software bill of materials, which is a list of the packages and libraries it contains. You will install it and generate a first inventory for a simple image. We explain how this inventory supports vulnerability management and supply chain transparency.
We also install supporting utilities, such as a JSON processor for reading tool output, Git for version control, and a few helpers for working with YAML and certificates. Later sections add tools such as Cosign, Kyverno, and Falco when they are needed.
You will run each tool against a harmless sample to confirm that the installation works. We also discuss using pinned versions and verifying downloads from official sources. By the end of this lecture your toolbox will be ready for scanning, inventory, and analysis.
SecureCart is the sample application that you will assess, break, and then harden throughout the course, and in this lecture you will explore how it is built.
We begin with the business story. SecureCart is a small online store with a web front end, a product and order API, and a database. It is designed to look like a realistic microservice application while remaining small enough to understand completely.
You will review the repository structure. Each service has its own source code, a Dockerfile, and configuration. A Compose file defines how the services run together on a single machine, and a folder of Kubernetes manifests describes the same application for a cluster. You will read through each component and note how requests flow from the browser to the front end, to the API, and to the database.
Along the way, we point out characteristics that will matter for security: the base images used, the user that each container runs as, the ports exposed, the environment variables and credentials, the volumes mounted, and the dependencies installed. We also note that SecureCart intentionally contains weaknesses so that you can find them and practice fixing them, and that all data and credentials are fake.
You will run the application locally and use it in a browser. By the end of this lecture you will understand how SecureCart works, which prepares you for assessing and hardening it.
Containerized applications are defined by a handful of file types, and this lecture explains Dockerfiles, Docker Compose files, and Kubernetes YAML with a focus on the settings that affect security.
We begin with Dockerfiles. They describe how to build an image: the base image, files to copy, commands to run, environment variables, exposed ports, the user, and the startup command. We walk through the main instructions and note which have security consequences, such as the choice of base image, installing packages, copying secrets by accident, and switching to a non-root user.
Next, we cover Docker Compose files, which define services, networks, volumes, and environment settings for multi-container applications on one host. We highlight security-relevant settings such as published ports, mounted host paths, privileged mode, added capabilities, network membership, resource limits, and the handling of environment variables and secrets.
Then we introduce Kubernetes YAML. Resources such as Deployments, Services, ConfigMaps, Secrets, and ServiceAccounts are declared in structured files. We explain the basic structure, including metadata, specification, and labels, and point out security-relevant fields such as the security context, resource limits, service account name, volume mounts, and image references.
Reading these files carefully is a core security skill, because they reveal how a system will behave. By the end of this lecture you will be comfortable reading all three formats and spotting risky settings.
You cannot measure improvement without a starting point, and this lecture explains how to establish a security baseline before hardening anything.
We begin with what a baseline is: a recorded snapshot of the current security state of a system, captured using consistent methods. It gives you evidence of where you started, a way to prioritize work, and a way to show progress to others.
You will learn what to record. Run an image vulnerability scan and save the counts by severity. Run a configuration scan on the Dockerfiles, Compose file, and Kubernetes manifests and record the findings. Check which user each container runs as, which capabilities and privileges are in effect, which ports are exposed, which volumes are mounted, and whether resource limits and health checks are defined. Scan for exposed secrets. Generate a software bill of materials and note the number of packages. Note the image sizes, which are a rough indicator of attack surface.
We discuss how to document results in a table or a report with the date, tool versions, commands used, and the exact image identifiers, so that the measurements can be repeated. We also discuss choosing a few meaningful metrics to track.
Finally, we explain how to repeat the measurements after each hardening step. By the end of this lecture you will be able to create a repeatable baseline that supports evidence-based security work.
In this hands-on exercise you will deploy and inspect the insecure SecureCart application, which will serve as the starting point for every hardening exercise that follows.
Begin by building the SecureCart images from the provided Dockerfiles and starting the application with Docker Compose. Confirm that all services are running and that you can use the store in your browser. Review the container logs to be sure that the services start without errors.
Next, inspect the running containers as a security reviewer would. List the containers and the images they use. Check which user each process runs as. View the environment variables and identify any credentials. Inspect the mounted volumes and published ports. Look at the container configuration to see whether privileged mode, added capabilities, or host mounts are in use. Check resource limits and network settings.
Then run your baseline scans. Use Trivy to scan each image and record the number of findings by severity. Run a configuration scan on the project files. Generate a software bill of materials with Syft. Save all outputs in a baseline folder.
Finally, summarize your findings in a short report that lists the most serious issues you observed and the sections in which you will address them. Commit the baseline to your repository. By the end of this exercise you will have a running insecure application and the evidence needed to show how much each hardening step improves it.
Container images are built from layers, and this lecture explains how layers work and why they create security risks that are easy to overlook.
We begin with how an image is constructed. Each instruction in a Dockerfile that changes the file system, such as copying files or installing packages, creates a new read-only layer. Layers are stacked, and the container sees the combined result. Layers are cached and shared between images, which makes builds and distribution efficient.
The security implication is that layers are permanent records. If you copy a secret into an image in one step and delete it in a later step, the final file system no longer shows it, but the earlier layer still contains it, and anyone who can pull the image can extract it. The same applies to build tools, source code, and credentials left behind in intermediate layers.
We discuss other risks. Each layer may include packages with known vulnerabilities, and an image inherits everything from its base. Large images contain more software and so a larger attack surface. Image history reveals commands, arguments, and sometimes sensitive information. Cached layers may hide outdated content.
You will learn to inspect layers, view image history, and examine the contents of each layer with command-line tools. We also introduce practices that reduce risk: order instructions carefully, combine steps to avoid leaving sensitive material behind, never copy secrets into images, and use multi-stage builds. By the end of this lecture you will be able to reason about what an image really contains.
The base image is the foundation of everything you build, and this lecture explains how to choose trusted and minimal base images.
We begin with trust. A base image from an unknown publisher might contain malware, outdated components, or unwanted configuration. Prefer official images from verified publishers, images maintained by reputable organizations, and images from your own organization's curated catalog. Check the publisher, update frequency, documentation, and whether the image is signed or has published provenance.
Next, we discuss minimalism. A full operating system image includes a shell, package managers, compilers, and many utilities that your application never needs, but an attacker would be glad to find. Smaller images contain fewer packages and therefore fewer vulnerabilities and fewer tools to abuse. We compare common options, including full distribution images, slim variants, Alpine-based images with a small footprint, and distroless images that contain only the application and its runtime dependencies. We discuss tradeoffs such as compatibility, debugging convenience, and library differences.
You will learn to compare options by scanning them with Trivy and measuring size and vulnerability counts, which turns the choice into an evidence-based decision.
We also cover keeping base images current. Plan for regular rebuilds to pick up fixes, use specific version tags, and consider pinning digests, which we cover later. By the end of this lecture you will be able to select base images that balance security, size, and practicality.
Multi-stage builds are one of the most effective techniques for producing smaller and safer images, and this lecture shows how they work.
We begin with the problem. Building an application often requires compilers, build tools, package managers, test frameworks, and source code. If you build and run in the same image, all of these remain in the final product, which increases size and gives attackers more tools and more vulnerabilities to exploit.
A multi-stage build uses several FROM instructions in one Dockerfile. An early stage, often called the builder, contains everything needed to compile or package the application. A later stage starts from a clean, minimal base image and copies in only the final artifacts, such as a compiled binary or a set of installed runtime dependencies. Everything else in the builder stage is discarded and never shipped.
You will see examples for different languages. We build a compiled application and a scripting-language application, copy only the necessary outputs, and compare the image size and scan results before and after. We also show how to name stages, copy between them, and build a specific target for testing.
We discuss secure use. Be careful not to copy secrets between stages, avoid using the builder stage as the final image, and use build secrets for credentials needed during the build, so they are never stored in a layer.
By the end of this lecture you will be able to restructure a Dockerfile into a multi-stage build and measure the benefit.
Every package in an image is something that must be maintained and defended, and this lecture explains how to avoid unnecessary packages and dependencies.
We begin with the principle. Software you do not install cannot be exploited. Each additional package introduces potential vulnerabilities, configuration weaknesses, and utilities that an attacker might use after gaining access, such as network tools, shells, and compilers. Trimming an image to what the application truly needs reduces risk and also speeds up scanning, pulling, and starting.
You will learn practical techniques. Install only required packages, and avoid recommended or suggested extras by using the package manager's options. Remove package caches and temporary files in the same step that creates them so they are not retained. Avoid including debugging tools, editors, and documentation in production images. Pin package versions where appropriate and use lock files for application dependencies so builds are repeatable.
We discuss reviewing application dependencies as well. Examine direct and transitive libraries, remove unused ones, prefer well-maintained packages, and watch for abandoned or suspicious components. Use the software bill of materials to see what is really in the image and compare it against what you intended.
We also cover balancing minimalism with operability, using separate debug images or ephemeral debug containers when troubleshooting is needed, rather than shipping tools in production. By the end of this lecture you will be able to slim down an image deliberately and justify each remaining component.
By default, many containers run their processes as root, and this lecture explains why that is risky and how to run containers as non-root users.
We begin with the risk. Root inside a container is not exactly the same as root on the host, but it is closely related. If the container is misconfigured or a vulnerability allows an escape, a process running as root has far more capability to harm the host. Even without an escape, root in a container can modify files in the container, install tools, and, if volumes or sockets are exposed, affect resources outside it. Running as a non-root user limits what a compromised application can do.
You will learn how to configure it. In a Dockerfile, create a dedicated user and group with a fixed numeric identifier, set file ownership and permissions for the application directories, and switch to that user with the USER instruction before the startup command. We discuss using numeric identifiers, which can be verified by orchestrators, and avoiding the need for privileged ports by using higher port numbers.
We cover common problems, such as applications that need to write to directories, which can be solved with specific writable paths, and images that expect root during startup. We also show how to verify the effective user at runtime and how orchestrators can enforce non-root execution.
By the end of this lecture you will be able to convert an image to run safely as a non-root user.
A Dockerfile is code, and like all code it can contain mistakes. This lecture reviews Dockerfile security best practices and the most common mistakes seen in real projects.
We begin with a checklist of good practices. Use a trusted, minimal base image with a specific version. Use multi-stage builds. Install only needed packages and clean up in the same layer. Create and switch to a non-root user. Copy only the files you need, and use an ignore file to keep sensitive files, version control data, and local configuration out of the build context. Set a health check. Define a clear, minimal startup command. Avoid exposing unnecessary ports.
Next, we examine common mistakes. Using the latest tag makes builds unpredictable. Running update commands without controls can introduce changes. Copying the entire project directory may include secret files. Passing secrets through build arguments or environment instructions stores them in image metadata. Using ADD with remote addresses downloads unverified content. Downloading and running installation scripts directly from the internet without verification is risky. Leaving build tools in the final image increases the attack surface.
You will learn to use linting tools that analyze Dockerfiles and report such issues, and to include them in your workflow. We also discuss reading the output and fixing the issues.
By the end of this lecture you will have a practical checklist you can apply to any Dockerfile.
Images are referenced by names that can change meaning over time, and this lecture explains versioning, digest pinning, and registry hygiene as ways to keep your deployments predictable and trustworthy.
We begin with tags. A tag such as latest or a version number is a movable label. The publisher can push new content under the same tag, so the same reference can produce different images on different days. This can introduce vulnerabilities, break builds, or, in a supply chain attack, deliver malicious content without any change on your side.
A digest is a cryptographic hash of the image content. Referencing an image by digest guarantees that you receive exactly the content that you reviewed. We discuss how to find digests, use them in Dockerfiles and deployment files, and update them deliberately through automated tools that propose changes for review. We also discuss pairing a readable tag with a digest for clarity.
Next, we cover registry hygiene. Use private registries with authentication and access control for your own images. Restrict who can push, enable immutable tags where supported, and scan images when they are pushed. Remove old and unused images, and keep clear naming and tagging conventions that identify the version, the build, and the source commit. Avoid pulling from unknown public namespaces.
By the end of this lecture you will be able to make image references reproducible and manage registries in a way that supports security.
In this hands-on exercise you will rewrite an insecure Dockerfile using the security best practices from this section and measure the improvement.
Begin with the SecureCart API Dockerfile, which uses a full-size base image with the latest tag, runs as root, installs extra tools, copies the whole project directory, and stores a credential in an environment instruction. First, run a lint check and an image scan, and record the image size, the number of packages, and the vulnerability counts as your before measurements.
Now rewrite the Dockerfile. Choose a trusted, minimal base image with a specific version and pin its digest. Convert the build into a multi-stage build, so that only the necessary runtime artifacts are copied into the final stage. Install only required packages and clean caches in the same layer. Add a dedicated non-root user with a numeric identifier, set file ownership, and switch to that user. Use an ignore file to exclude sensitive and unnecessary files from the build context. Remove the embedded credential and read it from a runtime setting instead. Add a health check and expose only the needed port.
Rebuild the image and confirm that the application still works. Run the lint check and the scan again, and compare the results. Check the effective user and inspect the image history to confirm that no secrets remain.
Finally, document the changes and the measured improvements, and commit the new Dockerfile.
This lecture introduces vulnerabilities in container images and explains how the CVE system helps teams talk about them consistently. A vulnerability is a weakness in software that could be abused to harm confidentiality, integrity, or availability, and a CVE identifier is the shared name used to track a specific, publicly known weakness.
You will learn why containers inherit vulnerabilities. An image is a stack of layers containing a base operating system, system libraries, language runtimes, and your own application dependencies. Each of those components can carry known issues, and an image built months ago may contain many findings that did not exist on the day it was created.
We discuss where CVE data comes from, including public vulnerability databases, vendor advisories, and distribution security trackers. You will see that a finding is only a statement that a package version is affected, not proof that your application can actually be attacked.
The lecture also covers how vulnerabilities are fixed, usually through updated packages, newer base images, or dependency upgrades, and why some findings have no fix available yet. You will learn the difference between operating system packages and application dependencies, and why both need attention.
By the end of this lecture you will understand what a CVE is, why images accumulate them over time, and why scanning must be a continuous habit rather than a one-time check, which prepares you for scoring and prioritization in the next lesson.
This lecture explains how to judge which vulnerabilities deserve attention first. Scanners can report hundreds of findings, and without a way to prioritize, teams either panic or ignore the results. Good risk management starts with understanding severity, exploitability, and context.
You will learn the Common Vulnerability Scoring System, or CVSS, and how it rates severity from low to critical using factors such as attack vector, complexity, required privileges, and impact. We also discuss the limits of the score. CVSS describes the general seriousness of a weakness, not how risky it is inside your specific environment.
Next we look at exploitability. Some weaknesses have known active exploitation or public proof-of-concept details, while others are theoretical. You will learn how to use sources such as the Known Exploited Vulnerabilities catalog and exploit probability scores to raise or lower priority.
Context matters just as much. A critical finding in a package that is never loaded, in an image that is not internet facing, may be lower priority than a medium finding in a public API. You will learn to ask whether the vulnerable component is reachable, whether a fix exists, and how sensitive the workload is.
By the end of this lecture you will be able to build a simple, defensible prioritization approach that combines severity, exploitability, exposure, and fix availability so your team spends effort where it reduces the most real risk.
This lecture introduces Trivy, an open source security scanner widely used for containers, and explains why it is a good fit for both learning and production workflows. Trivy can inspect container images, filesystems, Git repositories, and Kubernetes configuration, and it reports vulnerabilities, misconfigurations, secrets, and software inventory from a single tool.
You will learn how Trivy works at a high level. It examines the packages and dependencies found in each image layer, compares them against vulnerability databases that it downloads and caches, and produces a report with package names, installed versions, fixed versions, and severity levels. Understanding this flow helps you interpret results and troubleshoot surprises.
We walk through the main scan targets and the most useful command options, including severity filters, ignoring unfixed findings, and choosing output formats such as table, JSON, and SARIF for use in other tools. You will also learn how the vulnerability database is updated and why offline or air-gapped use requires planning.
The lecture also compares scanning approaches, such as scanning on a developer machine, in a pipeline, in a registry, and continuously in a running cluster, so you can see where Trivy fits among them.
By the end of this lecture you will know what Trivy does, how it produces its results, and which options matter most, so you are ready to scan the SecureCart images in your lab environment.
This lecture focuses on scanning container images for known vulnerabilities and reading the results with confidence. Building on the introduction to Trivy, you will see the full workflow of pointing a scanner at an image and turning the output into useful decisions.
You will learn how to scan a local image, an image stored in a registry, and an image saved as an archive. We discuss how the report is organized, including the target, the package type, the vulnerability identifier, the installed version, the fixed version, and the severity. You will learn to separate operating system findings from language dependency findings, since they are fixed in different ways.
We then cover practical filtering. You will see how to focus on high and critical severities, how to hide findings that have no available fix, and how to export machine readable output for dashboards and tickets. We also discuss how results change when you switch base images, which often removes many findings at once.
The lecture highlights common interpretation mistakes, such as treating the total count as a score, ignoring the fixed version column, or scanning only once. You will learn to record a baseline so improvements can be measured.
By the end of this lecture you will be able to scan an image, interpret each part of the report, and identify the quickest changes that reduce risk, preparing you for the remediation lab later in this section.
This lecture expands scanning beyond known vulnerabilities to two other common problems: misconfigurations and exposed secrets. Many serious incidents come not from unpatched software but from insecure settings and credentials left in places they should never be.
You will learn how configuration scanning checks Dockerfiles, Kubernetes manifests, Docker Compose files, and infrastructure definitions against security rules. Typical findings include containers running as root, missing resource limits, use of the latest tag, privileged mode, and absent health checks. Each finding includes an identifier, a description, and guidance on how to fix it.
Next we cover secret detection. Scanners look for patterns that resemble API keys, tokens, private keys, and passwords in files and image layers. In the lab, you will work only with clearly fake, synthetic values so no real credentials are ever involved. You will learn why a secret deleted in a later layer still remains recoverable in earlier layers.
We also discuss false alarms, since test fixtures and sample values can trigger detections, and how to document accepted cases. Finally, you will learn why any real secret found must be treated as compromised and rotated, not merely removed.
By the end of this lecture you will understand how to detect insecure configuration and leaked credentials, how to interpret those reports, and why preventing them early is far cheaper than responding after exposure.
This lecture explains Software Bills of Materials, or SBOMs, and why they have become a cornerstone of modern software supply chain security. An SBOM is a structured inventory listing the components, libraries, and versions that make up a piece of software, much like an ingredient list on food packaging.
You will learn why this inventory matters. When a new vulnerability is announced in a widely used library, the first question is always whether you are affected. Teams with accurate SBOMs can answer in minutes by searching their inventory, while teams without them may spend days inspecting systems manually.
We introduce the two most common formats, SPDX and CycloneDX, and discuss what information they contain, including package names, versions, licenses, and relationships. You will see how tools such as Syft generate an SBOM from a container image, and how Trivy can read an SBOM and scan it for vulnerabilities without needing the original image.
The lecture also covers practical considerations, such as generating SBOMs at build time, storing them alongside images, keeping them current, and understanding their limits, since an SBOM describes what is present but does not by itself prove it is safe.
By the end of this lecture you will know what an SBOM is, how to generate one for SecureCart, and how it supports faster response and better visibility.
This lecture addresses a challenge every team faces after the first scan: deciding what to do with a long list of findings. Fixing everything immediately is rarely possible, so you need a disciplined approach to false positives, exceptions, and remediation priorities.
You will learn what a false positive is in vulnerability scanning. Examples include findings that apply to a feature not present in your image, packages reported against the wrong distribution version, or vulnerable code that is never reachable. We discuss how to investigate a suspicious finding by checking the advisory, the affected component, and whether the vulnerable function is actually used.
Next we cover exceptions. You will see how to record accepted risks in an ignore file, including the reason, an owner, and an expiration date so that exceptions are reviewed instead of forgotten. Good exception handling keeps pipelines usable without hiding real problems.
We then build a remediation order. Typically you start with fixable critical and high findings on exposed workloads, then update base images, then address application dependencies, and finally track unfixed issues for later review. You will also learn about VEX statements, which communicate whether a product is actually affected.
By the end of this lecture you will be able to triage scan output, justify decisions, and maintain a clean, trustworthy security backlog that your team can act on.
In this hands-on lab you will scan the SecureCart application, review the findings, and remediate the most serious ones. This exercise brings together everything from the section: CVEs, severity scores, Trivy scanning, configuration checks, SBOMs, and triage.
The suggested steps are as follows. First, scan the insecure SecureCart image and save the report as your baseline, noting the number of critical and high findings along with misconfigurations and any synthetic secrets. Second, review the report and sort findings into those with available fixes and those without. Third, apply fixes such as moving to a smaller, current base image, upgrading vulnerable dependencies, and rebuilding the image.
Next, rescan the rebuilt image and compare the results with your baseline to confirm that the critical findings have been resolved. You will also generate an SBOM for the new image and record any findings you intentionally accept in an ignore file with a reason and a review date.
Throughout the lab, you work only in your isolated local environment, using the provided sample application and fake values. Do not scan systems you do not own or have permission to test.
By the end of this lab you will have practiced a complete scan, prioritize, fix, and verify cycle, produced before and after evidence of improvement, and gained confidence that you can apply the same process to your own container images.
This lecture explains the two Linux kernel features that make containers possible: namespaces and control groups. Understanding them removes much of the mystery around containers and clarifies exactly what protection they do and do not provide.
Namespaces control what a process can see. Linux offers separate namespaces for process IDs, network interfaces, mount points, hostnames, inter-process communication, users, and more. When a container starts, its processes are placed in their own set of namespaces, so they see their own process tree, their own network stack, and their own filesystem view rather than the host's.
Control groups, or cgroups, control what a process can use. They let the kernel limit and account for resources such as CPU time, memory, process counts, and input and output. Without limits, one misbehaving container could starve its neighbors or exhaust the host.
You will learn how to inspect these features on a lab host, for example by listing a container's namespaces and viewing its cgroup settings. We also discuss an essential point: all containers on a host share one kernel, so isolation is only as strong as that kernel and its configuration.
By the end of this lecture you will be able to explain how namespaces and cgroups work together, describe what each one protects, and recognize why additional hardening is needed on top of them.
This lecture shows how Docker combines kernel features into the isolation that containers rely on, and where that isolation has limits. You will see what actually happens between running a command and having a protected process on the host.
We start with the Docker architecture, including the client, the daemon, containerd, and the runtime that creates the container. You will learn how Docker assigns namespaces, applies cgroup limits, mounts an image as a layered filesystem, and then applies default security profiles and a reduced set of capabilities.
Next, we compare isolation strength. A container is lighter than a virtual machine but shares the host kernel, so a kernel weakness or an unsafe configuration can weaken the boundary. Settings such as privileged mode, host networking, host process visibility, and sensitive host mounts remove protections that Docker applies by default.
You will learn a practical way to review a running container for isolation problems, using inspection commands to see its user, mounts, network mode, and security options. We also discuss when stronger isolation, such as sandboxed runtimes or separate hosts, is worth considering for sensitive workloads.
By the end of this lecture you will understand the default protections Docker provides, the common settings that undermine them, and how to verify a container's isolation in your own lab.
This lecture covers Linux capabilities and explains why privileged containers are so risky. Historically, a process was either root with unlimited power or an ordinary user. Capabilities split root's powers into small, separate units so a process can receive only what it needs.
You will learn examples of capabilities, such as binding to low network ports, changing file ownership, administering networking, and loading kernel modules. Docker starts containers with a limited default set and lets you drop and add capabilities explicitly. The strongest pattern is to drop everything and add back only the one or two that the application truly requires.
We then examine privileged containers. Running with the privileged flag grants nearly all capabilities, access to host devices, and relaxes the default security profiles. In effect it removes most of the boundary between the container and the host. You will see why this setting is sometimes used for convenience and why it should be treated as an exception requiring review.
You will practice inspecting a container's effective capabilities in your lab, comparing a default container with one that has dropped capabilities, and observing how the application behaves with fewer privileges.
By the end of this lecture you will be able to apply least privilege to container capabilities, recognize dangerous privileged configurations, and justify any exception you must keep.
This lecture introduces three kernel security mechanisms that restrict what a container process can do even after it is running: seccomp, AppArmor, and SELinux. Together they provide an extra layer that limits the damage if an application is compromised.
Seccomp filters system calls. Every request an application makes to the kernel is a system call, and many are rarely needed. Docker applies a default seccomp profile that blocks a number of risky calls while keeping most applications working. You will learn how profiles are structured conceptually, how to run a container with a custom profile, and why running without one, known as unconfined, removes this protection.
AppArmor and SELinux are mandatory access control systems. They define which files, capabilities, and resources a process may touch, regardless of its user. AppArmor uses path-based profiles and is common on Ubuntu, while SELinux uses labels and is common on Red Hat based systems. We compare their approaches and tradeoffs.
You will see how to check which profiles a container is using and how to read denial messages when a profile blocks an action. We discuss the best practice of testing profiles in a complaining or audit mode before enforcing them.
By the end of this lecture you will understand what each mechanism restricts, know how to verify they are active, and appreciate why they should stay enabled.
This lecture covers two ways to reduce the damage if a container process is compromised: rootless Docker and user namespace remapping. Both address a long-standing weakness in which root inside a container may correspond to root on the host.
You will learn how user namespace remapping works. The daemon maps user IDs inside the container to a range of unprivileged IDs on the host, so a process that appears to be root in the container is actually an ordinary, powerless user outside. We discuss how to enable the feature, how it affects volumes and file ownership, and which compatibility limits to expect.
Next we cover rootless Docker, in which the daemon itself and the containers run entirely as a non-root user. This shrinks the impact of a daemon compromise, because the attacker gains only that user's permissions rather than full host control. You will learn the setup requirements, the networking and storage differences, and the features that may be restricted, such as binding to low ports.
We compare both approaches with simply running the application as a non-root user inside the image, which remains the first and easiest step.
By the end of this lecture you will understand how each method works, what it protects against, and how to choose the right option for a given environment, using your lab to observe how user IDs differ between container and host.
This lecture explains why the Docker daemon and its socket are among the most sensitive assets on a host and how to protect them. The daemon runs with high privileges, and anyone who can talk to it can effectively control every container and often the host itself.
You will learn what the Docker socket is, a local file that the Docker client uses to send commands to the daemon. Access to it is equivalent to administrative access. That is why mounting the socket into a container, a common shortcut for build tools and monitoring agents, is such a dangerous practice. A compromised container with that mount can create new privileged containers.
We discuss safer patterns, including limiting membership of the docker group, avoiding socket mounts, using rootless mode, and choosing build tools that do not need the daemon. When remote access is required, you will learn why the daemon should use mutually authenticated TLS and never be exposed on an open network port without authentication.
The lecture also covers daemon configuration good practices, such as enabling logging, restricting inter-container traffic where appropriate, and keeping Docker updated. You will check your lab's daemon settings and file permissions.
By the end of this lecture you will understand the trust placed in the daemon, recognize risky socket usage, and apply simple controls that significantly reduce exposure.
This lecture shows how read-only filesystems, careful volume mounts, and resource limits reduce what a compromised or faulty container can do. These are simple runtime settings, yet they strongly limit the impact of many problems.
You will learn how to run a container with a read-only root filesystem so the application cannot write to its own image. If a process is abused, it cannot easily drop files, change binaries, or persist changes. Because many applications need some writable space, we show how to provide narrow temporary filesystems or specific writable volumes for paths such as caches and logs.
Next we cover volume and bind mounts. You will learn why mounting sensitive host directories, such as system paths or configuration folders, breaks isolation, and why read-only mounts and named volumes are safer. We discuss how to review each mount and ask whether the container truly needs it.
We then turn to resource limits for memory, CPU, process counts, and restart policies. Limits protect the host from runaway or abused containers and help contain denial of service conditions. You will learn how to choose sensible values by observing normal behavior.
By the end of this lecture you will be able to configure read-only roots, minimize mounts, and apply resource limits, then test in your lab that the application still functions while having fewer opportunities to cause harm.
This lecture covers securing Docker networking and the communication between containers. By default, containers on the same network can often reach each other freely, which means one compromised container may be able to probe many others.
You will learn how Docker creates networks and what the common network drivers do, including the default bridge, user-defined bridges, host networking, and none. We explain why user-defined networks are preferred, since they provide name-based discovery and cleaner separation, and why host networking removes an important layer of isolation.
Next we discuss segmentation. You will see how to place the web tier, application tier, and database on separate networks so that only the necessary paths exist, and how to mark internal networks that have no outside connectivity. We also cover publishing ports carefully by binding to specific interfaces instead of exposing every service to all addresses.
The lecture explains the role of host firewall rules, how Docker interacts with them, and why an unexpected published port can bypass assumptions. You will also learn why traffic between services should be encrypted when it crosses untrusted networks.
By the end of this lecture you will be able to design a simple segmented network for SecureCart, limit exposed ports, and verify in your lab which containers can and cannot communicate with each other.
In this hands-on lab you will apply a Docker container hardening checklist to the SecureCart application. The exercise combines the controls from this section into a repeatable review that you can reuse on your own projects.
The suggested steps are as follows. First, inspect the insecure SecureCart containers and record their settings, including user, privileges, capabilities, mounts, network mode, and resource limits. Second, use the checklist to mark each weakness, such as running as root, privileged mode, a mounted Docker socket, writable root filesystem, and unrestricted networking.
Next, update the Compose configuration or run commands to fix each item. Run as a non-root user, drop all capabilities and add back only what is needed, keep the default seccomp profile, enable a read-only filesystem with narrow writable areas, remove unnecessary mounts, set memory and process limits, and place services on separate networks.
Then restart the application and confirm it still works. Compare the new inspection output against your baseline and tick off each checklist line as evidence. If something breaks, you will practice reading logs and adjusting one setting at a time.
All work occurs in your isolated lab with the provided sample application. Do not apply experiments to systems you do not own.
By the end of this lab you will have a hardened Docker deployment, a completed checklist, and a practical method for validating container isolation.
This lecture introduces how secrets end up exposed in containerized environments and why this is one of the most common and costly mistakes. A secret is any value that grants access, such as a password, API key, token, certificate private key, or database connection string.
You will learn the typical places where secrets leak. They include source code repositories, Dockerfiles, build arguments, environment variables, image layers, configuration files, logs, error messages, and shared CI/CD output. Because container images are copied, cached, and stored in registries, a secret that enters an image can spread widely and remain available long after you believed it was removed.
We discuss how exposure is discovered, including scanners, public repository monitoring, and routine inspection of image history and metadata. You will learn that anyone who can pull an image can usually examine every layer, so a private registry reduces risk but does not make embedded secrets safe.
The lecture also covers the lifecycle view of secrets: create, distribute, use, rotate, and revoke. A secret that cannot be rotated quickly is a long-term liability.
All examples in this course use clearly fake, synthetic values so no real credentials are ever involved.
By the end of this lecture you will recognize common exposure paths, understand the impact of leaked credentials, and be prepared to apply safer handling patterns in the lectures that follow.
This lecture explains why credentials should never be embedded in container images and demonstrates why the habit is so hard to undo. Embedding a secret feels convenient, since the application simply works wherever the image runs, but it permanently ties the secret to the image.
You will learn how image layers work. Every instruction in a Dockerfile can create a new layer, and layers are stored independently. If a file containing a fake token is copied in one step and deleted in a later step, the final filesystem looks clean, yet the earlier layer still contains the file and can be extracted. The same is true for values passed as build arguments, which can appear in image history.
We then cover safer approaches. Build-time secrets can be supplied through BuildKit secret mounts that are never written into layers. Runtime secrets can be injected when the container starts. Multi-stage builds help keep temporary material out of the final image.
You will use your lab to inspect an image with a synthetic credential, view how it can be recovered from history, and then rebuild without it. We also discuss rotating any real credential that was ever exposed.
By the end of this lecture you will be able to explain the risk and build images that contain no secrets.
This lecture compares the common ways of delivering secrets to a running container, namely environment variables and mounted secret files, and explains the tradeoffs of each. Neither is perfect, so understanding the differences helps you choose deliberately.
Environment variables are simple and widely supported. However, they can appear in process listings, inspection output, crash dumps, debug logs, and child processes, and they are easy to expose by accident when an application prints its configuration. They are also fixed for the lifetime of the container, which makes rotation require a restart.
Mounted secret files offer better control. They can be given restrictive permissions, kept in memory-backed filesystems, mounted read-only, and updated without rebuilding the image. Applications read them at the time of use, which limits how long a value lives in memory and in logs. Docker Compose and orchestration platforms both support this pattern.
We also introduce dedicated secret managers, which provide central storage, access policies, auditing, and short-lived credentials, and discuss when they are worth adopting.
In your lab, you will pass a fake password both ways, then inspect the container to see where each value is visible.
By the end of this lecture you will be able to choose an appropriate delivery method, apply file permissions correctly, and avoid the most common leakage paths.
This lecture covers how to handle two important categories of credentials: those used to access container registries and those used by the application itself. Both are valuable targets, and both are frequently mishandled.
For registry credentials, you will learn why personal passwords should never be used in automation, and why scoped access tokens or short-lived credentials are preferred. We discuss giving each pipeline or system only the permissions it needs, such as pull-only access for deployment and push access limited to specific repositories. You will also see where Docker stores login information locally, and how credential helpers keep it out of plain text.
For application credentials, such as database passwords and third-party API keys, we cover creating separate credentials per environment and per service, keeping development and production values distinct, and granting only the minimum database permissions. You will learn practical rotation habits, including overlapping validity periods so rotation does not cause downtime.
The lecture also addresses detecting misuse. Logging and alerting on unusual registry pulls or failed authentications can reveal compromised credentials early, and a documented revocation procedure shortens response time.
By the end of this lecture you will be able to apply least privilege to registry and application credentials, store them more safely, rotate them with confidence, and respond quickly when one is suspected to be exposed.
This lecture introduces container software supply chain security, which concerns the trustworthiness of everything that goes into your running application: base images, packages, dependencies, build tools, pipelines, and registries. A weakness at any step can reach production even if your own code is perfectly written.
You will learn the main supply chain risks. They include malicious or compromised packages, look-alike package names, tampered images, outdated and abandoned dependencies, compromised build systems, and untrusted registries. We discuss why attacks on the supply chain are attractive, since a single compromise can affect many downstream users.
Next we cover foundational defenses. You will see why pulling from trusted sources, pinning versions and digests, using minimal base images, and reviewing dependency changes all reduce exposure. We introduce frameworks such as SLSA, which describes levels of build integrity, and discuss the idea that you should be able to answer what is in an image, who built it, and from which source.
The lecture also explains the difference between integrity and authenticity. Integrity confirms that an artifact has not changed, while authenticity confirms who produced it. Both are needed.
By the end of this lecture you will understand the main supply chain threats, know the layered controls that address them, and see how signing, SBOMs, and provenance fit together in the lectures ahead.
This lecture introduces image signing and verification using Cosign, a tool from the Sigstore project that makes it practical to prove who produced a container image and that it has not been altered. Signing gives deployment systems something stronger than a tag to trust.
You will learn how digital signatures work conceptually. A publisher signs an image digest with a private key, and anyone with the matching public key can verify the signature. Because the signature covers the digest rather than a mutable tag, any change to the image invalidates it. We discuss storing signatures alongside the image in the registry.
We cover two approaches. The first uses a locally generated key pair, which is simple and ideal for a lab, but requires careful protection of the private key. The second is keyless signing, which relies on short-lived certificates tied to an identity and a public transparency log, reducing key management burden.
You will see the basic workflow of generating keys, signing an image, and verifying it, and what a failed verification looks like when an image has been modified. We also discuss how admission policies in Kubernetes can later require valid signatures before running a workload.
By the end of this lecture you will understand why signing matters, how Cosign works, and how to integrate verification into your delivery process.
This lecture connects three related ideas that together strengthen trust in your artifacts: SBOMs, build provenance, and artifact integrity. Each answers a different question about an image, and combined they give a much fuller picture than a vulnerability scan alone.
An SBOM answers what is inside the image. Provenance answers how, where, and from what source the image was built, including the builder, the repository, the commit, and the build steps. Integrity answers whether the artifact you are about to run is exactly the one that was built and has not been modified since.
You will learn how provenance attestations are created, typically by the build system, and how they are stored and signed so that consumers can verify them. We discuss attaching SBOMs and provenance to an image as signed attestations using Cosign, so the information travels with the artifact and cannot be quietly replaced.
The lecture also covers how to use this evidence. Deployment checks can require that an image was built by your trusted pipeline from an approved repository, and security teams can search stored SBOMs when a new vulnerability is announced.
You will also learn the limits of these controls: they prove origin and contents, but do not prove the code is free of defects.
By the end of this lecture you will be able to explain each concept, generate and attach the evidence in your lab, and use it to make better release decisions.
In this hands-on lab you will remove embedded secrets from a SecureCart image and then sign and verify the resulting artifact. The exercise combines secrets management and supply chain controls into one end-to-end workflow.
The suggested steps are as follows. First, scan the insecure SecureCart image and its Dockerfile for exposed secrets, noting that all credentials in the lab are synthetic. Inspect the image history to see how a value can be recovered from earlier layers. Second, rewrite the Dockerfile so that no credentials are copied or passed as build arguments, and update the Compose configuration to deliver the fake password through a read-only mounted secret file with restrictive permissions.
Next, rebuild the image, rescan to confirm that no secrets are detected, and run the application to confirm it still reads its configuration correctly. Then generate a Cosign key pair for the lab, sign the new image digest, and verify the signature. Finally, make a harmless change to a copy of the image and observe that verification fails.
You may also generate an SBOM and attach it as an attestation. All work stays inside your isolated local environment.
By the end of this lab you will have an image free of embedded secrets, a verified signature, and a practical workflow for protecting both credentials and artifact integrity.
This lecture introduces Kubernetes security architecture and gives you a mental map of where protection is needed. Kubernetes is a powerful platform that schedules containers across many machines, and its flexibility means security depends heavily on how it is configured.
You will learn the main components at a high level. The control plane includes the API server, etcd, the scheduler, and the controller manager, while worker nodes run the kubelet, a container runtime, and your pods. Each component communicates over the network and holds sensitive data or authority, so each one is part of the attack surface.
We introduce the layered model often called the four Cs of cloud native security: cloud or infrastructure, cluster, container, and code. A weakness in an outer layer can undermine inner layers, so protections must exist at every level.
You will also see the shared responsibility idea. In managed Kubernetes services, the provider secures much of the control plane, but you remain responsible for workload settings, access control, network policy, and secrets.
The lecture previews the controls covered later, including authentication, RBAC, pod security, network policies, secrets handling, and runtime monitoring.
By the end of this lecture you will understand how a cluster is organized, which parts are most sensitive, and how the rest of the section will secure each of them step by step.
This lecture focuses on the security of the Kubernetes control plane and worker nodes, the machines and services that form the foundation of every cluster. If these are weak, no workload-level setting can fully compensate.
For the control plane, you will learn why the API server is the central gateway and why etcd is especially sensitive, since it stores the entire cluster state including secrets. We discuss restricting network access to control plane endpoints, requiring authenticated and encrypted communication between components, enabling encryption of secret data at rest, and protecting backups.
For worker nodes, we examine the kubelet, which manages pods on each node and exposes its own API. You will learn why anonymous access to the kubelet should be disabled, why authorization should be enforced, and why nodes should be kept patched and minimal. We also cover node isolation, limiting direct administrative access, and using hardened operating system images.
The lecture explains how a compromised node can expose the credentials and data of every pod running on it, so separating sensitive workloads and limiting node permissions matters.
In managed services, many of these settings are provider controlled, and you will learn which ones remain your responsibility.
By the end of this lecture you will understand the key hardening areas for cluster infrastructure and know which settings to review in your own environment.
This lecture explains the Kubernetes API server and how authentication works. Every action in a cluster, whether from a person, a tool, or a running pod, passes through the API server, so controlling who can reach it and how they prove their identity is fundamental.
You will learn the request flow: authentication establishes who is making the request, authorization decides what they may do, and admission control can validate or modify the request before it is stored. This lecture concentrates on the first stage while connecting to the others.
We cover the common authentication methods, including client certificates, bearer tokens, service account tokens, and external identity providers through OpenID Connect. You will see why long-lived static tokens and shared administrator credentials are risky, and why integrating with a central identity system, with multi-factor authentication, is preferred for people.
We also discuss anonymous requests, why they should be disabled or tightly constrained, and how to protect the API endpoint by limiting its network exposure. Audit logging, which records who did what, is introduced as a key detection tool.
In your lab, you will inspect the kubeconfig file, identify which credentials it contains, and view how your own requests are authenticated.
By the end of this lecture you will understand how identities reach the API server and which practices keep authentication strong.
This lecture covers Kubernetes namespaces and explains what they do and do not provide as a security boundary. Namespaces divide a cluster into logical groups, making it easier to organize teams, applications, and environments.
You will learn that a namespace is primarily a scope for names and for policy. Resources such as pods, services, and secrets live inside a namespace, and many controls, including RBAC roles, resource quotas, and network policies, can be applied per namespace. This makes them a practical foundation for separating development from production or one team from another.
However, namespaces are not a strong isolation boundary by themselves. By default, pods in different namespaces can communicate over the network, and workloads share the same nodes and kernel. Without additional controls, a compromised pod in one namespace may reach others.
We discuss how to strengthen boundaries by combining namespaces with network policies, restricted RBAC, resource quotas and limits, and pod security enforcement. For highly sensitive or untrusted workloads, separate clusters or dedicated nodes may be appropriate.
You will create namespaces for the SecureCart application in your lab, label them, and observe how policies attach to them.
By the end of this lecture you will be able to design a sensible namespace layout, explain its limits, and layer controls to make those boundaries meaningful.
This lecture explains three core Kubernetes building blocks, pods, deployments, and service accounts, from a security perspective. Understanding how they work helps you see where risky settings are introduced.
A pod is the smallest deployable unit and contains one or more containers sharing networking and storage. Settings in a pod specification, such as the user, privileges, mounts, and host access, determine how isolated it is. A deployment manages a set of identical pods, handling updates and replacement, and it is the usual place where security settings are defined for an application.
A service account is the identity that a pod uses when talking to the Kubernetes API. By default, pods may receive a token for a default service account automatically mounted into the container. If that account has excessive permissions, a compromised application could use the token to read or change cluster resources.
You will learn how to create dedicated service accounts per application, disable automatic token mounting when the API is not needed, and use short-lived projected tokens. We also review how to read a deployment manifest and spot risky fields.
In your lab, you will inspect the service account and token mounted in a running pod.
By the end of this lecture you will understand how these objects relate, where their security settings live, and how to avoid common default-related risks.
This lecture surveys common Kubernetes security threats and the misconfigurations that make them possible. Most real-world cluster incidents come from configuration mistakes rather than sophisticated attacks, so knowing the usual patterns is highly valuable.
You will learn the typical problems. They include exposed dashboards or API endpoints, anonymous access, overly broad RBAC such as cluster administrator rights granted to applications, privileged pods, host paths and host networking, containers running as root, missing network policies, secrets stored in plain manifests, unpatched components, and lack of audit logging.
For each, we explain the underlying risk conceptually, the effect it can have on the cluster, and the defensive control that addresses it. We discuss the idea of a blast radius, the extent of damage when one workload is compromised, and how good configuration keeps it small.
You will also see how misconfigurations are detected, using configuration scanners and cluster assessment tools, and how reviewing manifests before deployment prevents problems earlier at lower cost.
The lecture links each threat to later lectures so you can see how the course addresses it systematically. No exploitation is demonstrated; the focus remains on recognizing weaknesses and fixing them in your isolated lab.
By the end of this lecture you will be able to recognize the most frequent Kubernetes misconfigurations and explain how to prevent or detect each one.
This lecture introduces security benchmarks and checklists for Kubernetes, which give you a structured, widely accepted way to measure and improve your cluster's security posture rather than relying on guesswork.
You will learn about the CIS Kubernetes Benchmark, a detailed set of recommended settings for the control plane, nodes, policies, and workloads. We also discuss the Kubernetes Pod Security Standards, the NSA and CISA hardening guidance, and the OWASP Kubernetes security cheat sheet and top risks list. Each source has a slightly different focus, and together they provide a reliable baseline.
Next we cover tools that automate assessment. Scanners can compare a cluster or its manifests to benchmark recommendations and produce a report of passing and failing checks. You will learn how to read these reports, understand severity, and avoid chasing every item blindly. Some recommendations do not apply to managed services, and some require tradeoffs with usability.
The lecture explains how to turn results into an actionable plan, with owners and deadlines, and how to repeat assessments regularly so improvement is measured over time.
By the end of this lecture you will know the key benchmarks and checklists, understand how to run and interpret an assessment, and be able to use them as a continuing guide to harden your Kubernetes environment.
In this hands-on lab you will deploy the SecureCart application to a local Kubernetes cluster and inspect it from a security point of view. This creates the baseline that you will harden throughout the rest of the Kubernetes sections.
The suggested steps are as follows. First, create a local cluster using kind and confirm that kubectl can communicate with it. Second, create a namespace for SecureCart and apply the provided insecure manifests, which define a deployment, a service, and a configuration for the application and its database using only synthetic data.
Next, verify that the pods are running and the application responds. Then review the deployment as a security reviewer would. Check which user the containers run as, whether privileged mode or host settings are used, which service account is attached, whether a token is mounted, what resource limits exist, and how secrets are stored. Record your findings in a simple table.
You will also run a basic configuration scan against the manifests and compare its output with your manual notes. This gives you a reference list of weaknesses to fix in later labs.
All activity takes place in your own local cluster. Never perform these exercises on shared or production clusters without permission.
By the end of this lab you will have a working cluster, a deployed application, and a documented security baseline ready for hardening.
This lecture introduces Kubernetes security contexts, the settings that control the privileges and access of pods and containers. A security context is where you tell Kubernetes how much power a workload should have, and it is one of the most important tools for hardening applications.
You will learn that security contexts can be set at two levels. Pod-level settings apply to all containers in the pod and include the user and group IDs, file group ownership for volumes, and the default seccomp profile. Container-level settings apply to a single container and include privilege escalation, capabilities, read-only root filesystem, and the user it runs as. Container settings override pod settings where they overlap.
We walk through the most important fields and the secure value for each. Examples include requiring the container to run as non-root, disallowing privilege escalation, dropping all capabilities, using the runtime default seccomp profile, and making the root filesystem read-only.
You will also learn how to read a manifest and identify missing or weak security context fields, and how these settings relate to the Docker controls from earlier sections.
By the end of this lecture you will be able to explain each security context field, recognize unsafe defaults, and write a secure baseline that you can reuse across your workloads.
This lecture shows how to configure Kubernetes workloads to run as non-root users and with restricted privileges. Running as root inside a container increases the impact of any application weakness, so this is one of the highest value changes you can make.
You will learn the relevant settings, including the option that requires the container to run as a non-root user, specifying an explicit user and group ID, and disabling privilege escalation so processes cannot gain more rights than their parent. We also discuss why numeric IDs are preferred in manifests and how image configuration and Kubernetes settings interact.
Many applications fail when first run as non-root, usually because of file permissions or attempts to bind to low ports or write to protected directories. You will learn how to diagnose these errors from pod logs, adjust file ownership in the image, move to higher port numbers, and provide writable volumes for temporary data.
The lecture also covers how volume ownership is handled using the file system group setting, and how to avoid privileged containers and host namespace sharing unless there is a documented need.
In your lab, you will update the SecureCart deployment to run as non-root, redeploy it, and confirm the effective user from inside the container.
By the end of this lecture you will be able to remove root privileges from typical workloads and resolve the common problems that appear.
This lecture covers three further workload restrictions: Linux capabilities, seccomp profiles, and filesystem controls. Together they reduce what a container can do at the kernel level even if the application inside is flawed.
For capabilities, you will learn the recommended pattern of dropping all and adding back only those that are truly required, for example the ability to bind to a low port in rare cases. We review which capabilities are risky and why they should seldom be granted.
For seccomp, you will see how Kubernetes can apply the runtime default profile, which blocks many unneeded system calls with little compatibility cost, and how custom profiles can be provided for stricter control. We also explain why leaving a workload unconfined removes this protection.
For filesystems, we cover read-only root filesystems, temporary writable volumes for specific paths, and avoiding host path mounts that expose the node. You will learn how to find which directories an application needs to write by reviewing errors and testing.
You will apply these settings to the SecureCart pods and confirm they still start and operate normally. We also discuss how to introduce restrictions gradually, testing in a development namespace first.
By the end of this lecture you will be able to apply capability, seccomp, and filesystem restrictions consistently and troubleshoot the issues they can uncover.
This lecture explains the Kubernetes Pod Security Standards, three predefined policy levels that describe how restricted a pod should be: Privileged, Baseline, and Restricted. They give teams a shared vocabulary and a clear target for workload security.
The Privileged level is unrestricted and intended only for trusted system components that truly need broad access. The Baseline level blocks known dangerous settings, such as privileged containers, host namespaces, and certain host paths, while remaining easy to adopt. The Restricted level follows current hardening best practice, requiring non-root execution, dropped capabilities, no privilege escalation, and a safe seccomp profile.
You will learn what each level allows and forbids and how to evaluate an existing workload against them. We discuss a practical adoption path: start by auditing and warning, fix the findings, and only then enforce. Different namespaces can use different levels depending on their purpose.
You will also see how the standards relate to the older, deprecated pod security policies and why the newer approach is simpler to manage.
In your lab, you will examine the SecureCart pods against the Baseline and Restricted levels and list which fields must change to comply.
By the end of this lecture you will be able to describe the three levels, choose an appropriate target for each namespace, and plan a safe migration.
This lecture shows how to enforce pod security using Kubernetes admission controls. Writing secure manifests is helpful, but enforcement ensures that insecure ones cannot be deployed at all, whether by mistake or by someone bypassing review.
You will learn what admission control is. After a request is authenticated and authorized, admission controllers can validate or change it before the object is stored. This is the point where cluster-wide rules can be applied consistently.
We focus on the built-in Pod Security Admission controller, which enforces the Pod Security Standards through namespace labels. You will learn the three modes, enforce, audit, and warn, and how to combine them, for example enforcing Baseline while warning about Restricted violations. We also cover exemptions and why they should be kept minimal and documented.
You will see what happens when a non-compliant pod is submitted, how to read the rejection message, and how to correct the manifest. We also introduce validating and mutating admission webhooks as a way to implement custom rules, which sets up the next lectures on policy as code.
In your lab, you will label a SecureCart namespace for enforcement, try deploying the current manifests, and fix them until they are accepted.
By the end of this lecture you will be able to apply admission-based enforcement safely and interpret its feedback.
This lecture explains Kubernetes resource requests, limits, and related controls and how they protect workloads and the cluster as a whole. Resource management is often seen as a performance topic, but it also has a clear security and availability role.
You will learn the difference between requests, which influence scheduling and guarantee a minimum, and limits, which cap consumption. Without limits, a faulty or abused container can consume all memory or CPU on a node, causing other workloads to slow down or be terminated. This is a form of denial of service that can be caused by bugs as easily as by misuse.
We discuss how to choose reasonable values by observing normal usage, and how quality-of-service classes affect which pods are evicted first. You will also see namespace-level protections, including resource quotas that cap totals and limit ranges that set defaults and boundaries for each pod.
The lecture also covers limiting the number of processes per pod, setting ephemeral storage limits, and using pod disruption settings to keep applications available. These controls work together with the earlier hardening measures.
In your lab, you will add requests and limits to the SecureCart deployments, apply a quota to the namespace, and observe what happens when a container exceeds its memory limit.
By the end of this lecture you will be able to apply sensible resource controls that improve both stability and security.
This lecture introduces policy as code using Kyverno, a Kubernetes-native policy engine. Policy as code means expressing security rules as version-controlled resources that the cluster enforces automatically, instead of relying on documents and manual review.
You will learn how Kyverno works. It runs as an admission controller and evaluates incoming resources against policies that you define in familiar YAML, without needing to learn a separate programming language. Policies can validate resources and reject those that violate rules, mutate resources to add safe defaults, and generate supporting objects such as default network policies.
We review typical policies for container security, such as requiring non-root users, disallowing privileged containers, requiring resource limits, blocking the latest tag, restricting image registries, and requiring specific labels. You will learn the difference between audit mode, which reports violations, and enforce mode, which blocks them, and why starting with audit reduces disruption.
We also cover installing Kyverno in your lab cluster, reading policy reports, and writing exceptions for justified cases.
You will install Kyverno and apply a first policy to see how a violating deployment is handled.
By the end of this lecture you will understand the value of policy as code, be able to read and write simple Kyverno policies, and be ready to test them systematically.
This lecture covers how to test and validate Kubernetes security policies so they work as intended and do not break legitimate workloads. A policy that has never been tested may either fail to block risky resources or unexpectedly block important ones.
You will learn a structured approach. First, prepare test cases that include both compliant and non-compliant manifests for each policy. Second, run those cases against the policy in a non-production namespace and confirm that the right ones pass and the right ones are rejected. Third, review messages to ensure they clearly tell developers how to fix the issue.
We discuss useful tooling, including the Kyverno command line interface, which can evaluate policies against manifests without a cluster, making it suitable for pipelines and pull requests. You will also learn to check policy reports for existing resources and use audit mode to find violations before enforcement begins.
The lecture also addresses rollout practices, such as announcing changes, enforcing gradually by namespace, handling exceptions through a documented process, and monitoring after the change. We discuss keeping tests in version control so that policy changes are reviewed like application code.
In your lab, you will write test cases for your policies and run them repeatedly.
By the end of this lecture you will be able to verify policy behavior confidently and roll out enforcement with minimal disruption.
In this hands-on lab you will harden the SecureCart Kubernetes deployments using the controls from this section. You start from the insecure baseline you deployed earlier and finish with a workload that complies with strict, enforced policies.
The suggested steps are as follows. First, review the baseline manifests and list the weaknesses, including root execution, privilege escalation, extra capabilities, missing seccomp profile, writable filesystem, absent resource limits, and a lack of namespace enforcement. Second, update each deployment with a complete security context that runs as non-root, drops all capabilities, disables privilege escalation, applies the runtime default seccomp profile, and uses a read-only root filesystem with small writable volumes where required.
Next, add resource requests and limits and a namespace quota. Label the namespace so the Restricted Pod Security Standard is enforced, then redeploy and fix any rejections. Install Kyverno and apply policies that require non-root users, limits, and pinned image tags, and test them using both compliant and non-compliant examples.
Finally, confirm that the application still functions and record your before and after results in a short report.
All steps occur in your isolated local cluster with the provided sample application.
By the end of this lab you will have a hardened, policy-enforced deployment and a repeatable process for securing Kubernetes workloads.
This lecture introduces Kubernetes Role-Based Access Control, or RBAC, the mechanism that decides what each user, group, and service account is allowed to do inside the cluster. Strong authentication is only half the story, and authorization determines how much harm a compromised identity can cause.
You will learn the core model. Subjects, meaning users, groups, and service accounts, are granted permissions through roles. A permission is a combination of verbs such as get, list, create, update, and delete, applied to resources such as pods, secrets, and deployments. RBAC is additive and deny by default, so access exists only where a rule explicitly grants it.
We discuss why RBAC misconfiguration is among the most common serious cluster weaknesses. Examples include granting cluster administrator rights for convenience, using wildcards for verbs or resources, and allowing broad access to secrets, which often unlocks other systems. Some permissions, such as creating pods or binding roles, can indirectly lead to privilege escalation and deserve special care.
You will learn how to check what an identity can do using the authorization query command, and how to review existing bindings in your lab cluster.
By the end of this lecture you will understand the RBAC model, recognize risky grants, and be ready to design least privilege access in the lectures that follow.
This lecture shows how to create Roles, ClusterRoles, and RoleBindings and how to choose among them. Knowing which object to use keeps permissions as narrow as possible.
A Role grants permissions within one namespace, while a ClusterRole defines permissions that can apply cluster-wide or to resources that are not namespaced, such as nodes. A RoleBinding attaches a role to subjects within a namespace, and a ClusterRoleBinding does so across the entire cluster. A useful pattern is to define a ClusterRole once and bind it to specific namespaces with RoleBindings, giving reuse without cluster-wide reach.
You will learn how to write these objects in YAML, specifying explicit API groups, resources, resource names, and verbs. We emphasize avoiding wildcards, granting read-only access whenever possible, and limiting access to sensitive resources, such as secrets. You will also see aggregated roles and the built-in roles such as view, edit, and admin, and why even those should be bound carefully.
The lecture covers testing a role by impersonating the subject and checking allowed and denied actions, as well as naming and documenting roles so reviews are easier.
In your lab, you will create a read-only role for a developer and a more limited role for a deployment tool, then verify each one.
By the end of this lecture you will be able to author and test precise RBAC rules.
This lecture applies least privilege specifically to Kubernetes service accounts, the identities that pods use to talk to the API. Because applications are exposed to untrusted input, their identity should have as little power as possible.
You will learn why the default behavior deserves attention. Every namespace has a default service account, and pods use it unless told otherwise. If that account is granted permissions, every pod in the namespace inherits them. The safer practice is to create a dedicated service account for each application, grant only the specific permissions it needs, and in most cases grant none at all.
We cover disabling automatic token mounting for pods that never call the API, using the relevant setting on either the service account or the pod. You will learn about modern bound, time-limited tokens that are tied to a pod and expire, compared with older long-lived token secrets that should be avoided.
We also discuss auditing existing permissions, such as finding service accounts bound to powerful roles and removing unneeded bindings. For workloads that need cloud access, we mention workload identity approaches that avoid storing static cloud credentials.
In your lab, you will give SecureCart its own service account, remove token mounting, and verify that the pod cannot list cluster resources.
By the end of this lecture you will be able to apply least privilege to application identities.
This lecture explains Kubernetes networking from a security perspective, showing why the default model needs additional controls. In a standard cluster, every pod can usually communicate with every other pod, regardless of namespace, which is convenient but risky.
You will learn the basics of how pod networking works, including pod IP addresses, services that provide stable access, and the role of the network plugin that implements connectivity. We discuss east-west traffic, meaning communication between workloads inside the cluster, and north-south traffic, meaning traffic entering or leaving it.
The security concern is that a single compromised pod could scan and connect to databases, internal APIs, or the cluster metadata and control endpoints. Flat networks make it easy for a small problem to expand into a large one, which is why segmentation is a core principle.
We introduce the idea of default deny, where all traffic is blocked unless explicitly allowed, and explain that enforcement depends on a network plugin that supports policies. You will also see why encryption of in-cluster traffic, for example with a service mesh or mutual TLS, may be needed for sensitive data.
In your lab, you will test connectivity between SecureCart components and an unrelated pod to see how open the default network is.
By the end of this lecture you will understand the risks of flat pod networking and the strategy for restricting it.
This lecture shows how to create Kubernetes NetworkPolicies that restrict ingress and egress traffic for your workloads. NetworkPolicies act like firewall rules for pods, selecting which pods may talk to which, on which ports.
You will learn the structure of a policy: a pod selector choosing the pods the policy applies to, policy types indicating ingress, egress, or both, and rules that list allowed sources or destinations by pod labels, namespace labels, or IP ranges, along with permitted ports. Once a pod is selected by any policy for a direction, all traffic in that direction that is not allowed is dropped.
We build the recommended pattern step by step. First, apply a default deny policy to a namespace. Then add specific allow rules, such as permitting the web tier to reach the API on its service port, and the API to reach the database, while blocking everything else. We also cover allowing DNS in egress rules, which is a common cause of confusing failures.
You will learn how to test policies by running temporary test pods and checking which connections succeed, and to confirm that your network plugin enforces them.
In your lab, you will implement a full set of policies for SecureCart.
By the end of this lecture you will be able to design, write, and verify ingress and egress restrictions.
This lecture explains how to manage Kubernetes Secrets securely. A Kubernetes Secret is an object designed to hold sensitive data, but by default its contents are only base64 encoded, which is a format and not a protection.
You will learn the main risks. Secrets stored in manifests in version control are exposed to anyone with repository access. Anyone with permission to read secrets through the API can see their values. Without encryption at rest, secrets are stored in etcd readable by anyone with access to the data or backups. Pods that mount secrets or expose them as environment variables may also leak them through logs or debugging.
We then cover defenses. They include enabling encryption at rest for secret data, restricting RBAC so that few identities can read secrets, preferring mounted files over environment variables, and using separate secrets per application and environment. You will also learn about external secret management systems and operators that synchronize values from a central vault, and about sealed or encrypted manifests that make it safe to keep secret definitions in version control.
We discuss rotation and how to update a running application when a secret changes.
In your lab, you will create a Secret from a fake value, mount it into SecureCart as a file, and restrict who may read it.
By the end of this lecture you will understand the limits of default secrets and how to handle them safely.
This lecture covers protecting Kubernetes API access and other sensitive cluster data. Beyond workload settings, the cluster itself holds information and endpoints that must be guarded carefully, since access to them can reveal or change everything.
You will learn how to limit who can reach the API server, using private endpoints, network restrictions, and authorized address ranges. We also discuss disabling anonymous access, requiring strong authentication for people, and using short-lived credentials rather than long-lived tokens or shared kubeconfig files. Administrative access should be rare, time-bound, and recorded.
Next, we examine other sensitive data and interfaces. These include etcd and its backups, the kubelet API on each node, cloud instance metadata services that can reveal node credentials, dashboards and monitoring tools, and logs that may contain sensitive values. For each, we explain the protective measure, such as network isolation, authentication, and encryption.
The lecture covers enabling Kubernetes audit logging to capture who accessed or changed what, and reviewing those records regularly. You will learn why audit data itself must be protected and sent to a separate system.
In your lab, you will review your kubeconfig, check which endpoints are reachable, and examine the audit settings available.
By the end of this lecture you will be able to identify sensitive cluster assets and apply layered protection to them.
This lecture covers securing application ingress and TLS communication in Kubernetes. Ingress is how external users reach your services, which makes it a prime location for security controls and a common source of exposure when poorly configured.
You will learn how an ingress controller receives traffic, routes it to services based on host and path rules, and can terminate TLS. We stress exposing only the services that truly need public access and keeping databases and internal APIs reachable only inside the cluster.
We then cover TLS fundamentals. Certificates prove a server's identity and enable encrypted traffic, protecting data from interception or tampering. You will learn how to store a certificate and key as a Kubernetes TLS secret, configure ingress to use it, redirect plain HTTP to HTTPS, and select modern protocol versions. We introduce cert-manager as a way to issue and renew certificates automatically, avoiding outages caused by expiry.
The lecture also discusses additional protections at the edge, including security headers, rate limiting, request size limits, and optionally a web application firewall. We touch on mutual TLS for traffic between internal services.
In your lab, you will create a self-signed certificate for a local hostname and expose SecureCart through HTTPS.
By the end of this lecture you will be able to publish an application more safely and manage its certificates.
In this hands-on lab you will apply RBAC, NetworkPolicies, and secret controls to the SecureCart application, bringing together the identity, network, and data protections from this section.
The suggested steps are as follows. First, create a dedicated service account for SecureCart, disable unnecessary token mounting, and write a namespace-scoped Role that grants only the minimal permissions the application needs, often none. Create a RoleBinding and use the authorization check to confirm which actions are allowed and denied.
Second, apply a default deny network policy to the namespace, then add policies that allow only the required paths: ingress controller to the web tier, web tier to the API, and API to the database, plus DNS egress. Test connectivity from an unrelated temporary pod and confirm that unauthorized connections are blocked.
Third, create a Kubernetes Secret from a synthetic password, mount it as a read-only file, remove any secrets stored as plain environment values, and limit which service accounts and users may read it.
Finally, review your results, document each control, and note what evidence proves it works.
All actions occur in your isolated local cluster using fake data only.
By the end of this lab you will have a SecureCart deployment with least privilege identity, segmented networking, and safer secret handling, plus a checklist you can reuse elsewhere.
This lecture introduces container runtime security, the practice of detecting and responding to problems while containers are actually running. Earlier sections focused on preventing weaknesses through secure images and configuration, but prevention can never be perfect, so you also need visibility into live behavior.
You will learn why runtime matters. New vulnerabilities are discovered after deployment, configurations drift, credentials can be stolen, and trusted software can behave unexpectedly. Scanning an image tells you what is installed, but it cannot tell you what a process is doing right now.
We describe the main goals of runtime security: observe what happens inside and around containers, recognize behavior that deviates from what is normal, alert the right people quickly, and support investigation and response. You will see how this complements build-time checks, admission policies, and hardening, forming the detect and respond side of defense in depth.
The lecture previews the signals available at runtime, including process activity, file access, network connections, system calls, and orchestrator events, and the kinds of tools that collect them, such as kernel-level sensors based on eBPF.
We also discuss limits, including noise, performance cost, and the need for tuning.
By the end of this lecture you will understand why runtime visibility is essential, what it can and cannot achieve, and how the tools and techniques in this section will help you monitor SecureCart.
This lecture describes common runtime threats that security monitoring aims to detect, from the defender's point of view. The focus is on unexpected processes, privilege escalation, and other suspicious activity inside containers.
You will learn why most containers should be highly predictable. A web application container normally runs a small, known set of processes, reads a limited set of files, and makes expected network connections. Activity outside that pattern deserves attention. Examples include an interactive shell appearing in a production container, package managers running unexpectedly, new binaries being written and executed, changes to sensitive files, and unusual outbound connections.
We discuss privilege escalation signals conceptually, such as a process gaining capabilities or a user ID change that the application never normally performs, and attempts to access host resources, the container runtime socket, or service account tokens. We also cover indicators of resource abuse, such as sudden sustained CPU usage.
The focus is on recognizing and understanding these signals, not on carrying out any activity. You will learn why each signal matters, how it maps to earlier weaknesses, and which hardening controls reduce the chance of it occurring.
By the end of this lecture you will be able to describe common runtime warning signs and explain what each might indicate about a container's health.
This lecture explains container logs, events, and security telemetry, the raw information that all monitoring and investigation depend on. Without good data, even the best tools and analysts cannot detect or understand a problem.
You will learn the main sources. Application and container logs record what the software reports. Runtime and daemon logs show container lifecycle actions. Kubernetes events and audit logs record cluster activity, such as pod creation and API requests. Node and kernel logs capture host-level behavior, and network flow data shows communication patterns. Security-specific sensors add process, file, and system call visibility.
We discuss how to collect these safely. Containers are short-lived, so logs must be shipped to a central, durable location before the pod disappears. You will see common patterns, including logging to standard output and using node-level agents that forward data to a log platform. We also cover structured logging, consistent timestamps, and adding context such as namespace, pod, and image.
Importantly, logs must not contain secrets or excessive personal data, and access to them should be restricted and retained according to policy.
In your lab, you will view container logs, Kubernetes events, and basic runtime information for SecureCart.
By the end of this lecture you will know which data sources exist, how to gather them, and how to make them useful for detection.
This lecture introduces Falco, an open source runtime threat detection tool and a graduated project of the Cloud Native Computing Foundation. Falco watches the behavior of containers and hosts and raises alerts when activity matches rules describing suspicious or unexpected actions.
You will learn how Falco works. It collects events from the Linux kernel, most commonly system calls, using a driver based on eBPF or a kernel module. It enriches them with container and Kubernetes metadata, such as pod name and namespace, and evaluates them against a set of rules. When a rule condition matches, Falco generates an alert with relevant details.
We explain the main building blocks, including rules, macros, and lists, along with the default rule set that covers common concerns such as shells in containers, access to sensitive files, and unexpected network behavior. You will see where alerts can be sent, such as logs, files, and external systems through additional components.
The lecture also discusses where Falco fits compared with scanners and admission policies: it is a detective control focused on live behavior.
We cover considerations like performance overhead, kernel compatibility, and the importance of tuning.
By the end of this lecture you will understand what Falco does, how it collects and evaluates events, and why it is a valuable addition to a layered container security strategy.
This lecture walks through installing and configuring Falco in your lab environment so it can monitor the SecureCart workloads. Practical setup helps you understand what happens beneath the surface and how to confirm the tool is healthy.
You will learn the installation options, including running Falco directly on a host, as a container, and as a Kubernetes deployment using a Helm chart, which is the usual approach for clusters. We discuss prerequisites such as kernel version support, the choice of driver, and the permissions Falco needs, noting that a sensor requiring elevated privileges is itself a sensitive component that deserves protection.
Next, we cover configuration. You will see the main configuration file, how to choose where alerts are written, how to select output formats such as JSON for easier processing, and how to enable Kubernetes metadata enrichment. We also review how rules files are loaded and how to update them.
You will then verify the installation by checking pod status, reading the startup logs, and confirming the driver loaded correctly. Common problems such as driver compatibility on local clusters are discussed along with troubleshooting steps.
In your lab, you will install Falco in your local cluster and view its initial output.
By the end of this lecture you will have a working Falco deployment and know how to check that it is monitoring correctly.
This lecture explains Falco security rules and alerts, so you can read and understand what the tool is telling you. A rule is a description of behavior you want to notice, and an alert is the record produced when that behavior is observed.
You will learn the structure of a rule. It includes a name, a description, a condition that is evaluated against each event, an output message that formats the alert, a priority such as warning or critical, and tags. Conditions use fields that describe events, such as the process name, the user, the container image, the file path, and the Kubernetes namespace. Macros and lists let rules reuse common definitions.
We examine several default rules in detail, including detection of a terminal shell started in a container, reads of sensitive files, and unexpected outbound connections. You will see how each rule's condition is built and why it is written that way.
The lecture also explains how to read an alert, identifying the time, rule, priority, process, command line, user, container, and pod, which together give you the first picture of what happened.
In your lab, you will trigger harmless, expected events, such as opening a shell in your own test container, and observe the corresponding alerts.
By the end of this lecture you will be able to interpret Falco rules and alerts and understand how conditions map to real behavior.
This lecture shows how to create custom detection rules and reduce false positives. Default rules are a good start, but every environment has its own normal behavior, and tuning is what turns a noisy tool into a reliable one.
You will learn how to write a simple custom rule for SecureCart. For example, you may define that the web container should never launch a shell or a package manager, or that a process should not write to a particular directory. We walk through choosing a clear condition, writing a helpful output message with useful fields, assigning a sensible priority, and adding tags for organization.
We then cover reducing false positives. Alerts triggered by legitimate activity, such as an approved maintenance task or a known health check, should be handled by refining the condition, adding exceptions for specific processes or images, or narrowing the rule's scope. You will learn why broad exceptions are dangerous and why each one should be documented.
The lecture also covers testing rules, keeping them in version control, and reviewing them regularly as the application changes. We discuss alert fatigue and why a small number of trustworthy alerts is better than many ignored ones.
In your lab, you will create a custom rule, test it with harmless activity in your own container, and adjust it to remove noise.
By the end of this lecture you will be able to write, test, and tune detection rules.
This lecture covers how to investigate runtime alerts and respond to security events in a calm, structured way. An alert is only the starting point, and good outcomes depend on quickly deciding whether it represents a real problem.
You will learn a simple triage process. First, read the alert carefully and identify the affected container, pod, namespace, and node. Second, gather context by checking container logs, recent Kubernetes events, the image and its version, recent deployments, and related alerts. Third, decide whether the activity is expected, suspicious, or confirmed malicious, and record your reasoning.
For events that appear real, we discuss response options. These include isolating the workload with a restrictive network policy, preserving evidence such as logs and relevant details before changing anything, scaling down or deleting the affected pod so a clean replacement is created from a trusted image, rotating any credentials the workload could access, and investigating how the issue occurred so it can be fixed at the source.
We emphasize documentation, communication with stakeholders, and learning from each event by improving rules, images, or policies.
In your lab, you will practice triage using alerts from your own test activity.
By the end of this lecture you will understand a repeatable investigation workflow and the main containment and recovery actions for container incidents.
In this hands-on lab you will detect and investigate suspicious container activity in your isolated SecureCart environment. The exercise brings together runtime monitoring, Falco rules, and the investigation workflow from this section.
The suggested steps are as follows. First, confirm Falco is running in your local cluster and sending alerts to a location you can read. Second, create a harmless, controlled event in a test container that you own, such as opening an interactive shell or reading a clearly labeled dummy file, and observe which default rule fires.
Next, review the alert details and match them with container logs and Kubernetes events to build a short timeline. Write a custom rule that detects a behavior you consider unexpected for the SecureCart web container, apply it, repeat the harmless activity, and confirm the new alert appears. Then adjust the rule to avoid false positives from normal health checks.
Finally, practice the response steps. Apply a network policy to isolate the test workload, collect the relevant logs, remove the pod so a clean one replaces it, and write a brief incident note describing what was detected, how it was investigated, and what would be improved.
All activity is limited to your own local lab using benign actions only. Never run tests on systems you do not own.
By the end of this lab you will have practiced end-to-end detection, investigation, and response.
This course contains the use of artificial intelligence.
Master Container Security with Hands-On Docker, Kubernetes, DevSecOps, and Cloud-Native Security Labs
Are you ready to secure modern applications and protect your containerized infrastructure from cyber threats?
Welcome to Container Security Essentials, a practical, hands-on course designed to help you master Docker Security, Kubernetes Security, Container Hardening, DevSecOps, and Cloud-Native Application Security.
As organizations increasingly adopt Docker containers, Kubernetes clusters, microservices, and cloud-native architectures, securing containerized applications has become an essential skill for DevOps Engineers, Cloud Engineers, Cybersecurity Professionals, Software Developers, and Platform Engineers.
This course takes you beyond theory. You'll learn how to identify vulnerabilities, reduce attack surfaces, enforce security policies, monitor runtime activity, and integrate automated security checks throughout the Software Development Lifecycle (SDLC).
Through practical demonstrations and real-world scenarios, you'll develop the confidence to secure container environments from development to production.
What You'll Learn
Container Security Fundamentals: Understand container architecture, isolation, attack surfaces, and common container security vulnerabilities.
Docker Security Best Practices: Secure Dockerfiles, harden Docker images, implement least privilege, and protect container runtime environments.
Container Image Vulnerability Scanning: Use Trivy to identify vulnerabilities, misconfigurations, exposed secrets, and outdated dependencies.
Secure Container Image Building: Implement multi-stage Docker builds, minimal base images, non-root users, and secure image configurations.
Kubernetes Security: Protect Kubernetes workloads using RBAC, Pod Security Standards, Security Contexts, and NetworkPolicies.
Container Runtime Security: Detect suspicious activity, unauthorized processes, and runtime threats using Falco.
Container Supply Chain Security: Explore SBOMs, image signing, Cosign, software dependencies, and artifact integrity.
DevSecOps and CI/CD Security: Integrate automated vulnerability scanning and security quality gates into GitHub Actions pipelines.
Secrets Management: Protect credentials, API keys, configuration files, and sensitive application data.
Container Security Monitoring: Understand logging, security alerts, threat detection, incident response, and continuous monitoring.
Hands-On Projects and Practical Labs
Learning container security should involve securing actual applications, not simply memorizing security concepts.
Throughout this course, you'll work with SecureCart, a sample containerized application designed to demonstrate common security weaknesses and practical defenses.
You'll build Docker images, perform container vulnerability assessments, implement Docker hardening techniques, configure Kubernetes security controls, investigate simulated security incidents, and automate security testing through CI/CD pipelines.
Your final capstone project brings everything together as you secure a containerized application using industry-relevant tools and practices.
Tools and Technologies Covered
Docker, Kubernetes, Docker Compose, Trivy, Falco, GitHub Actions, Cosign, Syft, kubectl, kind, Helm, Kyverno, Linux Security, RBAC, NetworkPolicies, SBOM, CI/CD, DevSecOps, and Container Security Scanning.
The course emphasizes free and open-source security tools, allowing you to develop practical skills without purchasing expensive enterprise security platforms.
Who Should Enroll?
This course is ideal for DevOps Engineers, DevSecOps Engineers, Cloud Security Engineers, Cybersecurity Analysts, Kubernetes Administrators, Platform Engineers, Software Developers, and IT professionals interested in Cloud Security, Application Security, and Container Security Engineering.
Basic command-line familiarity is helpful, but previous container security experience isn't required.
By the end, you'll understand how to build, deploy, monitor, and defend containerized applications using practical, defense-in-depth security techniques.
Start building safer containers, stronger Kubernetes deployments, and more secure DevOps pipelines today!