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 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
๋ณด์ ์ปจํ
์คํธ(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
๊ฐ์ฌ ๋ก๊ทธ ๋ฌธ์ ์์ ๋
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:~#




Leave a Reply