iT邦幫忙

2025 iThome 鐵人賽

DAY 3
0
Cloud Native

我在 CKS 考完只拿 47% 後痛定思痛決定好好準備內容系列 第 3

[Day3] 1-2. Use CIS benchmark to review the security configuration of Kubernetes components

  • 分享至 

  • xImage
  •  

Center for Internet Security(CIS) 基準是針對 25 個以上供應商產品系列的規範配置建議。它們代表了全球網路安全專家基於共識的努力,旨在幫助保護系統免受威脅。[1]

CIS benchmark 針對不同的 OS (Linux, Windows, MacOs) 以及對應的位置(Cloud, Mobile, Network, Desktop) 都有對應的說明文件
除了可以透過文件對照外,也可以透過工具CIS-CAT直接進行掃描,掃描後會提供對應的報告以及發現的問題該如何解決的建議。

目前會需求針對 Kubernetes 作說明,CIS benchmark 關於kubernetes的說明可以在這個網站中下載
https://www.cisecurity.org/benchmark/kubernetes

CIS benchmark主要會關注的是對於Control Plane 以及 Work Node的設定

Node 類型 關注的Service
Control Plane API, Controller Manager, Schedule, ETCD
Worke Node Kubelet, Kube-Proxy

上方提到的 CIS-CAT 的工具目前免費版僅能夠提供 Windows, Ubuntu, Google Chrome, Mac OS,若要掃描 Kubernetes 相關會需要額外使用pro版本。
因此會使用另外的免費開源軟體進行,該算體是由 Aqua Security 提供的 kube-bench[2]。

kube-bench 官方中有提到該服務會盡量貼齊 CIS benchmark,但是仍可能存在誤差。

另外 kube-bench 只會提供 Automated 項目進行檢驗,除外的項目會將其列出但是需要手動去檢驗。

[INFO] 1.3 Controller Manager
[WARN] 1.3.1 Ensure that the --terminated-pod-gc-threshold argument is set as appropriate (Manual)
[FAIL] 1.3.2 Ensure that the --profiling argument is set to false (Automated)
[PASS] 1.3.3 Ensure that the --use-service-account-credentials argument is set to true (Automated)
[PASS] 1.3.4 Ensure that the --service-account-private-key-file argument is set as appropriate (Automated)
[PASS] 1.3.5 Ensure that the --root-ca-file argument is set as appropriate (Automated)
[FAIL] 1.3.6 Ensure that the RotateKubeletServerCertificate argument is set to true (Automated)

例如 1.3.1 就會需要手動去確認是否正確

考試注意

  • 考試時會一樣請你進行kube-bench的掃描,並且按照說明修改內容,當修改kube-apiserver時會重新啟動會需要較長的等待時間。
  • 考試時可以善用 terminal 中的尋找功能查找需要修改的內容及條件

Ref
[1] https://www.cisecurity.org/cis-benchmarks
[2] https://github.com/aquasecurity/kube-bench


上一篇
[Day2] 1-1. Use Network security policies to restrict cluster level access
下一篇
[Day4] 1-3. Properly set up Ingress with TLS
系列文
我在 CKS 考完只拿 47% 後痛定思痛決定好好準備內容5
圖片
  熱門推薦
圖片
{{ item.channelVendor }} | {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言