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

Management API 預設會停用 TLS,而您透過這些 API 存取 Edge Management API 使用管理伺服器節點的 IP 位址和通訊埠 8080 來傳送 HTTP 要求。例如:

http://ms_IP:8080

另外,您也可以設定 Management API 的 TLS 存取權,以便在 表單:

https://ms_IP:8443

在這個範例中,您要將 TLS 存取權設為使用通訊埠 8443。不過,通訊埠號碼 以便將管理伺服器設定為使用其他通訊埠值。只有 您的防火牆允許流量通過指定的通訊埠。

如要確保傳入及傳出 Management API 的流量加密,請在 /opt/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

編輯/opt/apigee/customer/application/management-server.properties 檔案,控管與 Management API 之間的流量 TLS 使用情況。如果這個檔案不存在, 建立映像檔

如何設定 Management API 的 TLS 存取權:

  1. 產生含有傳輸層安全標準 (TLS) 憑證和私密金鑰的 KeyStore JKS 檔案。如要 請參閱為 Edge On Premises 設定 TLS/SSL
  2. 將 KeyStore JKS 檔案複製到 Management Server 節點上的目錄,例如 使用 /opt/apigee/customer/application
  3. 將 JKS 檔案的擁有權變更為「apigee」使用者:
    chown apigee:apigee keystore.jks

    其中 keystore.jks 是 KeyStore 檔案的名稱。

  4. 編輯「/opt/apigee/customer/application/management-server.properties」 設定下列屬性。如果該檔案不存在,請建立一個:
    conf_webserver_ssl.enabled=true
    # Leave conf_webserver_http.turn.off set to false
    # because many Edge internal calls use HTTP.
    conf_webserver_http.turn.off=false
    conf_webserver_ssl.port=8443
    conf_webserver_keystore.path=/opt/apigee/customer/application/keystore.jks
    # Enter the obfuscated keystore password below.
    conf_webserver_keystore.password=OBF:obfuscatedPassword

    其中 keyStore.jks 是您的 KeyStore 檔案,而 obfuscatedPassword 是您經過模糊處理的 KeyStore 密碼。詳情請見 為 Edge On Premises 設定 TLS/SSL 瞭解如何產生經過模糊處理的密碼。

  5. 使用下列指令重新啟動 Edge Management Server:
    /opt/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 後,編輯 /opt/apigee/customer/application/management-server.properties到 設定下列屬性:
    conf_webserver_http.turn.off=true
  3. 執行下列指令,重新啟動 Edge Management Server:
    /opt/apigee/apigee-service/bin/apigee-service edge-management-server restart 
  4. 編輯「/opt/apigee/customer/application/ui.properties」 為 Edge UI 設定下列屬性:
    conf_apigee_apigee.mgmt.baseurl="https://FQ_domain_name:port/v1"

    其中 FQ_domain_name 是您憑證的完整網域名稱 管理伺服器的位址,而 port 則是上述 conf_webserver_ssl.port

    如果 ui.properties 不存在,請建立一個。

  5. 僅適用於使用自行簽署的憑證 (不建議在正式環境中使用) 環境),請在設定上述管理 API 的 TLS 存取權時,將 下列屬性加入 ui.properties
    conf/application.conf+play.ws.ssl.loose.acceptAnyCertificate=true

    否則 Edge UI 會拒絕自行簽署的憑證。

  6. 執行下列指令,重新啟動 Edge UI:
    /opt/apigee/apigee-service/bin/apigee-service edge-ui restart

管理伺服器的 TLS 屬性

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

屬性 說明

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

KeyStore 檔案的路徑。

如果已啟用 TLS/SSL 功能,則必須啟用 (conf_webserver_ssl.enabled=true)。

conf_webserver_keystore.password=password

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

conf_webserver_cert.alias=alias

選用的 KeyStore 憑證別名

conf_webserver_keymanager.password=password

如果金鑰管理工具設有密碼,請在 格式如下:

OBF:xxxxxxxxxx

conf_webserver_trust.all=[false | true]

conf_webserver_trust.store.path=path

conf_webserver_trust.store.password=password

選取信任存放區的設定。決定是否要全部接受 TLS/SSL 憑證 (例如接受非標準類型)。預設值為 false。提供路徑 登入信任存放區,然後按照下列格式輸入經過模糊化的信任存放區密碼:

OBF:xxxxxxxxxx

conf_http_HTTPTransport.ssl.cipher.suites.blacklist=CIPHER_SUITE_1, CIPHER_SUITE_2

conf_http_HTTPTransport.ssl.cipher.suites.whitelist=

指明要納入或排除的任何加密套件。舉例來說,如果您在 發現加密中的漏洞 可以在這裡排除分隔多組加密 。

凡是透過黑名單移除的加密,其優先順序都會高於納入的加密 許可清單。

注意:根據預設,如未指定黑名單或許可清單,系統會透過加密機制進行比對 根據預設,系統會排除下列 Java 規則運算式。

^.*_(MD5|SHA|SHA1)$
^TLS_RSA_.*$
^SSL_.*$
^.*_NULL_.*$
^.*_anon_.*$

不過,如果您指定黑名單 這個篩選器將遭到覆寫,您必須個別將所有加密加入黑名單。

如需加密套件和密碼學架構的相關資訊,請參閱 JDK 8 適用的 Java Cryptography Architecture Oracle 供應商說明文件

conf_webserver_ssl.session.cache.size=

conf_webserver_ssl.session.timeout=

決定以下項目的整數:

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