owned this note changed 5 years ago
Linked with GitHub

你的 EKS 安全嗎?由安全性角度切入探討 Kubernetes on AWS - 徐維澤

歡迎來到 Kubernetes Summit'20 共筆

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

共筆入口:https://hackmd.io/@k8ssummit/20
手機版請點選上方 按鈕展開議程列表。

從這開始

  • user太多還要一個一個加太麻煩 ==> 用IAM role取代IAM user

  • 避免使用service account token

    • 因為是long lived,很危險
  • service account 應該為 app 訂製,保持最小權限原則。

    • 使用IAM Role for Service Account(IRSA)
  • 避免用 root 執行 docker image,避免提權攻擊。

  • customize minimum image.

  • Don't put any secure in imagr

  • Don't put docker in docker

  • 限制掛在目錄路徑。

  • Pod Security Policy(PSP)

  • QoS 到底要不要設

    • 要,而且要是 default。
    • 不同的服務給予不同等級
  • Multi Tenancy

    • 隔離性要做好
    • Sole Tenant Nodes: 用node隔離
    • Hard multi tenancy: 分到不同cluster
    • 隔離性需求強的請放在不同 cluster
  • EKS Encryption in transit

    • service mesh 可以做傳輸加密。
    • 對外透過 ingress controller
  • k8s network policy

    • AWS 預設吃 node 的 security group,範圍過大,最好自己設。
    • 使用pod層級的security group (EEE)

Host security

  • 定期升級 node
  • node升級建議直接整組換掉
  • 要確認舊的 node 上沒有任何還在運行的 pod
  • node 放在 private subnet
  • 建議做pod login monitoring

monitoring

  • 開啟 audit log 並做異常警報。
    • 量很多,一直存會很貴,記得設定定期封存。
    • S3 lifecycle
  • prod 要有登入警示
  • Cloudtrail要開起來,監控IRSA

Incident response

  • 攻擊者會試圖抹去痕跡
  • 要設法留下紀錄
  • dump memory, log

Conclusion

  • 工作的電腦不要瀏覽奇怪的網站
  • saml2aws可以產生一次性的臨時certification
tags: k8ssummit20 k8s
Select a repo