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.
Scan a container image for CVEs
Use Trivy to scan a Docker image for known vulnerabilities before deployment.
trivy image --severity HIGH,CRITICAL nginx:latestAudit 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"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"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