如何在執行階段層級為 Cassandra 設定 TLS
Cassandra 可確保用戶端電腦與資料庫叢集之間,以及叢集內節點之間的通訊安全無虞。啟用加密功能可確保傳輸中的資料不會遭到入侵,並以安全方式傳輸。在 Apigee Hybrid 中,Cassandra 節點之間,以及用戶端與 Cassandra 節點之間的任何通訊,預設都會啟用 TLS。
關於 Cassandra 使用者驗證
混合式平台會使用 Cassandra 做為執行階段資料層資料的後端資料儲存庫。根據預設,用戶端與 Cassandra 的任何通訊都需要驗證。用戶端會使用三個使用者與 Cassandra 通訊。系統會為這些使用者提供預設密碼,您不必變更密碼。
這些使用者 (包括預設使用者) 說明如下:
- DML 使用者:用於用戶端通訊,可讀取及寫入 Cassandra 的資料 (KMS、KVM、Cache 和 Quota)。
- 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...