owned this note changed 9 months ago
Linked with GitHub

CI/CD 管道與基礎建設的分層縱深安全防禦 - 林智偉(Wayne Lin)

歡迎來到 DevOpsDay Taipei 2024 共筆

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/@DevOpsDay/2024
手機版請點選上方 按鈕展開議程列表。

議程介紹

填寫議程滿意度問卷|回饋建言給辛苦的講者

共筆從這開始

CI/CD Pipeline 團隊組合: RD & Infra & Security

  • Security: 風險怎麼訂。損失的衡量概念。
  • 風險衡量概念可以使用人數損失來判斷。
  • 當團隊變大時,就會回去思考基礎建設的問題。

Governance

Image Not Showing Possible Reasons
  • The image was uploaded to a note which you don't have access to
  • The note which the image was originally uploaded to has been deleted
Learn More →

  1. No Governance
  2. Infra Governance
    • 由 infra 幫忙輔助檢查
  3. Strict Governance
    • 安全團隊審核

No Governance >> Infra >> Strict Governance

為什麼今天要講 Security ?

10 real-world stories of how we’ve compromised CI/CD pipelines

最容易被攻擊的兩個點:身分驗證、CICD pipline

CI/CD pipeline 握有的權限幾乎是機器本身, 破pipeline等於破機器

  • infra CI/CD pipeline != App CI/CD pipeline
    • infra 怕 ransomeware
    • App software 依賴的套件此時此刻是安全的?

Attacks

  • inject script : 在你使用的工具執行碼加入一行指令
  • CI/CD bypass : 高權限帳號,例如本機帳號、breaking account,這些帳號的 credential 或 access token 被盜走/竊聽
  • 程式依賴的 library 引入時有 typo 導致引入錯誤的惡意 library

Reference :

  • BeyondCorp: (Zero Trust的架構說明paper) / token 使用來源短時間距離變更太遠
  • NIST Special Publication:
  • NIST Cybersecurity Framework(CSF): 2.0

Layers

source code , pipeline runtime, network

Before Deep Dive

S__4554787

  • 我有安全 VS 我很安全
  • 保護誰?
  • CI/CD 被挾持後,緊急處理方式
  • 一定要做演練,真的狀況來七手八腳
  • 防禦很重要、偵測更重要

Overall Framework

Overall Framework

  • 五個項目:identify, protect, detect, respond, recover (上面好像都講到了)
  • 兩個層面:Solutions, Capabilities

error budget: do overall 我還有 develop time? SRE 提供很重要概念,要有錯誤處裡預算

General Recommendations: Authentication & Access

  1. Enforce MFA
  2. Implement ZeroTrust

Hardening IaC CI/CD

S__4554789

  1. Network: 現在存取的 url,ZTNA ,確認身分才能接上線 (L7 traffic inspection)
  2. Source Control: 建議 OAuth/OIDC 去做認證
  3. Runtime: 跑在容器。因為它可以建立獨立環境不被干擾。 我可以開resource 但不能存取resource。
  4. Pipeline: 把 CI/CD pipeline 獨立出來,也要把環境把跑在容器裡,做到隔離性
  5. Internal Dependencies: : 當有人沒有按照 policy 做時,要能夠偵測出來
  6. External Dependencies

Hardening Application CI/CD

很像 Hardening IaC CI/CD

Open Source More Securely

檢測使用的套件,及其相依套件是否安全

  • Co-Found Open SSF
  • Open Source Insights
  • dataset

https://deps.dev/

SLSA and SBOM

軟體產製過程的控制、 BOM表,製造業把零件一一列表出詳細信息的表叫 BON表。S = software。

tags: DevOpsDays Taipei 2024

共筆聊天室:

特別調查安全小組的來賓,嗯,沒人。
有人的地方就是 ~ 江湖
ZeroTrust 去年很紅, 今年好像不紅了

Select a repo