gashirar's blog

ウイスキーがすき/美味しいものがすき/k8sがすき

CNCF公認Kubernetes資格にCKSが追加されたので出題範囲を眺める

はじめに

CNCF公認Kubernetes資格にCertified Kubernetes Security Specialist(CKS)が追加されました。
Certified Kubernetes Administrator(CKA)、Certified Kubernetes Application Developer(CKAD)に続く資格で、セキュリティに関する資格となっています。

公式の発表はこちら。

www.cncf.io

受けるかもしれないので、出題範囲を眺めて忘備録的に公式ドキュメントをメモっときます。従来と同じ形式であれば、試験中に公式ドキュメントがみられるはず。
CKA/CKADのときも似たようなことやっており下記にまとめてます。

CKA合格ログ~事前学習/申し込み/試験~ - Qiita

CKAD合格ログ~事前学習/申し込み/試験~ - Qiita

あくまでも現時点で公表されている出題範囲であり、今後変わる可能性もあります。
「ここらへん出るんじゃないかな」という主観のメモなので悪しからず。

出題範囲

training.linuxfoundation.org

こちらから出題範囲を眺めてみます。
(リンクや青色の部分は追記したメモ)

Cluster Setup 10%

Use Network security policies to restrict cluster level access

Network Policies | Kubernetes

Use CIS benchmark to review the security configuration of Kubernetes components (etcd, kubelet, kubedns, kubeapi)

CIS Benchmarkといえば公式の下記だったり、GoogleからGKEの対応状況について公開されていたりします。

CIS Benchmarks

CIS ベンチマーク  |  Kubernetes Engine ドキュメント  |  Google Cloud

が、公式ドキュメントだと記載はあまり見られません。CIS Benchmarkに関わる設定に関しての出題がされるのかも。

Properly set up Ingress objects with security control

Ingress | Kubernetes

Protect node metadata and endpoints

Nodes | Kubernetes

Minimize use of, and access to, GUI elements

公式ドキュメントに載っているものでGUIというとあまり浮かびませんが、Web UIとかでしょうか。また別のところな気がします。

Web UI (Dashboard) | Kubernetes

Verify platform binaries before deploying

(筆者の主観でピンとくる公式ドキュメントが見つけられず)

Cluster Hardening 15%

Restrict access to Kubernetes API

Authorization Overview | Kubernetes

Kubelet authentication/authorization | Kubernetes

Use Role Based Access Controls to minimize exposure

Using RBAC Authorization | Kubernetes

Exercise caution in using service accounts e.g. disable defaults, minimize permissions on newly created ones

Managing Service Accounts | Kubernetes

Configure Service Accounts for Pods | Kubernetes

Using RBAC Authorization | Kubernetes

Pod Security Policies | Kubernetes

Update Kubernetes frequently

Kubernetes version and version skew support policy | Kubernetes

System Hardening 15%

Minimize host OS footprint (reduce attack surface)

筆者の主観でピンとくる公式ドキュメントが見つけられず。CoreOSとかそういったDistributionのことを言ってると思うのですが…。

Minimize IAM roles

IAMというとAWSなどのマネージドサービスの話に関わる範囲な気がします。

Minimize external access to the network

Network Policies | Kubernetes

Appropriately use kernel hardening tools such as AppArmor, seccomp

Pod Security Policies | Kubernetes

AppArmor | Kubernetes

Minimize Microservice Vulnerabilities 20%

抽象度が高いのでどのレイヤの話かよくわからず。必要最低限の通信のみを許可するといった話ならNetworkPolicyが該当しそうですが、もっと広範囲な気がします。

Pod Security Policies | Kubernetes

Setup appropriate OS level security domains e.g. using PSP, OPA, security contexts

Pod Security Policies | Kubernetes

OPA Gatekeeper: Policy and Governance for Kubernetes | Kubernetes

Configure a Security Context for a Pod or Container | Kubernetes

Manage Kubernetes secrets

Secrets | Kubernetes

Distribute Credentials Securely Using Secrets | Kubernetes

Use container runtime sandboxes in multi-tenant environments (e.g. gvisor, kata containers)

Container runtimes | Kubernetes

Runtime Class | Kubernetes

Implement pod to pod encryption by use of mTLS

Istioの機能としてよくmTLSはよく耳にしますが、公式ドキュメント上での記載はあまり見ない印象。
Control Plane関連の通信については下記にありました。

11 Ways (Not) to Get Hacked | Kubernetes

Supply Chain Security 20%

Minimize base image footprint

distroless Imageやscratchなどの話な気がします。

Secure your supply chain: whitelist allowed registries, sign and validate images

KubernetesのAdmissionWebhookではじくならImagePolicyWebhookでしょうか。

Using Admission Controllers | Kubernetes

OpenShift3.11を触っていたときはdocker daemon側ではじいてた記憶。

第7章 Docker タスク OpenShift Container Platform 3.11 | Red Hat Customer Portal

Use static analysis of user workloads (e.g.Kubernetes resources, Docker files)

11 Ways (Not) to Get Hacked | Kubernetes

Scan images for known vulnerabilities

Overview of Cloud Native Security | Kubernetes

Monitoring, Logging and Runtime Security 20%

Perform behavioral analytics of syscall process and file activities at the host and container level to detect malicious activities

falcoなどのツールであれば表題の検知ができそうです。 Auditing with Falco | Kubernetes

Using eBPF in Kubernetes | Kubernetes

Detect threats within physical infrastructure, apps, networks, data, users and workloads

(筆者の主観でピンとくる公式ドキュメントが見つけられず)

Detect all phases of attack regardless where it occurs and how it spreads

(筆者の主観でピンとくる公式ドキュメントが見つけられず)

Perform deep analytical investigation and identification of bad actors within environment

(筆者の主観でピンとくる公式ドキュメントが見つけられず)

Ensure immutability of containers at runtime

(筆者の主観でピンとくる公式ドキュメントが見つけられず)

Use Audit Logs to monitor access

Auditing | Kubernetes

所感

Overview of Cloud Native Security | Kubernetes

上記にあるように、4つのCを意識しておく必要はありそうです。 - Cloud/Co-Lo/Corporate Datacenter - Cluster - Container - Code

CKA/CKADは試験中に公式ドキュメントの閲覧が可能だったので事前に「ここだ」というところブックマークしておいたのですが、自分の知識だとCKSでがっちりはまるドキュメントは多くはない印象です。