Level 2 - Core Skills

SSL/TLS Offloading (SSL Insight 基礎)

憑證管理與 Template 配置實戰教學

講師引言

在現代網路中,超過 90% 的流量都是加密的 (HTTPS)。如果每一台網頁伺服器都要自己負責「解密」跟「加密」,這對 CPU 來說是非常繁重的負擔。今天我們要學會如何利用 A10 Thunder 作為「SSL 加速器」來釋放伺服器的效能,這也是構建安全架構的第一步。

一、核心概念 (Concept)

一句話定義

SSL Offloading (卸載) 是指將繁重的 SSL 加密與解密工作,從後端伺服器 (Real Server) 轉移到專用的應用交付控制器 (A10 ADC) 上處理。

生活化比喻:總裁的翻譯秘書

想像這是一場跨國會議 (HTTPS 連線)

  • 客戶 (Client) 講加密語言。
  • 總裁 (Server) 日理萬機,只想聽簡單的結論 (HTTP 明文),不想花時間查字典翻譯。
  • A10 (ADC) 就是專業翻譯秘書

秘書在門口先聽懂客戶的話 (解密),整理成簡單報告給總裁 (送往後端)。總裁回覆後,秘書再翻譯成加密語言給客戶。這樣總裁就能專心做決策,不用處理語言隔閡。

二、運作原理 (Mechanism)

技術細節:雙面代理 (Full Proxy)

A10 在 SSL Offloading 中扮演「中間人」的角色,這需要兩個關鍵的設定檔 (Templates):

1. Client-SSL Template (對外)

負責處理 Client 到 A10 之間的加密連線。

  • A10 扮演 Server 角色。
  • 必須匯入 Server Certificate (憑證) 與 Private Key (私鑰)。
  • 決定支援的 TLS 版本 (如 TLS 1.2/1.3) 與加密套件 (Cipher Suites)。

2. Server-SSL Template (對內)

負責處理 A10 到 Real Server 之間的連線。

  • A10 扮演 Client 角色。
  • 通常用於「Re-encryption (再加密)」場景,確保內網流量也是加密的 (Zero Trust 架構)。
  • 如果後端走 HTTP (Port 80),則不需要此設定。

憑證管理關鍵流程 (Certificate Management)

要在 A10 上啟用 SSL,必須先處理憑證。常見有兩種方式:

  • 方法 A
    Import (匯入現有憑證)

    如果你已經有 PFX (包含私鑰) 或 PEM 檔案,直接透過 GUI 或 CLI (`import ssl-cert`, `import ssl-key`) 匯入 A10。

  • 方法 B
    Generate CSR (產生憑證簽署請求)

    為了安全,私鑰最好直接在 A10 上產生。使用 `pki create csr` 指令生成 CSR,將 CSR 傳給憑證中心 (CA) 簽署,拿到憑證後再匯入。

三、架構視覺化 (Visuals)

圖 1:SSL Offloading 流量拓撲圖

flowchart LR Client("使用者 Client") FW["防火牆 Firewall"] A10["A10 Thunder ADC
SSL Termination"] subgraph TrustedZone ["Data Center (Trust Zone)"] direction LR RS1["Web Server 1
Port 80"] RS2["Web Server 2
Port 80"] end Client -- "HTTPS Encrypted
Port 443" --> FW FW --> A10 A10 -- "HTTP Clear Text
Port 80" --> RS1 A10 -- "HTTP Clear Text
Port 80" --> RS2 style A10 fill:#192f6a,stroke:#f26522,stroke-width:2px,color:white style Client fill:#f4f6f8,stroke:#333,stroke-width:2px style RS1 fill:#e2e8f0,stroke:#333 style RS2 fill:#e2e8f0,stroke:#333

說明:Client 到 A10 是加密的 (消耗 A10 CPU),A10 到 Server 是明文的 (減輕 Server 負擔)。

圖 2:SSL Handshake 處理流程 (Client-SSL)

sequenceDiagram participant C as Client participant A as A10 Thunder (VIP) participant S as Real Server Note over C, A: Phase 1: SSL Handshake (Client-SSL) C->>A: Client Hello (TLS 1.2/1.3) A->>C: Server Hello + Certificate (A10's Cert) C->>A: Key Exchange / Finished Note over C, A: Secure Tunnel Established C->>A: Encrypted HTTP Request (GET /) Note over A: Decryption (利用 Private Key) Note over A, S: Phase 2: Backend Connection A->>S: Plaintext HTTP Request (GET /) S-->>A: Plaintext HTTP Response Note over A: Encryption A-->>C: Encrypted HTTP Response

四、實務應用場景 (Use Case)

案例:大型電商網站的「SSL 集中化管理」

情境描述

某知名購物網站擁有 50 台網頁伺服器 (Web Servers)。每當 SSL 憑證過期時,IT 管理員需要登入每一台伺服器更新憑證,且每台伺服器的 OS (Linux, Windows) 可能不同,容易發生漏換導致服務中斷。

A10 解決方案

在 A10 上配置 Client-SSL Template 並綁定 VIP。後端 50 台伺服器僅需開啟 Port 80。

ACOS CLI 配置範例
! 1. 定義 SSL 模版 (匯入憑證與私鑰)
slb template client-ssl High-Security-SSL
cert www.shop.com.cert
key www.shop.com.key
! 2. 設定 Service Group (後端走 Port 80)
slb service-group SG-Web-Servers tcp
member RS-01 80
member RS-02 80
! 3. 設定 VIP (前端 443 綁定 SSL 模版)
slb virtual-server VIP-Shop 192.168.1.100
port 443 https
service-group SG-Web-Servers
template client-ssl High-Security-SSL

優點與缺點分析

✔ 優點 (Pros)
  • 管理輕鬆:憑證只需在 A10 上更新一次,所有伺服器立即生效。
  • 效能提升:A10 內建專屬 SSL 硬體晶片 (ASIC),處理速度遠快於一般伺服器 CPU。
  • 安全合規:可強制在 A10 上禁用不安全的加密協定 (如 TLS 1.0, SSLv3),不需逐台伺服器設定。
✘ 缺點 / 風險 (Cons)
  • 單點風險:所有私鑰 (Private Keys) 都集中在 A10,A10 的帳號權限管理變得極度重要。
  • 內網明文:A10 到 Server 之間若走 HTTP,需確保內網實體線路安全,否則有被側錄風險 (解法:開啟 Server-SSL 做 Re-encryption)。

五、隨堂測驗 (Quiz)