Upgrade to Pro — share decks privately, control downloads, hide ads and more …

API與Kubernetes世界的零信任安全

Sponsored · Your Podcast. Everywhere. Effortlessly. Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.

 API與Kubernetes世界的零信任安全

Avatar for marschen2007

marschen2007

May 16, 2023
Tweet

More Decks by marschen2007

Other Decks in Technology

Transcript

  1. © 2022 F5 2 零信任模型 zero trust requires an “assume

    breach” mentality 假設攻擊者已在內網 始終驗證 verify 永不信任 持續監控
  2. © 2022 F5 4 CONFIDENTIAL 零信任存取架構 IDaaS 用戶通過本地 (AAA) 或

    IDaaS 進行身份驗證 3 驗證並持續監視設備狀態 和完整性。 根據組織策略,設備狀態 和/或完整性的任何更改 都會導致訪問許可權授予 的更改。 2 允許經過身份驗證的流量通過。 用戶標識將傳遞給應用。 標識是聯合的,但訪問許可權 僅在具有最低特權訪問許可權 的每個應用請求的基礎上授予。 如果使用者請求訪問其他應用, 則會複製驗證和整個過程。 6 Azure Active Directory 使用者請求應用訪問,代理攔 截。 1 利用第三方安全解決方案的 API(透過 API 連 接器)收集其他上下文和屬性。 4 Third-party APIs 應用基於身份和上下文的策略,以及基於角色 的訪問控制 (RBAC) 和基於屬性的訪問控制 (ABAC)。 根據組織策略,用戶標識、上下文、角色或屬 性的任何更改都會導致訪問許可權授予發生變 化。 5
  3. © 2022 F5 5 只有“正確”的用戶才能在“正確”的時間、“正確”的設 備、“正確”的配置和“正確”的地點訪問“正確”的應用 • 是“正確”的用戶嗎? • 應用對時間或日期敏感嗎?

    • 此時用戶是否有許可權訪問 app ? • 是“正確的”設備嗎? • 設備安全嗎? • 在整個應用會話期間,它是 否滿足並堅持安全基線? • 是否存在無法訪問應用的 位置? • 應用安全嗎? • 應用敏感嗎? • 訪問應用的網路安全嗎? • 使用者是否擁有該應 用的存取權限? • 還有其他存取控制或限制 嗎? 存取相關的方法在於試圖阻止違規行為的發生
  4. © 2022 F5 8 API的類型 • 任何人都可以免費使用。 Public APIs •

    從外部連接的授權用戶端。 External APIs • 可供選定和授權的外部開發人員或 API 消費 者使用。 Partner APIs • 在企業內使用,以連接企業內的系統和數據。 Internal APIs
  5. © 2022 F5 10 API 安全不是 API 管理 • Versioning

    • Publishing • Schemas/definition • Onboarding and documentation • Schema Validation • Protocol Conformance • Protection Against Vulnerabilities • Fraud prevention • DDoS & Bot Mitigation • Access Management • Authentication, authorization • Rate limiting / Thresholding • Monitoring and Dashboards
  6. © 2022 F5 11 OWASP API Top 10 Broken Object

    Level Authorization Broken User Authentication Excessive Data Exposure Lack of Resource & Rate Limiting Broken Function Level Authorization Mass Assignment Security Misconfiguration Injection Improper Assets Management Insufficient Logging & Monitoring OWASP API Top 10 Access Control 存取控制 Network Security 網路安全 Runtime Protection 即時防護 5 1 4
  7. © 2022 F5 12 API 安全性的三大要素 Access Control • 管理

    API 端點的身份驗證和授權 Network Security • 提供安全網路通訊 (mTLS) • 在網路層防護不需要的流量(DDoS、速率 限制) App Security • 緩解常見的軟體漏洞 • 使用機器人緩解技術防止 API 濫用。
  8. © 2022 F5 13 攻擊者與防禦者(典範轉移) vs Human Human vs Bots

    (Automated) Human vs Bots (AI/ML Attackers) Machines (AI/ML Defenders) vs Bots (Automated) Machines (AI/ML Defenders) 使用機器人執行 API 濫用(Sneaker Bots, ATO, 3rd Party Payment APIs, Content Scaping)
  9. © 2022 F5 14 隨時隨地保護應用程式和 API Securing Apps & APIs

    Everywhere 您需要為混合、多雲制定API安全思維 NGINX BIG-IP Distributed Cloud Services
  10. © 2022 F5 16 5 Levels of the API Security

    Model Gartner’s API 安全模型 Level 0 Level 1 Level 2 Level 3 Level 4 Level 5 Predictive Security Proactive Security No Security Reactive Security No Security Understand the importance of the ‘API Security’ API G/W Traffic Management Basic Authentication OAuth Access Control Compliance Runtime Protection API Discovery Behavioral Detection Level 4: “There is active monitoring and proactive intervention ensuing compliance with the defined standards.” Level 5: “Organizations are transitioning their security and traffic management capabilities from proactive to predictive.”
  11. © 2022 F5 17 持續 API 安全生命週期的 6 個關鍵階段 API

    Discovery API Inventory API Governance API Protection API Development API Testing 安全程式碼 API 安全威脅與風險 自動化安全測試 識別所有公開的 API 了解您擁有哪些 API 安全合規與治理 主動監控 即時檢測與預防
  12. © 2022 F5 18 Gartner and API Security Vendors Frame

    of API Security API 安全生命週期 Dev Shift & Protect Right Shift Left
  13. © 2022 F5 19 Reactive Security Proactive Security Predictive Security

    API安全成熟度模型 at Runtime Runtime Threat Protection Access Control AI Enabled Shift & Protect Right Behavioral App Security
  14. © 2022 F5 20 Recommended API Security Improved Model API

    安全成熟度模型 Micr o API G/W WAF Load Balancer WAAP • Shadow API discovery • Real-time blocking • Bot protection • DDoS prevention Outer API G/W • OAuth-enabled • Advanced Access Control • API G/W functions • OAuth Identity Server • OAuth token management • Identity-based Zero-trust • OAuth-enabled • Advanced Access Control • E-W Traffic Protection • Predictive Security Solution • Using AI/ML to detect suspicious behaviors Proactive API Security Solutions Proactive API Security Solutions Predictive API Security Solutions
  15. © 2022 F5 22 惡意軟體防護“Detection & Response” 方法 Malware matters

    only in this phase. 560,000 new malwares per day. • 每天有超過 500K 的新惡意軟體。 • 在「初始入侵」階段幾乎不可能阻止所有新的惡意軟體. • 惡意軟體感染筆記型電腦並不意味著立即“數據洩露”’. • Detection & Response是 惡意軟體防護策略的關鍵. A data leak happens here. Source: Mandiant Attack Lifecycle
  16. © 2022 F5 23 為什麼 API 是攻擊者的主要目標? AV WAF NG

    F/W NG IPS 現有安全解決方案旨在查找惡意Payload 但 API 攻擊通常沒有惡意或可疑的Payload 現有安全解決方案無法檢測 API 攻擊, 例如 BOLA
  17. © 2022 F5 24 API 安全需要新方法 Client Server Request Data

    Response Data Vulnerable API Server 資訊洩露 • 即時預防是 API 安全的關鍵 • 持續改進是保護 API 的策略 • 無 API 安全保護意味著立即的資訊洩露風險 在 API安全領域,“Detection & Response” 效果有限
  18. © 2022 F5 25 -No effective BLOCKING -It can NOT

    stop 1st victim case -High potential FPs (Gartner) API logs Attacker James BOLA Attack Authorization header: access_token, GET /f5api/v1/userinfo/users?id=1001 IP or URL blocking thru Firewall?? It’s not helpful to stop the BOLA attack!! 獨立API安全方案
  19. © 2022 F5 26 Defense-in-Depth for APIs Client (Mobile app)

    Client (Web browser) API Endpoints User 邊界防禦 • DDoS Protection • Rate-limiting • Bot Defense 網路防禦 • SSL Decryption • Intrusion Prevention • Firewall Monitoring 應用防禦 • WAAP • Anomaly Detection • Shadow API Discovery 資訊與存取防禦 • Modern Authentication • Advanced Access Control • Sensitive Data Masking 策略與流程管理 • Risk Management • Audit and Monitoring
  20. © 2022 F5 27 安全分散式部署模型 App & Network Security Layer

    (WAAP) Access Control Layer Cloud Architect Persona API AppDev Persona NetSecOps Persona DevOps Platform Persona E/W APIs N/S APIs API Sec Real-Time API
  21. © 2022 F5 30 Shadow Shadow APIs & 解決方案 OWASP

    API9:2019 – Improper Assets Management Discovered Inventory (Documented) API Inventory Analyse Traffic Discover Unknown Endpoints Mitigate Threat Export & Analyse Update Inventory Threat mitigation techniques • Allow/Deny request • Rate Limits • Detect and block Malicious Users (Predictive Security) • Detect and block Advanced Bots (Predictive Security)
  22. © 2022 F5 31 Identification of APIs – internal/external including

    shadow APIs API Inventory Analyse Traffic Discover Unknown Endpoints Mitigate Threat Export & Analyse Update Inventory
  23. © 2022 F5 32 API Endpoint Discovery 發現 • 自動學習API

    surface • 使用 AI/ML,構建模型以對 API 行 為進行基線和跟蹤 API 行為 • 對於每個 API 分支,會以錯誤、延 遲和請求指標構建一個模型 • 檢測異常值和影子 API • 匯出swagger以改進 API 定義 •
  24. © 2022 F5 33 Behavioral Analysis 行為分析 API Endpoints •

    監控和基線 API 行為 • 輕鬆識別異常(例如,請求速率、 延遲、回應大小等的峰值) • 識別 API 通信中的任何 PII
  25. © 2022 F5 34 驗證 API Authentication • 發現和查看所有 API

    端點的身份驗 證狀態、詳細資訊和風險評分 • 輕鬆創建保護規則 (e.g. Blocking, rate limiting etc.)
  26. © 2022 F5 37 CONFIDENTIAL 如果你是駭客從哪裡下手? ETCD controller manager scheduler

    API Server kubelet kube-proxy kubelet kube-proxy POD APP POD APP dashboard kubectl git 公有雲 / DC 代碼倉庫 容器鏡像 製品庫 CI/CD IaaS 控制平面 憑證 存儲 控制台API 管理 應用流量 CI/CD管道 三個入口 ◆ 集群管理員的管理入口 ◆ 正面突破的應用流量入口 ◆ 有漏洞的程式碼/供應鏈研發入口
  27. © 2022 F5 38 如何保護Kubernetes中的應用? 認證和授權 WAAP pod pod po

    d po d pod pod po d po d pod pod pod pod Applications pod NGINX IC pod External Services NGINX IC 外部 內部 實施K8S集群入口安全
  28. © 2022 F5 39 全面的容器雲應用服務 KUBERNETES應用流量與安全防護 Kubernetes 系統平台:部署多集群應用 用戶 GSLB:F5

    DNS 統一功能變數名稱發佈 多中心/多集群智能調度 1 F5保障管理平面高可用性與安全 2 3 Ingress 服務 4 TCP/UDP 服務 5 更強的安全能力 可視化能力
  29. © 2022 F5 40 Zero Trust Security for Kubernetes Apps

    with NGINX • Policy decision/enforcement point (PDP/PEP) • Authentication • Authorization • Access control • Dynamic policy • Encryption • Auditing Identity-based security
  30. © 2022 F5 41 F5 NGINX Connectivity Stack for Kubernetes

    Enterprise-class Secure end-to-end Infrastructure-agnostic (Kubernetes-native)
  31. © 2022 F5 42 CONFIDENTIAL ▪zero trust requires an “assume

    breach” mentality ▪假設攻擊者已在內網 ▪存取相關的方法在於試圖阻止違規行為的發生 ▪應用與API級別的零信任則側重最大限度地減少持續違規行為的影響 ▪在 API安全領域,“Detection & Response” 失效 ▪Defense-in-Depth for APIs ▪Multi-Layer API 安全平臺 : WAAP 小結