CKS 2026 Exam Prep: Certified K8s Security

๐Ÿ’ก CKS 2026 Exam Prep: Certified K8s Security โ€” Executive Summary

Technical architectural analysis, practical configuration manifests, and deployment instructions for CKS 2026 Exam Prep: Certified K8s Security.


Study

  • In-house technology club

    โ€“ [Add subtitle](https://www.canva.com/design/DAHKE-QYkIE/nrLyzRbAXLpCVsiSLsVy_w/edit)
    โ€“ Activity method:
    โ€“ Preparation before each meeting: After taking Udemy, organize what you have learned under your name in the notion directory by one week before each meeting (required content: definition of the content, test cases and results), and the length of the presentation will be about 5 minutes (no presentation).
    โ€“ During group meetings: Create AWS instances for each group to learn and share based on the notion of what other people have learned
    โ€“ \
    1. Lee Geum-hong, Kim Ga-young, Ahn Hyo-jun
    2. Kim Hong-hee, Choi Si-young, Kim Myeong-han
    3. Ye-eun Hwang, Ji-hye Park, Young-jun Park

  • AWS:

    โ€“ [606163771990.signin.aws.amazon.com](https://606163771990.signin.aws.amazon.com/console)
    โ€“ mh.kim2
    โ€“ region: ap-northeast-2

Docs

Required
  • CKA \~
Curriculum
CKS (Certified Kubernetes Security Specialist) Curriculum

The CKS certification is designed to ensure that Kubernetes security professionals have the skills, knowledge, and competencies to secure container-based applications and the Kubernetes platform during build, deployment, and runtime.
This certification demonstrates the ability to apply Kubernetes security best practices, including:

  • Cluster Hardening
  • System and network security
  • Supply Chain Security
  • Monitoring and incident response

This certification is intended for Kubernetes administrators, cloud security engineers, and IT professionals who want to validate their security expertise in Kubernetes environments. More information about the exam can be found on the Linux Foundation Training website.

Evaluation area and proportion
Domain Weight
Cluster Setup
โ€ข Restrict cluster-level access using network security policies. Review the security configuration of Kubernetes components (etcd, kubelet, kubedns, kubeapi) using CIS benchmarks. Set up Ingress appropriately using TLS. Secure node metadata and endpoints. Verify platform binaries before deployment.
10%
Cluster Hardening
โ€ข Use role-based access control to minimize exposure. Be careful when using service accounts. Example: Disabling defaults, minimizing permissions for newly created accounts, limiting access to Kubernetes APIs Upgrading Kubernetes to prevent vulnerabilities
15%
System Hardening
โ€ข Minimize the host OS footprint (reduce the attack surface)Use least-privilege identity and access managementMinimize external access to the networkUse kernel hardening tools such as AppArmor and seccomp appropriately
15%
Minimize Microservice Vulnerabilities
โ€ข Use appropriate Pod security standardsManageKubernetes secretsUnderstand and implement isolation technologies (multi-tenancy, sandbox containers, etc.)Implement inter-pod encryption (Cilium, Istio)
20%
Supply Chain Security
โ€ข Minimize the basic image footprintUnderstand the supply chain (e.g. SBOM, CI/CD, artifact repositories)Supply chain security (whitelisted registries, artifact signing and verification, etc.)Perform static analysis of user workloads and container images (e.g. Kubesec, KubeLinter)
20%
Monitoring, Logging and Runtime Security
โ€ข Perform behavioral analysis to detect malicious activityDetect threats within physical infrastructure, apps, networks, data, users, and workloads Investigate and identify attack stages and malicious actors within the environment Ensure immutability of containers at runtime Monitor access using Kubernetes audit logs
20%

Binary diagram

You are preparing for the CKS (Certified Kubernetes Security Specialist) certification exam! We have clearly organized them by area so that you can understand at a glance the core binaries (tools), add-ons (plug-ins/components), and essential security concepts that will be directly handled in the test environment.

1. Cluster Security & Binaries

These are the core tools and concepts used when checking and controlling the components of a cluster in a test environment (based on Kubeadm).

Category item Key roles and related key concepts Exam Practice Points
Binary kube-apiserver Entry point for the cluster. Central to all security controls Enable plugins such as NodeRestriction, AlwaysPullImages
Binary kubelet Agent running on each node Block anonymous requests (anonymous: enabled: false), enable webhook authentication
Binary etcd KV storage where all data in the cluster is stored Data encryption (EncryptionConfiguration), apply TLS certificate
Concept CIS Benchmark Kubernetes Security Configuration Standard Guidelines Use the kube-bench tool to diagnose master/worker node vulnerability entry points
Concept RBAC Role-based access control (Role, ClusterRole) Principle of Least Privilege applied, service account restricted
2. System Hardening & Add-ons

Tools and concepts that increase the isolation of containers and limit permissions at the kernel level and OS level.

Category item Key roles and related key concepts Exam Practice Points
Add-on/Module AppArmor Linux kernel security module (applying profile for each program) Apply Profile to Pod (container.apparmor.security.beta.kubernetes.io)
Add-on/Module seccomp Limits on system calls that a container can use Set the Pod’s securityContext.seccompProfile (RuntimeDefault or custom)
Concept Security Context Permissions and security settings at pod/container level runAsNonRoot: true, readOnlyRootFilesystem: true, allowPrivilegeEscalation: false
3. Microservice & Network Security

This is an area that controls communication between pods and manages authentication and encryption when external traffic enters.

Category item Key roles and related key concepts Exam Practice Points
Concept/Object NetworkPolicy Control L3/L4 network traffic between pods and externally Isolate Ingress, Egress and restrict specific labels
Add-on Ingress Controller Route external traffic to services inside the cluster TLS certificate (Secret) integration and HTTPS enforcement settings
Concept mTLS Mutual TLS authentication between services (Service Mesh basic concept) Data encryption and identity verification when communicating between pods
4. Supply Chain Security & Static Analysis

These are tools that prevent resources with vulnerabilities from entering the cluster from the image building stage until deployment.

Category item Key roles and related key concepts Exam Practice Points
Binary trivi or clair Container Image Vulnerability Scanner Check for CRITICAL vulnerabilities using the trivy image command
Binary kubesec Kubernetes manifest (YAML) file static security analysis tool Check the security score of the YAML file and fix vulnerable settings
Add-on Admission Controller Plugin that verifies/modifies requests before they are stored on the API server Understand the ValidatingWebhookConfiguration, MutatingWebhookConfiguration structures
Add-on ImagePolicyWebhook Force only image files that pass certain verifications to be distributed Link webhook settings to --admission-control-config-file on the API server
5. Monitoring, Logging & Runtime Security

This is an area that detects and records abnormal behavior that occurs in containers that are already deployed and running.

Category item Key roles and related key concepts Exam Practice Points
Binary/Add-on Falco Real-Time Runtime Threat Detection Tool (CNCF) Modify real-time rules, detect abnormal shell connection history in container (/etc/falco/falco_rules.local.yaml)
Concept Audit Logging A record of all requests reaching the API server (audit log) Writing Audit Policy file (Metadata, RequestResponse level), binding API server options
Binary crictl Container Runtime Interface (CRI) compliant container management tool When debugging, connect directly to the node and inspect the container status using crictl ps, crictl logs, etc.

๐Ÿ’ก Tips for passing CKS
CKS evaluates โ€œthe ability to directly modify the configuration file of the tool (binary) required by the problem (change declarative YAML) or take action based on the results (log/scan results) of running the provided toolโ€ rather than theory. We recommend that you repeatedly familiarize yourself with the path in which the above tools are installed and how they are linked with configuration files (kube-apiserver.yaml, etc.).



Shared data

Problem Item

1.Troubleshooting kubelet and etcd security issues
2. TLS Secret
3. Dockerfile security best practices
4. Pods accessing /dev/mem
5. Security Context (Container Security Context)
6. Log audit log audit
7. Network policy Deny and Allow
8. Publishing HTTPS service using Ingress
9. Disable automounting of API credentials
10. Upgrade cluster nodes
11. Create SPDX document using bom tool
12. Limited Pod Security Standard
13. Docker daemon protection
14. Cilium Network Policy
15. Container Image Policy (ImagePolicyWebhook)
16. Enable API Server Authentication


bash
๋ณด์•ˆ ์ปจํ…์ŠคํŠธ(Container Security Context)
๋ฌธ์ œ์—์„œ 
Context

๊ธฐ์กด Pod์„ ์—…๋ฐ์ดํŠธํ•˜์—ฌ ์ปจํ…Œ์ด๋„ˆ์˜ ๋ถˆ๋ณ€์„ฑ์„ ๋ณด์žฅํ•ด์•ผ ํ•œ๋‹ค.

Task

`sec-ns` ๋„ค์ž„์ŠคํŽ˜์ด์Šค์— ์žˆ๋Š” `secdep`์ด๋ผ๋Š” Deployment๋ฅผ ์ˆ˜์ •ํ•˜์—ฌ, ๊ทธ ์•ˆ์˜ ์ปจํ…Œ์ด๋„ˆ๊ฐ€ ๋‹ค์Œ ์กฐ๊ฑด์„ ๋งŒ์กฑํ•˜๋„๋ก ํ•˜๋ผ:

- ์‚ฌ์šฉ์ž ID 30000์œผ๋กœ ์‹คํ–‰
- ๋ฃจํŠธ ํŒŒ์ผ ์‹œ์Šคํ…œ์„ ์ฝ๊ธฐ ์ „์šฉ์œผ๋กœ ์„ค์ •
- ๊ถŒํ•œ ์ƒ์Šน(Privilege Escalation) ๊ธˆ์ง€

Deployment ๋งค๋‹ˆํŽ˜์ŠคํŠธ ํŒŒ์ผ์€ `~/sec-ns_deployment.yaml`์— ์žˆ๋‹ค.

๋‹ต์•ˆ 
candidate@master01:~$ kubectl get -f sec-ns_deployment.yaml
NAME     READY   UP-TO-DATE   AVAILABLE   AGE
secdep   1/1     1            1           134d
candidate@master01:~$ vim sec-ns_deployment.yaml
kind: Deployment
metadata:
  name: secdep
  namespace: sec-ns
spec:
  replicas: 1
  selector:
    matchLabels:
      app: secdep
  template:
    metadata:
      labels:
        app: secdep
    spec:
      containers:
      - name: sec-ctx-demo-1
        image: busybox:1.28
        imagePullPolicy: IfNotPresent
        command: [ "sh", "-c", "sleep 12h" ]
        securityContext:                        # ์ œ๋ชฉ ์š”๊ตฌ์‚ฌํ•ญ์— ๋”ฐ๋ผ ๋ณด์•ˆ ์ปจํ…์ŠคํŠธ ์ถ”๊ฐ€
          allowPrivilegeEscalation: false       # ๊ถŒํ•œ ์ƒ์Šน ๊ธˆ์ง€
          readOnlyRootFilesystem: true          # ๋ฃจํŠธ ํŒŒ์ผ ์‹œ์Šคํ…œ ์ฝ๊ธฐ ์ „์šฉ
          runAsUser: 30000                      # ์‚ฌ์šฉ์ž ID 30000 ์‚ฌ์šฉ
        volumeMounts:
        - name: sec-ctx-vol-1
          mountPath: /data/demo1
      - name: sec-ctx-demo-2
        image: busybox
        imagePullPolicy: IfNotPresent
        command: [ "sh", "-c", "sleep 12h" ]
        securityContext:                        # ์ œ๋ชฉ ์š”๊ตฌ์‚ฌํ•ญ์— ๋”ฐ๋ผ ๋ณด์•ˆ ์ปจํ…์ŠคํŠธ ์ถ”๊ฐ€
          allowPrivilegeEscalation: false       # ๊ถŒํ•œ ์ƒ์Šน ๊ธˆ์ง€
          readOnlyRootFilesystem: true          # ๋ฃจํŠธ ํŒŒ์ผ ์‹œ์Šคํ…œ ์ฝ๊ธฐ ์ „์šฉ
          runAsUser: 30000                      # ์‚ฌ์šฉ์ž ID 30000 ์‚ฌ์šฉ
        volumeMounts:
        - name: sec-ctx-vol-2
          mountPath: /data/demo2
      volumes:
        - name: sec-ctx-vol-1
          emptyDir: {}
        - name: sec-ctx-vol-2
          emptyDir: {}
candidate@master01:~$ kubectl apply -f sec-ns_deployment.yaml
deployment.apps/secdep configured
candidate@master01:~$
candidate@master01:~$ kubectl -n sec-ns get pod
NAME                      READY   STATUS        RESTARTS        AGE
secdep-697685948b-krg2k   2/2     Running       0               21s
secdep-7478777cc8-5546d   2/2     Terminating   16 (3h1m ago)   134d
candidate@master01:~$ exit
bash
๊ฐ์‚ฌ ๋กœ๊ทธ ๋ฌธ์ œ ์˜ˆ์ œ๋Š” 
Context
	๋„ˆ๋Š” kubeadm์œผ๋กœ ๊ตฌ์„ฑ๋œ ํด๋Ÿฌ์Šคํ„ฐ์— ๋Œ€ํ•ด ๊ฐ์‚ฌ๋ฅผ ๊ตฌํ˜„ํ•ด์•ผ ํ•œ๋‹ค.
Task
	๋จผ์ €, ํด๋Ÿฌ์Šคํ„ฐ์˜ API ์„œ๋ฒ„๋ฅผ ๋‹ค์Œ๊ณผ ๊ฐ™์ด ์žฌ๊ตฌ์„ฑํ•˜๋ผ:
โšซ `/etc/kubernetes/logpolicy/sample-policy.yaml`์˜ ๊ธฐ๋ณธ ๊ฐ์‚ฌ ์ •์ฑ…์„ ์‚ฌ์šฉํ•œ๋‹ค
โšซ ๋กœ๊ทธ๋ฅผ `/var/log/kubernetes/audit-logs.txt`์— ์ €์žฅํ•œ๋‹ค
โšซ ์ตœ๋Œ€ 2๊ฐœ์˜ ๋กœ๊ทธ๋ฅผ ๋ณด๊ด€ํ•˜๋ฉฐ, ๋ณด๊ด€ ๊ธฐ๊ฐ„์€ 10์ผ์ด๋‹ค
์ฃผ์˜: ๊ธฐ๋ณธ ์ •์ฑ…์€ ๊ธฐ๋กํ•˜์ง€ ์•Š์„ ํ•ญ๋ชฉ๋งŒ ์ง€์ •ํ•œ๋‹ค.

๊ทธ๋Ÿฐ ๋‹ค์Œ, ๊ธฐ๋ณธ ์ •์ฑ…์„ ํŽธ์ง‘ํ•˜๊ณ  ํ™•์žฅํ•˜์—ฌ ๋‹ค์Œ์„ ๊ธฐ๋กํ•˜๋ผ:
โšซ persistentvolumes ์ด๋ฒคํŠธ๋ฅผ RequestResponse ์ˆ˜์ค€์œผ๋กœ ๊ธฐ๋ก
โšซ `front-apps` ๋„ค์ž„์ŠคํŽ˜์ด์Šค์˜ `configmaps` ์ด๋ฒคํŠธ์˜ ์š”์ฒญ ๋ณธ๋ฌธ ๊ธฐ๋ก
โšซ ๋ชจ๋“  ๋„ค์ž„์ŠคํŽ˜์ด์Šค์—์„œ `ConfigMap`๊ณผ `Secret` ๋ณ€๊ฒฝ์„ Metadata ์ˆ˜์ค€์œผ๋กœ ๊ธฐ๋ก
โšซ ๊ธฐํƒ€ ๋ชจ๋“  ์š”์ฒญ์„ Metadata ์ˆ˜์ค€์œผ๋กœ ๊ธฐ๋ก
์ฃผ์˜: API ์„œ๋ฒ„๊ฐ€ ํ™•์žฅ๋œ ์ •์ฑ…์„ ์‚ฌ์šฉํ•˜๋„๋ก ๋ณด์žฅํ•˜๋ผ.

๋‹ต 
1. ์ •์ฑ…ํŽธ์ง‘ 
root@master01:~# cp /etc/kubernetes/logpolicy/sample-policy.yaml /opt/
root@master01:~# vim /etc/kubernetes/logpolicy/sample-policy.yaml
root@master01:~# cat /etc/kubernetes/logpolicy/sample-policy.yaml
apiVersion: audit.k8s.io/v1
kind: Policy
omitStages:
  - "RequestReceived"
rules:
  # ์—”๋“œํฌ์ธํŠธ๋‚˜ ์„œ๋น„์Šค์—์„œ "system:kube-proxy"๊ฐ€ ์ˆ˜ํ–‰ํ•˜๋Š” watch ์š”์ฒญ์€ ๊ธฐ๋กํ•˜์ง€ ์•Š์Œ
  - level: None
    users: ["system:kube-proxy"]
    verbs: ["watch"]
    resources:
    - group: "" # ์ฝ”์–ด API ๊ทธ๋ฃน
      resources: ["endpoints", "services"]

  # ํŠน์ • non-resource URL ๊ฒฝ๋กœ์— ๋Œ€ํ•œ ์ธ์ฆ๋œ ์š”์ฒญ์€ ๊ธฐ๋กํ•˜์ง€ ์•Š์Œ
  - level: None
    userGroups: ["system:authenticated"]
    nonResourceURLs:
    - "/api*" # ์™€์ผ๋“œ์นด๋“œ ๋งค์นญ
    - "/version"


# ์œ„์˜ ๊ธฐ์กด ๊ทœ์น™์€ ์‚ญ์ œํ•˜์ง€ ๋ง๊ณ , ์•„๋ž˜์— ๋ฌธ์ œ์—์„œ ์š”๊ตฌํ•œ ๊ทœ์น™๋งŒ ์ถ”๊ฐ€ํ•˜์‹ญ์‹œ์˜ค.
  # RequestResponse ์ˆ˜์ค€์˜ persistentvolumes ์ด๋ฒคํŠธ
  - level: RequestResponse
    resources:
    - group: ""
      resources: ["persistentvolumes"]
  # front-apps ๋„ค์ž„์ŠคํŽ˜์ด์Šค์˜ configmaps ์ด๋ฒคํŠธ ์š”์ฒญ ๋ณธ๋ฌธ
  - level: Request
    resources:
    - group: ""
      resources: ["configmaps"]
    namespaces: ["front-apps"]
  # ๋ชจ๋“  ๋„ค์ž„์ŠคํŽ˜์ด์Šค์—์„œ ConfigMap๊ณผ Secret ๋ณ€๊ฒฝ์„ Metadata ์ˆ˜์ค€์œผ๋กœ ๊ธฐ๋ก
  - level: Metadata
    resources:
    - group: ""
      resources: ["secrets", "configmaps"]
  # ๊ธฐํƒ€ ๋ชจ๋“  ์š”์ฒญ์„ Metadata ์ˆ˜์ค€์œผ๋กœ ๊ธฐ๋ก
  - level: Metadata
    omitStages:
      - "RequestReceived"

2. api ํŽธ์ง‘
root@master01:~# cp /etc/kubernetes/manifests/kube-apiserver.yaml /opt/
root@master01:~# vim /etc/kubernetes/manifests/kube-apiserver.yaml
apiVersion: v1
kind: Pod
metadata:
  annotations:
    kubeadm.kubernetes.io/kube-apiserver.advertise-address.endpoint: 11.0.1.111:6443
  creationTimestamp: null
  labels:
    component: kube-apiserver
    tier: control-plane
  name: kube-apiserver
  namespace: kube-system
spec:
  containers:
  - command:
    - kube-apiserver
    - --advertise-address=11.0.1.111
    - --allow-privileged=true
    - --authorization-mode=Node,RBAC
    - --audit-policy-file=/etc/kubernetes/logpolicy/sample-policy.yaml  # ๊ฐ์‚ฌ ์ •์ฑ…
    - --audit-log-path=/var/log/kubernetes/audit-logs.txt               # ๋กœ๊ทธ ์ €์žฅ ๊ฒฝ๋กœ
    - --audit-log-maxbackup=2                                           # ๋กœ๊ทธ ์ตœ๋Œ€ ๋ฐฑ์—… ์ˆ˜
    - --audit-log-maxage=10                                             # ๋กœ๊ทธ ๋ณด๊ด€ ์ผ์ˆ˜
    ยทยทยทยทยทยท

3. ๊ตฌ์„ฑ ์žฌ์ ์šฉ 
root@master01:~# systemctl daemon-reload && systemctl restart kubelet.service
root@master01:~#
root@master01:~# kubectl get pod -A   # 2๋ถ„ ๋Œ€๊ธฐ ํ›„ ํ™•์ธ, ํด๋Ÿฌ์Šคํ„ฐ ์ •์ƒ ์ƒํƒœ ํ™•์ธ
NAME                          READY   STATUS    RESTARTS        AGE
amd-gpu-6cbfd6c6d6-l5464      1/1     Running   7 (3h44m ago)   134d
nvidia-gpu-64c4d44986-x5qgh   1/1     Running   7 (3h44m ago)   134d
root@master01:~# tail /var/log/kubernetes/audit-logs.txt   # ๊ฒ€์ฆ
{"kind":"Event","apiVersion":"audit.k8s.io/v1","level":"Metadata","auditID":"a6c4f229-78be-41d7-a682-6f5597841f9c","stage":"ResponseComplete","requestURI":"/rAgent":"kubelet/v1.31.0 (linux/amd64) kubernetes/9edcffc","objectRef":{"resource":"nodes","name":"master01","apiVersion":"v1"},"responseStatus":{"metadata":ision":"allow","authorization.k8s.io/reason":""}}
ยทยทยทยทยท
root@master01:~#

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *