DevOpsDay
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Write
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Versions and GitHub Sync Note Insights Sharing URL Help
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Write
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       owned this note    owned this note      
    Published Linked with GitHub
    1
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    # 如何保護好你的CI/CD管道安全性 - 高于凱(HackerCat) {%hackmd @DevOpsDay/BymyqYaeo %} > 各家講者出來分享自己的經驗多少都有些公司內規和公關要求的限制,有些不方便分享的地方(例如:不要張貼簡報截圖)還請大家多多包涵喔(不然就更多人不敢出來分享了) > [name=DevOpsDays Taipei 2022] > F 場爆滿,看來大家都很想要保護好 CI/CD 管道 > [name=Mark_Mew] 作者資訊 [Facebook](https://www.facebook.com/hackercat1215) & [Twitter](https://twitter.com/hackercat1215) @hackercat1215 [blog](https://hackercat.org/burp-suite-tutorial/web-pentesting-burp-suite-total-tutorial) What is CI/CD Pipeline DevOps x CI/CD x Automation - 持續整合 CI (Continuous Integration) - 持續部屬 CD (Continuous Deployment) - 持續交付 CD (Continuous Delivery) > 感覺講者很緊張 > [name=Mark_Mew] Benefit of CI/CD - 降低風險及缺陷 - 提升開發效率 - 提升可見性 - 頻繁交付產品 - 即時的回饋 - 協作及溝通 Pipeline 重點在於開發的效率 而 CI/CD 的重點在於保護產品的安全性、完整性 而講者本身是資訊安全背景出生的 更因如此所以我們更應該注重 CI/CD Pipeline 的安全性 Why Need Protect CI/CD 為何要保護 pipeline * serice * SCM * ci server * secrets * credentials * token * sensitive data * product - app - website - image 由於 pipeline 會接觸到 production,所以需要重視 pipeline 資安議題 security testing in cicd * source -> build -> **test** -> deploy -> monitor Pre-Commit -> SAST(靜態檢測) -> SCA -> DAST -> IAST -> Image Scan -> WAF -> Monitoring Secruity testing in CI/CD * pre-commit * SAST (靜態檢測) * 像是 SonarQube * SCA (組成分析) * DAST (動態檢測) * IAST * Image Scan * WAF * Monitoring (Secure 整個 CICD) Security CI/CD ※Case Study * SCM * Malicious Code Injection * build * supply chain Attacks * Test * Deploy * QA * dev * credential leakage * Prod CI/CD Related Service Misconfiguration > Codecov 供應鏈攻擊看起來好酷 > [name=Mark_Mew] What risk in CI/CD 參考網址 https://www.cidersecurity.io/top-10-cicd-security-risks/ Top 10 CI/CD Security Risks * (CICD-SEC-1) Insufficient Flow Control Mechanisms * 流程控制機制不足 * CICD-SEC-2: Inadequate Identity and Access Management * CICD-SEC-3: Dependency Chain Abuse * CICD-SEC-4: Poisoned Pipeline Execution (PPE) * CICD-SEC-5: Insufficient PBAC (Pipeline-Based Access Controls) * CICD-SEC-6: Insufficient Credential Hygiene * CICD-SEC-7: Insecure System Configuration * CICD-SEC-8: Ungoverned Usage of 3rd Party Services * CICD-SEC-9: Improper Artifact Integrity Validation * CICD-SEC-10: Insufficient Logging and Visibility https://github.com/rung/threat-matrix-cicd * Threat Matrix For CI/CD pipeline * 源自於 MITRE ATT & CK-like ※ 從攻擊者的角度去描寫,企業應該要注意到的威脅框架 ※ 威脅框架提供一個標準化參考指標,紅隊可以知道怎進行攻擊,藍隊可以知道怎麼進行防禦 > 講者的內容還蠻有料的,不過好像還是很緊張? > [name=Mark_Mew] > 應該真的很緊張但滿滿的乾貨 > [name=Jason Chung] 會入侵 CICD 有可能是環境沒有進行隔離 基於實務和學界經驗 提供更方便直觀的角度提供八個指標 也涵蓋剛剛網站提出的項目 - 身分識別及驗證 - 存取控制 - 信任來源及完整性檢查 - 加密 - 秘密管理 - 已知漏洞 - 合規與安全基準 - 監控與日誌 https://digital.ai/devops-tools-periodic-table # 八個指標 ## 已知漏洞 找出已知漏洞,並修復已知漏洞 ## 身分識別及驗證 - 注意沒有驗證或是弱密碼的問題 - 移除離職員工 - **避免共用帳戶** - 會造成資安事件發生時不好追查,也不好管理 ## 存取控制 - 網路 - Network segmentation - Network Restriction - Limit egress connection via Proxy or IP Restriction - 大家都只注意到誰可以連進來,但是忽略了誰可以連出去 - 授權 - 大家都想做但是都做不好的 **最小權限** - 流程控制 ## 信任來源及完整性檢查 ※ 選擇商譽良好的 ## 秘密管理 通常是用在佈署 用一個專門的 Secrets management 是很有幫助的 HashiCorp 的 Vault 就是這樣的工具,今天也有擺攤大家記得去 ## 加密 不只是 CI/CD 上的專利 其實在資料庫、SCM、JIRA 也都需要注意 ``` 在內網用 http 好像就不安全 有自信一點,把好像拿掉 在內網用 http 就不安全 By 講者 ``` ## 合規與安全基準 **CIS Benchmarks** & Hardening ## 日誌及監控 近年來可見性也開始逐漸被大家重視 除了收攏 Log 以外,也需要去 Monitor 不然駭客都打進來多久了 也都沒在看 ###### tags: `DevOpsDays Taipei 2022`

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully