Skip to content

Commit 8bbf071

Browse files
authored
Require TLS on the StarRocks operator's connection to FE (#6652)
* feat(starrocks): require TLS on the operator's connection to FE Operator 1.11.7 added --fe-ssl-mode (StarRocks/starrocks-kubernetes-operator#787) and defaults it to PREFERRED, which falls back to plaintext whenever the FE stops advertising SSL. QA and Production FEs carry a keystore, so those operators now run REQUIRED. CI's FE has no keystore and stays PREFERRED. ssl_force_secure_transport stays off: ol-analytics-api's aiomysql pool connects without TLS and would be refused. The stack comments now say that instead of pointing at the operator, which no longer blocks it. Claude-Session: https://claude.ai/code/session_016sFknxDrTqhEdxCTuLEMt7 * doc(starrocks): name unchecked TLS clients and Vault's TLS param Claude-Session: https://claude.ai/code/session_016sFknxDrTqhEdxCTuLEMt7
1 parent d76b519 commit 8bbf071

7 files changed

Lines changed: 32 additions & 13 deletions

File tree

‎src/ol_infrastructure/applications/starrocks/Pulumi.lakehouse.Production.yaml‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,11 @@ config:
5454
memory_limit: 16Gi
5555
starrocks:enable_data_lake_integration: "true"
5656
starrocks:ssl_enabled: "true"
57-
# ssl_force_secure_transport is intentionally false: the StarRocks operator
58-
# (chart 1.11.4) does not support TLS for its internal FE MySQL connections.
59-
# Re-enable once operator PR #732 merges and the chart version is bumped.
60-
# External clients (Vault, Superset) already use --ssl / tls=skip-verify.
57+
# ssl_force_secure_transport stays false until every client uses TLS. The
58+
# operator does (feSslMode REQUIRED in substructure/aws/eks), as do Vault,
59+
# Superset, Dagster and dbt. ol-analytics-api's aiomysql pool connects
60+
# without ssl and would be refused. Unchecked: OpenMetadata ingestion and the
61+
# mysql CLI the FE entrypoint uses to register followers and observers.
6162
starrocks:ssl_force_secure_transport: "false"
6263
starrocks:ssl_keystore_password:
6364
secure: v1:h7Hv+CSf6Hhk1mVg:Il+DfHH3nUPLk+SZFSQJwOfwt7h+Ses5dBlUYi3byc59bMaVNFVXsoaft1T9+g8cTLhPcGRazE8=

‎src/ol_infrastructure/applications/starrocks/Pulumi.lakehouse.QA.yaml‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,11 @@ config:
5353
memory_limit: 6Gi
5454
starrocks:enable_data_lake_integration: "true"
5555
starrocks:ssl_enabled: "true"
56-
# ssl_force_secure_transport is intentionally false: the StarRocks operator
57-
# (chart 1.11.4) does not support TLS for its internal FE MySQL connections.
58-
# Re-enable once operator PR #732 merges and the chart version is bumped.
59-
# External clients (Vault, Superset) already use --ssl / tls=skip-verify.
56+
# ssl_force_secure_transport stays false until every client uses TLS. The
57+
# operator does (feSslMode REQUIRED in substructure/aws/eks), as do Vault,
58+
# Superset, Dagster and dbt. ol-analytics-api's aiomysql pool connects
59+
# without ssl and would be refused. Unchecked: OpenMetadata ingestion and the
60+
# mysql CLI the FE entrypoint uses to register followers and observers.
6061
starrocks:ssl_force_secure_transport: "false"
6162
starrocks:ssl_keystore_password:
6263
secure: v1:UCHYHsGETfCN/DnL:ubV+0rJePAFL4JupZ65N/Utf+ZMdzFy0lGS4OEDyqfSZfnZ587k6AvMOITqITKHhmxuApncP0wM=

