Lesson 6 of 10

Container & Kubernetes Security

Containers and Kubernetes have become the default deployment platform for cloud-native applications — and they introduce a new attack surface that most security teams are not prepared for. This lesson covers Docker security hardening, Kubernetes RBAC, network policies, and the most common container escape and cluster compromise techniques used by attackers.

Learning Objectives — Deep Dive

Each objective below is broken down into plain English so you know exactly what you are learning, why it matters, and what you will be able to do when you are done. Mark each one complete as you work through the lesson.

0/4
In plain English

This is about pattern recognition — training your eye to spot specific things in the wild. You are learning to look at a situation and immediately categorize it correctly. Think of it like learning to identify different types of birds: at first everything looks the same, but with practice you start seeing the distinguishing features instantly.

Why this matters

This objective builds a foundational skill that every security professional uses regularly. Mastering it gives you the vocabulary, mental models, and practical ability to tackle more advanced topics with confidence — and to communicate clearly with both technical and non-technical colleagues.

Real-world analogy

Think of it like learning to drive. You do not need to understand how the engine works to drive safely, but knowing the basics helps you diagnose problems and avoid mistakes that could cause accidents. The same principle applies here — foundational knowledge prevents costly errors.

What you will be able to do

Apply this skill in a real lab environment, explain it clearly to a colleague or client, and use it as a building block for the more advanced techniques that come later in this course.

Beginner tip

Do not try to memorize everything at once. Read through the material once to get the big picture, then go back and work through the lab. The hands-on practice is what makes the concepts stick — passive reading alone will not get you there.

Container & Kubernetes Security · Objective 1 of 4

VIDEO
Loading video…
1

Scan a container image for CVEs

Use Trivy to scan a Docker image for known vulnerabilities before deployment.

trivy image --severity HIGH,CRITICAL nginx:latest
2

Audit Kubernetes RBAC

List ClusterRoleBindings that grant cluster-admin to identify over-privileged accounts.

kubectl get clusterrolebindings -o json | jq -r ".items[] | select(.roleRef.name=="cluster-admin") | .subjects"
3

Check for privileged pods

Find pods running with privileged security context in your cluster.

kubectl get pods --all-namespaces -o json | jq -r ".items[] | select(.spec.containers[].securityContext.privileged==true) | .metadata.name"
4

Apply a Network Policy

Create a default-deny network policy and then allow only required traffic between pods.

kubectl apply -f deny-all-netpol.yaml