stwater20
    • Create new note
    • Create a note from template
      • 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
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me 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
    • Save as template
    • 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 Create Help
Create Create new note Create a note from template
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
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me 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
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    # HITCON 2021 空降危機-雲端攻防的二三事 筆記 ## Speaker 奧義智慧 Boik Su、aka. Dange ## Outline * Introduction * Case Study * AWS: Identity Perimeter * Azure: Network Perimeter * GCP: Hosted Application ... * 藍隊工具 ## 雲端服務的利用是新的標準 * Shared Responsibility Model * Responsibility always retained by the customer * Responsibility varies by type * Responsibility transfers to cloud provider > Through 2025 , more than 99% of cloud breaches will have a root cause of preventalbe .... ### 雲端威脅 - CSA 的觀點 共11點 1. Data Breaches 2. Misconfiguration and Inadequate Change Control 3. Lack of Cloud Security ... ### Identity Perimeter * 身份與存取管理系統(IAM)過於複雜 * 平台預設權限過高 * CSA Ref * Data breaches * Insufficient identity, Credential, access and key management * account hijacking * limited cloud ... ### 雲端事件統計 #### Initial Access * Vaild Accounts 佔最多 * Trusted Relationshop * Phishing * Exploit Public-Facing Application * Drive-by Compromise #### Escalation/ Persistence IAM > EC2 > 2020 幾乎都在IAM,而且埋後門比較划算 #### Network Perimeter * 企業防禦邊界模糊化 * 雲地混合,信任關係 * CSA Ref: * Data Braches * Lack of Cloud Security Architecture and Strategy * Insufficient Identity ... #### Hosted Applications/Services * 複雜的應用程式設定 * 非原生雲端應用程式與雲端整合的問題(K8s) * CSA Ref: * Data Breaches * Misconfiguration * ... ## AWS Identity and Access Management * Identity * User * Group * Service Account * Permission * Owner * Editor * Reader * Resource * VM * Bucket * ... ### 三大平台IAM差異 * AWS * IAM Group * IAM Role * GCP * google group * google workspace domain * cloud identity domain * service account * Azure * ... ### Attack Mindset * Credentials Harvest #### Credentials Harvest * Internet-Facing Sensitive Data (goolge hacking) * Config Files on Disk * Control Files on Disk * Control Plane Interface * Codebase * Environmental Variables ### Cloud Matrix 對於 IAM的利用過於粗略 * Initial Access * Vaid Accounts * ... ### Cloud Matrix is big 方向的建議 ## IAM Attack Pattern Identity -> Permission -> Resource -> Permission -> Identity > S3 Resource Exposure / Sub-Domain Takeover > ... Credentials Harvest + LM hacker assumrole succeeded -> Cloud Platform 提升手法用PassRole 到 Lamda 至 Role 2 #### 修改自身 Permission * Shadow Admin * setDefaultPolicy to Role * Admin Access > 透過本身權限修改另一個權限提權 ### IPI * 導出別的使用者access key * ... #### Privilege Escalation * hacker access group ... ### ROI SSRF to metadata Service #### Sub-Domain Takeover + SSRF Normal Request -> VM Instance -> External Site ## Azure - Network Perimeter #### Private, Public and Hybrid Cloud ### 關鍵基礎設施 * Hybrid Identity for * Cross-realm application Access * Simplified account access and management ### Active Directory vs. Azure AD | Active Directory | Azure AD| | -------- | -------- | | LDAP |REST API's | > ... 太快寫不完 ### Password hash synchronization (PHS) ### Attack - DCSync * On-Prem 密碼砸受同不需要特定權限 * DS-Replication-Get-Changes * DS-Replication-Get-Changes-All * DCSync 攻擊的必備條件 ### Real Workd Case * Microsoft Security Advisory 4056318 Guidance for securing AD DS account used by Azure ... ### Pass-through authentication(PTA) * "Azure Agent" On-Prem * PKI (encrypt/decrypt) * LogonUserW API #### LogonUserW BOOL LogonUserW 輸入是明碼唷! #### Attack - 密碼竊聽 #### Attack - Azure Skeleton Key ### Federation (AD FS) 大部分企業會選得方案 #### Federation (AD FS) * 微軟跨雲端、地端的身份驗證機制 * 原生支援SAML 2.0 #### SAML 2.0 * 開放式聯合標準 #### Attack - Golden SAML * 攻擊者若能拿下AD FS hosts,that it can sign any SAML Response and 偽造 to any user #### Real World Case - Solorigate #### Reak World Case - FoggyWeb ### Best Practice 微軟說現在不推薦AD FS 應改用Azure AD ## GCP - Hosted Applications/Services ### Service Side Request Forgery Hacker use SSRF to Metadata Service if access Denied ### Root Cause * Oracle( Instance Metadata Service) 缺乏身份驗證 ### Kubernetes * Master(control Plane) * Worker(Node) ,Container Runtime, Pod ### Kuberneters on GCP * GCP GKE Service (GCP代理k8s) * GCP Compute Engine ### Instance Metadata Service ? 無法區分請求 ### Secret in Metadata Service * Kube-env * KUBELET_CERT * KUBELET_KEY > TLS bootstrapping ### Instance Meta data Service ? 透過上述方法讓node 可以擴展一個惡意的container ### Real World Case SSRF in Exchange leads to ROOT access in all instances ### how to prevnet in GCP * DEST: avoid pods get Boot.... ### Metadata concealment & Workload Identity ### Workload identity container auth 會向gcp IAM Service 要資料 Pod -> Daeminset ### Misconfig (Host Network ) -> Bypass Pod container to Metadata Service ### Shielded GKE nodes * Shielded VMs: use vTPM to authorize intergity of VM * prevent rootkit > 放棄治療 ### Google 沒提到的限制 但是我們發現的問題 如果tpm不小心給了太高的權限或把他mount到其他地方,那還是能被碰到meta data > config 出錯 ### Demo 取得key cert ls /var/lib/kubelet/pli kubelet-client.lock lubectl --certificate-authority ... ## Defense ### NIST CSF _ the five function * Identify * Rule * Scount Suite * SkyArk * Cloudsplaining * Prowler * Graph * Principal Mapper * CloudMapper * awspx * SAST for IaC * terrascan * checkov * Protect * MFA * fail2ban * IAM * Policy Sentry * IAM Access Analyzer * iamlive * Repokid * Detect * Falco * API Log * AWS CloudTrail * CloudTracker * Config * Security * Monkey * AWS Config * Resonse * SOAR * IR Tool * Recover * AWS Backup ### IAM attack Pattern & awspx * awspx 堪稱 aws 的 blood... ### 好文推薦 * Cloud Security Orienteering How to rapidly understand and secure a cloud environment ## Conclusion * Identity Perimeter * Network Perimeter * Hosted Applications/Services * 以NIST CSF為基準提供藍隊工具

    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