walidshaari/Certified-Kubernetes-Security-Specialist
Online resources that will help you prepare for taking the CNCF/Linux Foundation CKS 2020 "Kubernetes Certified Security Specialist" Certification exam. with time, This is not likely the comprehensive up to date list - please make a pull request if there something that should be added here.
repo name | walidshaari/Certified-Kubernetes-Security-Specialist |
repo link | https://github.com/walidshaari/Certified-Kubernetes-Security-Specialist |
homepage | |
language | |
size (curr.) | 123 kB |
stars (curr.) | 271 |
created | 2020-08-19 |
license | Creative Commons Attribution Share Alike 4.0 International |
Certified Kubernetes Security Specialist - CKS
Online curated resources that will help you prepare for taking the Kubernetes Certified Kubernetes Security Specialist CKS Certification exam.
- Please raise an issue, or make a pull request for fixes, new additions, or updates.
I will try to restrict the cross references of resources primarly to kubernetes.io as CNCF/Linux Foundation exam rules allows you search kubernetes.io/{docs|blog} and kubernetes github repo only. Youtube videos and other third party resources e.g. blogs will be provided as an optional complimentary material and any 3rd party material not allowed in the exam will be designated with :triangular_flag_on_post: in the curriculum sections below.
Ensure you have the right version of Kubernetes documentation selected (e.g. v1.19 as of 17th Nov GA announcement) especially for API objects and annotations, however for third party tools, you might find that you can still find references for them in old releases and blogs e.g. falco install.
- Icons/emoji legend
- :clipboard: Expand to see more content
- :confused: Verify, not best resource yet
- :large_blue_circle: Good overall refence, can be used in the exam
- :triangular_flag_on_post: External third-party resource, can not be used during exam
- :pencil: ToDo, item that needs further checking(todo list for future research/commits)
Exam Objectives
These are the exam objectives you review and understand in order to pass the test.
CKS repo topics overview
- Cluster Setup - 10%
- Cluster Hardening - 15%
- System Hardening - 15%
- Minimize Microservice Vulnerabilities - 20%
- Supply Chain Security - 20%
- Monitoring, Logging and Runtime Security - 20%
Extra helpful material
- Slack
- Books
- Youtube Videos
- Webinars
- Containers and Kubernetes Security Training
- Extra Kubernetes security resources
Cluster Setup - 10%
:large_blue_circle: Securing a Cluster
-
Use Network security policies to restrict cluster level access
-
:triangular_flag_on_post: Use CIS benchmark to review the security configuration of Kubernetes components (etcd, kubelet, kubedns, kubeapi)
-
Properly set up Ingress objects with security control
-
Verify platform binaries before deploying
- checking the Kubernetes release page for the specific release
- checking the change log for the images and their digests
- checking the Kubernetes release page for the specific release
Cluster Hardening - 15%
-
Use Role-Based Access Controls to minimize exposure
- :triangular_flag_on_post: handy site collects together articles, tools and the official documentation all in one place
-
Exercise caution in using service accounts e.g. disable defaults, minimize permissions on newly created ones
service account scope
apiVersion: v1 kind: ServiceAccount metadata: name: build-robot automountServiceAccountToken: false
pod scope
apiVersion: v1 kind: Pod metadata: name: cks-pod spec: serviceAccountName: default automountServiceAccountToken: false
System Hardening - 15%
-
Minimize host OS footprint (reduce attack surface)
- seccomp which stands for secure computing was originally intended as a means of safely running untrusted compute-bound programs
- AppArmor can be configured for any application to reduce its potential host attack surface and provide greater in-depth defense.
- PSP pod security policy enforces
- apply host updates
- Install minimal required OS fingerprint
- Protect access to data with permissions
-
Minimize IAM roles
- :confused: Access authentication and authorization
-
Minimize external access to the network
- not tested, however, the thinking is that all pods can talk to all pods in all name spaces but not to the outside of the cluster!!!
apiVersion: networking.k8s.io/v1 kind: NetworkPolicy metadata: name: deny-external-egress spec: podSelector: {} policyTypes: - Egress egress: to: - namespaceSelector: {}
-
Appropriately use kernel hardening tools such as AppArmor, seccomp
Minimize Microservice Vulnerabilities - 20%
- Setup appropriate OS-level security domains e.g. using PSP, OPA, security contexts
- Manage kubernetes secrets
- Use container runtime sandboxes in multi-tenant environments (e.g. gvisor, kata containers)
- Implement pod to pod encryption by use of mTLS
- :pencil: check if service mesh is part of the CKS exam
Supply Chain Security - 20%
-
Minimize base image footprint
- Use distroless, UBI minimal, Alpine, or relavent to your app nodejs, python but the minimal build.
- Do not include uncessary software not required for container during runtime
- e.g build tools and utilities, troubleshooting and debug binaries.
- :triangular_flag_on_post: Learnk8s smaller docker images blog
- :triangular_flag_on_post: GKE 7 best practices for building containers
- e.g build tools and utilities, troubleshooting and debug binaries.
-
Secure your supply chain: whitelist allowed image registries, sign and validate images
-
Use static analysis of user workloads (e.g. kubernetes resources, docker files)
-
Scan images for known vulnerabilities
- :triangular_flag_on_post: Aqua security Trivy
- :triangular_flag_on_post: Anchore command line scans
Monitoring, Logging and Runtime Security - 20%
- Perform behavioural analytics of syscall process and file activities at the host and container level to detect malicious activities
-
Detect threats within a physical infrastructure, apps, networks, data, users and workloads
-
Detect all phases of attack regardless where it occurs and how it spreads
- :triangular_flag_on_post:Kubernetes attack martix Microsoft blog
- :triangular_flag_on_post: MITRE attack framwork using sysdig falco
- :triangular_flag_on_post: Lightboard video: Kubernetes attack matrix - 3 steps to mitigating the MITRE ATT&CK Techniques
- :triangular_flag_on_post: CNCF Webinar: Mitigating Kubernetes attacks
-
Perform deep analytical investigation and identification of bad actors within the environment
- Monitoring Kubernetes with sysdig
- :triangular_flag_on_post:CNCF Webinar: Getting started with container runtime security using Falco
Extra helpful material
Slack
Books
- Aqua Security Liz Rice:Free Container Security Book
- Learn Kubernetes security: Securely orchestrate, scale, and manage your microservices in Kubernetes deployments
Youtube Videos
- Google/Ian Lewis: Kubernetes security best practices
- Code in Action for the book Learn Kubernetes Security playlist
- Kubernetes security concepts and demos
- How to Train your Red Team (for Cloud-Native) - Andrew Martin, ControPlane
- InGuardians/Jay Beale: Kubernetes Practical attacks and defences\
- Webinars
- AquaSec webiners collection - Webinars and videos presented by leading industry experts covering Microservices, Container & Serverless security, Kubernetes, DevSecOps, and everything related to the most disruptive area in IT.
Containers and Kubernetes Security Training
- Killer.sh CKS practice exam ⟹ use code walidshaari for 20% discount
- Udemy Kubernetes CKS 2020 Complete Course and Simulator
- Linux Foundation Kubernetes Security essentials LFS 260
- Linux Academy/ACloudGuru Kubernetes security
- Cloud native security defending containers and kubernetes
- Tutorial: Getting Started With Cloud-Native Security - Liz Rice, Aqua Security & Michael Hausenblas
- K21 academy CKS step by step activity hands-on-lab activity guide
- Andrew Martin Attacking and Defending Cloud Native Infrastructure
- Andrew Martin Control Plane Security training
Extra Kubernetes security resources
- Kubernetes-security.info
- Aquasecurity Blogs
- Control-plane/Andrew Martin @sublimino: 11 ways not to get hacked
- Securekubernetes
- Simulator: A distributed systems and infrastructure simulator for attacking and debugging Kubernetes
CVEs
- CNCF Kubernetes Security Anatomy and the Recently Disclosed CVEs (CVE-2020-8555, CVE-2020-8552)
- Kubernetes Vulnerability Puts Clusters at Risk of Takeover (CVE-2020-8558)
Other CKS related repos
- Stackrox CKS study guide
- Viktor Vedmich - CKS resources
- Abdennour - CKS resources
- Ibrahim Jelliti - CKS resources
- Madhu Akula’s Kubernetes Goat - vulnerable cluster environment to learn and practice Kubernetes security.
- Kubernetes Capture the Flag vagrant environment - was hosted online on http://k8s-ctf.rocks/