設定傳輸層安全性協定

2024/1/21 |

這個文章說明如何為 CLEAR Engine、Web UI、CLI 設定傳輸層安全性協定。

在這個文章中,你將會學習如何:

  • 為 CLEAR Engine 設定傳輸層安全性協定。
  • 為 Web UI 設定傳輸層安全性協定。
  • 為 CLI 設定傳輸層安全性協定。

本文結束後,你將能夠為 CLEAR Engine、Web UI、CLI 設定傳輸層安全性協定。

為 CLEAR Engine 設定傳輸層安全性協定

CLEAR Engine 使用 Windows Communication Foundation (WCF),Web UI 和 CLI 亦使用與其溝通。CLEAR Engine 預設僅能透過命名管道端點存取,因此僅有同個主機上執行的處理程序能和它溝通。

要讓其他電腦能存取 CLEAR Engine,必需啟用 TCP 端點。CLEAR Engine 使用的預設 TCP 組態是不安全的。依照以下的步驟來為 TCP 端點啟用傳輸安全性 (TLS over TCP):

  1. 將 TCP 端點要使用的 X.509 憑證存放於系統層級的 Personal 憑證儲存庫。這個憑證可和 Web UI 使用的相同。
  2. 以系統管理員身分開啟 Windows PowerShell。
  3. 輸入以下命令來以預設的文字編輯器開啟 CLEAR Engine 設定檔案:

     (Get-ChildItem "C:\Program Files\Lucent Sky\CLEAR Engine\SkyAnalyzer.Engine.exe.config").FullName | Invoke-Item
    
  4. 找到 <system.serviceModel> 區塊中的 <behavior name=""> 標籤,並將以下內容插入到 </behavior> 結尾標籤之前:

     <serviceCredentials>  
         <!-- Replace CertificateThumbprint with the thumbprint of the X.509 certificate. -->
         <serviceCertificate findValue="CertificateThumbprint" x509FindType="FindByThumbprint" />
     </serviceCredentials>
    
  5. 找到 <system.serviceModel> 區塊中的 <binding name="DefaultTcpBinding"> 標籤,並將 <security> 置換為以下內容:

     <security mode="Transport">
         <transport clientCredentialType="None" />
     </security>
    
  6. 找到 <system.serviceModel> 區塊中的 <binding name="LargeReceivedMessageSizeTcpBinding"> 標籤,並將 <security> 置換為以下內容:

     <security mode="Transport">
         <transport clientCredentialType="None" />
     </security>
    
  7. 在 PowerShell 中輸入以下命令來重新啟動 CLEAR Engine 使變更生效:

     Stop-Service "CLEAR Engine"; Start-Service "CLEAR Engine"
    
  8. 若是 Lucent Sky AVM 叢集,在叢集中的每個節點重複以上步驟。

當在 CLEAR Engine 上啟用 TLS over TCP 後,使用 TCP 存取它的用戶端,例如安裝於不同伺服器上的 CLI 或 web UI,亦需要啟用傳輸安全性(TLS over TCP)。

為 Web UI 設定傳輸層安全性協定

當 Web UI 安裝完成後,它僅有一個 HTTP 繫結。增加 HTTPS 繫結可讓瀏覽器使用 HTTPS 存取 Web UI。依照以下步驟來增加 HTTPS 繫結:

  1. 將 TCP 端點要使用的 X.509 憑證存放於系統層級的 WebHosting 憑證儲存庫。
  2. 以系統管理員身分開啟 Windows PowerShell。
  3. 輸入以下命令來新增 IIS 網站繫結:

     # Replace CertificateThumbprint with the thumbprint of the X.509 certificate.
     $certificateThumbprint = "<CertificateThumbprint>"
     New-IISSiteBinding -Name "CLEAR Web" -BindingInformation "*:443:" -CertificateThumbPrint "$certificateThumbprint" -CertStoreLocation "Cert:\LocalMachine\WebHosting" -Protocol https
    
  4. 在 PowerShell 中輸入以下命令來重新啟動 CLEAR Engine 使變更生效:

     Stop-IISSite -Name "CLEAR Web"; Start-IISSite -Name "CLEAR Web"
    
  5. 若是 Lucent Sky AVM 叢集,在叢集中的每個節點重複以上步驟。

為 CLI 設定傳輸層安全性協定

CLI 預設的組態讓其能和安裝於同個主機上的 CLEAR Engine 實體溝通。要讓 CLI 使用安裝在另一個主機上的 CLEAR Engine 實體,必需啟用 TCP 端點。CLI 預設使用的 TCP 端點組態是不安全的。依照以下的步驟來為 TCP 端點啟用傳輸安全性 (TLS over TCP):

  1. 使用文字編輯器開啟 CLI 設定檔案 SkyAnalyzer.Interface.Console.exe.config,它和 CLI 的執行檔位於同一個目錄。
  2. 找到 <system.serviceModel> 區塊中的 <binding name="DefaultTcpBinding"> 標籤,並將 <security> 置換為以下內容:

     <security mode="Transport">
         <transport clientCredentialType="None" />
     </security>
    
  3. 找到 <system.serviceModel> 區塊中的 <binding name="LargeReceivedMessageSizeTcpBinding"> 標籤,並將 <security> 置換為以下內容:

     <security mode="Transport">
         <transport clientCredentialType="None" />
     </security>
    

這些步驟假設 CLI 已被設置來使用 TCP 端點而非命名管道端點。要深入了解為 CLI 啟用 TCP 端點,請參考 Lucent Sky 知識庫:
Lucent Sky AVM CLI 管理者指南