為 Cassandra 設定 TLS

如何在執行階段平面中為 Cassandra 設定 TLS

Cassandra 可在用戶端電腦與資料庫叢集之間,以及叢集內的節點之間提供安全的通訊。啟用加密功能可確保傳輸中的資料不會遭到入侵,並安全傳輸。在 Apigee hybrid 中,系統預設會為 Cassandra 節點之間,以及用戶端與 Cassandra 節點之間的所有通訊啟用 TLS。

關於 Cassandra 使用者驗證

混合平台會使用 Cassandra 做為執行階段平面資料的後端資料儲存庫。根據預設,任何與 Cassandra 的用戶端通訊都需要驗證。用戶端與 Cassandra 通訊時會使用三個使用者。系統會為這些使用者提供預設密碼,您不必變更。

這些使用者 (包括預設使用者) 的說明如下:

  • DML 使用者:用於用戶端通訊,可讀取及寫入 Cassandra 的資料 (KMS、KVM、快取和配額)。
  • DDL 使用者:MART 用於任何資料定義工作,例如建立、更新和刪除鍵空間。
  • 管理員使用者:用於在 Cassandra 叢集中執行的任何管理活動。
  • 預設 Cassandra 使用者:啟用驗證功能並將使用者名稱設為 cassandra 時,Cassandra 會建立預設使用者。

變更預設密碼

Apigee Hybrid 會為 Cassandra 使用者提供預設密碼。如要變更預設使用者密碼,請在 overrides.yaml 檔案中執行這項操作。新增下列設定,視需要變更預設密碼 (「iloveapis123」),然後將變更套用至叢集。

所有使用者名稱都必須使用小寫字母。

cassandra:
   auth:
     default:  ## the password for the new default user (static username: cassandra)
       password: "iloveapis123"
     admin: ## the password for the admin user (static username: admin_user)
       password: "iloveapis123"
     ddl: ## the password for the DDL User (static username: ddl_user)
       password: "iloveapis123"
     dml: ## the password for the DML User (static username: dml_user)
       password: "iloveapis123"

注意事項:

  • 不支援憑證授權單位 (CA) 輪替。
  • 系統不支援使用密碼產生的伺服器憑證。

查看 Cassandra 記錄

請在 Cassandra 啟動後立即檢查記錄。下方記錄顯示 Cassandra 用戶端連線已加密。

kubectl logs apigee-cassandra-2 -n apigee -f

INFO  00:44:36 Starting listening for CQL clients on /10.0.2.12:9042 (encrypted)...
INFO  00:44:36 Binding thrift service to /10.0.2.12:9160
INFO  00:44:36 enabling encrypted thrift connections between client and server
INFO  00:44:36 Listening for thrift clients...