為 Management API 設定傳輸層安全標準 (TLS)

Edge for Private Cloud 4.16.05 版

根據預設,Management API 會停用 TLS,您可以使用管理伺服器節點的 IP 位址和通訊埠 8080,透過 HTTP 存取 Edge Management API。例如:

http://ms_IP:8080

或者,您也可以設定 Management API 的 TLS 存取權,以便透過下列格式存取:

https://ms_IP:8443

在本範例中,您會將 TLS 存取權設為使用通訊埠 8443。不過,Edge 不需要該通訊埠編號,您可以將管理伺服器設為使用其他通訊埠值。唯一的要求是防火牆必須允許透過指定通訊埠傳輸流量。

如要確保往返管理 API 的流量加密,請在 /<install_dir>/apigee/customer/application/management-server.properties 檔案中進行設定。

除了 TLS 設定外,您也可以修改 management-server.properties 檔案,控管密碼驗證 (密碼長度和強度)。

確認 TLS 通訊埠已開啟

本節中的程序會將 TLS 設為使用管理伺服器上的通訊埠 8443。無論使用哪個通訊埠,都必須確保管理伺服器上的通訊埠已開啟。例如,您可以使用下列指令開啟:

$ iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 8443 -j ACCEPT --verbose 

設定 TLS

編輯 /<install_dir>/apigee/customer/application/management-server.properties 檔案,控制 Management API 往返流量的傳輸層安全標準:TLS 使用情形。如果這個檔案不存在,請建立檔案。

請按照下列程序,設定 Management API 的 TLS 存取權:

  1. 產生 KeyStore JKS 檔案,其中包含 TLS 憑證和私密金鑰。詳情請參閱「為 Edge On-Premises 設定 TLS/SSL」。
  2. 將 KeyStore JKS 檔案複製到管理伺服器節點上的目錄,例如 /tmp。
  3. 將 JKS 檔案的擁有權變更為 apigee:
    $ chown apigee:apigee keystore.jks

    其中 keystore.jks 是 KeyStore 檔案的名稱。
  4. 編輯 /<install_dir>/apigee/customer/application/management-server.properties,設定下列屬性。如果該檔案不存在,請建立檔案:
    conf_webserver_ssl.enabled=true
    # Set next to true if all communications should be over HTTPS.
    # Not recommended because many Edge internal calls use HTTP.
    conf_webserver_http.turn.off=false
    conf_webserver_ssl.port=8443
    conf_webserver_keystore.path=/tmp/keystore.jks
    # Enter the obfuscated keystore password below.
    conf_webserver_keystore.password=OBF:obfuscatedPassword
    conf_webserver_cert.alias=apigee-devtest


    其中 keyStore.jks 是您的 KeyStore 檔案,obfuscatedPassword 則是經過模糊處理的 KeyStore 密碼。如要瞭解如何產生模糊處理的密碼,請參閱「為 Edge On-Premises 設定 TLS/SSL」。
  5. 使用下列指令重新啟動 Edge Management Server:
    $ /<install_dir>/apigee/apigee-service/bin/apigee-service edge-management-server restart

Management API 現在支援透過 TLS 存取。

設定 Edge UI,使用 TLS 存取 Edge API

在上述程序中,Apigee 建議保留 conf_webserver_http.turn.off=false,以便 Edge UI 繼續透過 HTTP 發出 Edge API 呼叫。請按照下列程序設定 Edge UI,讓這些呼叫僅透過 HTTPS 進行:

  1. 按照上述方式,設定 Management API 的 TLS 存取權。
  2. 確認 TLS 適用於 Management API 後,請編輯 /<install_dir>/apigee/customer/application/management-server.properties,設定下列屬性:
    conf_webserver_http.turn.off=true
  3. 使用下列指令重新啟動 Edge Management Server:
    $ /<install_dir>/apigee/apigee-service/bin/apigee-service edge-management-server restart
  4. 編輯 /<install_dir>/apigee/customer/application/ui.properties,為 Edge UI 設定下列屬性。如果該檔案不存在,請建立該檔案:
    conf_apigee_apigee.mgmt.baseurl="https://MS_IP:8443/v1"

    其中 MS_IP 是管理伺服器的 IP 位址,通訊埠號碼則是上述 conf_webserver_ssl.port 指定的通訊埠。
  5. 只有在設定上述 Management API 的 TLS 存取權時,使用自行簽署憑證,才需要將下列屬性新增至 ui.properties:
    conf/application.conf+ws.acceptAnyCertificate=true

    否則,Edge UI 會拒絕自行簽署憑證。
  6. 使用下列指令重新啟動 Edge UI:
    $ /<install_dir>/apigee/apigee-service/bin/apigee-service edge-ui restart

管理伺服器的 TLS 屬性

下表列出您可以在 management-server.properties 中設定的所有 TLS/SSL 屬性:

資源

說明

conf_webserver_http.port=8080

預設值為 8080。

conf_webserver_ssl.enabled=false

啟用/停用 TLS/SSL。啟用 TLS/SSL (設為 true) 時,您也必須設定 ssl.port 和 keystore.path 屬性。

conf_webserver_http.turn.off=true

啟用/停用 http 和 https。如果只想使用 HTTPS,請將預設值保留為 true。

conf_webserver_ssl.port=8443

TLS/SSL 通訊埠。

啟用 TLS/SSL 時 (conf_webserver_ssl.enabled=true) 必須提供。

conf_webserver_keystore.path=<path>

金鑰儲存庫檔案的路徑。

啟用 TLS/SSL 時 (conf_webserver_ssl.enabled=true) 必須提供。

conf_webserver_keystore.password=

請使用經過模糊處理的密碼,格式如下:OBF:xxxxxxxxxx

conf_webserver_cert.alias=

選用的金鑰儲存庫憑證別名

conf_webserver_keymanager.password=

如果金鑰管理工具設有密碼,請以下列格式輸入經過模糊處理的密碼:OBF:xxxxxxxxxx

conf_webserver_trust.all= <false | true>

conf_webserver_trust.store.path=<path>

conf_webserver_trust.store.password=

設定信任存放區。決定是否要接受所有 TLS/SSL 憑證 (例如接受非標準類型)。預設值為 false。請提供信任存放區的路徑,並以下列格式輸入經過模糊處理的信任存放區密碼:OBF:xxxxxxxxxx

conf_webserver_exclude.cipher.suites=<CIPHER_SUITE_1 CIPHER_SUITE_2>

conf_webserver_include.cipher.suites=

指出要納入或排除的加密套件。舉例來說,如果您發現密碼有安全漏洞,可以在這裡排除。請以空格分隔多個加密。

如要瞭解加密套件和密碼編譯架構,請參閱:

http://docs.oracle.com/javase/8/docs/technotes/
guides/security/SunProviders.html#SunJSSE

conf_webserver_ssl.session.cache.size=

conf_webserver_ssl.session.timeout=

決定下列項目的整數:

  • TLS/SSL 工作階段快取大小 (以位元組為單位),用於儲存多個用戶端的工作階段資訊。
  • TLS/SSL 工作階段逾時前的持續時間 (以毫秒為單位)。