‎src/ol_infrastructure/applications/starrocks/__main__.py‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -435,11 +435,10 @@ def _starrocks_pod_anti_affinity(component: str, *, required: bool) -> dict[str,
435435
# Requires StarRocks >= 3.4.1. When enabled:
436436
# - cert-manager adds a PKCS12 keystore to the TLS secret.
437437
# - FE pods mount the secret and configure fe.conf with the keystore path/password.
438-
# - Set ssl_force_secure_transport=true only after updating all clients (e.g. Vault
439-
# JDBC URL) to use useSSL=true, as it rejects plain-text connections.
440-
# Note: once PR #732 in starrocks-kubernetes-operator merges, CN pods will additionally
441-
# need cnEnvVars FE_TLS_MODE=skip-verify (or preferred) for the operator's internal
442-
# CN→FE MySQL connection to use TLS.
438+
# - Set ssl_force_secure_transport=true only after every client uses TLS, as it
439+
# rejects plain-text connections (Vault's connection URL uses tls=skip-verify).
440+
# The operator's own connection to FE is covered by its feSslMode chart value
441+
# (starrocks:operator_fe_ssl_mode in substructure/aws/eks), not by anything here.
443442
ssl_enabled = starrocks_config.get_bool("ssl_enabled") or False
444443
ssl_force_secure_transport = (
445444
starrocks_config.get_bool("ssl_force_secure_transport") or False

‎src/ol_infrastructure/substructure/aws/eks/Pulumi.data.CI.yaml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ config:
66
environment:business_unit: data
77
environment:target_vpc: data_vpc
88
starrocks:enable_operator: true
9+
starrocks:operator_fe_ssl_mode: PREFERRED

‎src/ol_infrastructure/substructure/aws/eks/Pulumi.data.Production.yaml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ config:
66
environment:business_unit: data
77
environment:target_vpc: data_vpc
88
starrocks:enable_operator: true
9+
starrocks:operator_fe_ssl_mode: REQUIRED

‎src/ol_infrastructure/substructure/aws/eks/Pulumi.data.QA.yaml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ config:
66
environment:business_unit: data
77
environment:target_vpc: data_vpc
88
starrocks:enable_operator: true
9+
starrocks:operator_fe_ssl_mode: REQUIRED

‎src/ol_infrastructure/substructure/aws/eks/starrocks.py‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,13 @@
4242
"/deploy/starrocks.com_starrocksclusters.yaml"
4343
)
4444

45+
# How the operator's own MySQL connection to FE negotiates TLS (--fe-ssl-mode).
46+
# REQUIRED wherever the lakehouse FE has a keystore, so the operator can never
47+
# fall back to plaintext; PREFERRED where it has none. The operator rejects
48+
# VERIFY_CA and VERIFY_IDENTITY at startup because it never verifies the FE
49+
# certificate.
50+
FE_SSL_MODES = frozenset({"DISABLED", "PREFERRED", "REQUIRED"})
51+
4552

4653
def _fetch_starrocks_crd() -> list[dict[str, Any]]:
4754
"""Fetch the StarRocksCluster CRD manifest for the pinned chart version.
@@ -91,6 +98,13 @@ def setup_starrocks(
9198
starrocks_config = Config("starrocks")
9299
if not starrocks_config.get_bool("enable_operator"):
93100
return
101+
fe_ssl_mode = starrocks_config.require("operator_fe_ssl_mode")
102+
if fe_ssl_mode not in FE_SSL_MODES:
103+
msg = (
104+
f"starrocks:operator_fe_ssl_mode must be one of {sorted(FE_SSL_MODES)},"
105+
f" got {fe_ssl_mode!r}"
106+
)
107+
raise ValueError(msg)
94108

95109
starrocks_namespace = "starrocks"
96110
cluster_stack.require_output("namespaces").apply(
@@ -198,6 +212,7 @@ def setup_starrocks(
198212
"enabled": True,
199213
"imagePullPolicy": "IfNotPresent",
200214
"replicaCount": 1,
215+
"feSslMode": fe_ssl_mode,
201216
# The operator's controller-runtime cache is cluster-wide by
202217
# default, so its memory tracks total pods in the cluster
203218
# rather than anything about StarRocks. data-production

0 commit comments

Comments
 (0)