Skip to content

Conversation

@felicity3786
Copy link
Contributor

Description

Today, Trino Gateway’s health monitors authenticate to backend clusters using either:

Authorization: Basic header (username/password), or X-Trino-User header (when no password is configured)

This creates operational burdens for deployments that must rotate or manage shared credentials, and it exposes unnecessary authentication material in gateway configs.
This PR introduces optional mTLS-based authentication for health checks, allowing deployments to rely solely on client certificates when connecting to backend JMX or metrics endpoints.

backendState.monitorMtlsEnabled: true/false
When monitorMtlsEnabled=true, the health monitors switch to certificate-based auth and no longer send any identity headers. Startup validation for TLS required configuration is also added.
If monitorMtlsEnabled is false (default), existing behavior is unchanged, provides the backward compatibility.

Test

Build passed.
Tested with local gateway the health check is working as expected.

Additional context and related issues

NA

Release notes

( ) This is not user-visible or is docs only, and no release notes are required.
( ) Release notes are required, with the following suggested text:

* Fix some things.

@cla-bot cla-bot bot added the cla-signed label Dec 12, 2025
Comment on lines +145 to +146
MONITOR_HTTP_CLIENT_TRUST_STORE_PATH,
MONITOR_HTTP_CLIENT_TRUST_STORE_PASSWORD
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A user could skip setting truststore. Airlift would fallback to some system default truststore.

}
else {
identityHeader = new Header("X-Trino-User", backendStateConfiguration.getUsername());
identityHeader = null;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use Optional instead of null.

Comment on lines +85 to +89
private static final String MONITOR_HTTP_CLIENT_KEY_STORE_PATH = "monitor.http-client.key-store-path";
private static final String MONITOR_HTTP_CLIENT_KEY_STORE_PASSWORD = "monitor.http-client.key-store-password";
private static final String MONITOR_HTTP_CLIENT_TRUST_STORE_PATH = "monitor.http-client.trust-store-path";
private static final String MONITOR_HTTP_CLIENT_TRUST_STORE_PASSWORD = "monitor.http-client.trust-store-password";

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually I was thinking of something like this, WDYT?

Suggested change
private static final String MONITOR_HTTP_CLIENT_KEY_STORE_PATH = "monitor.http-client.key-store-path";
private static final String MONITOR_HTTP_CLIENT_KEY_STORE_PASSWORD = "monitor.http-client.key-store-password";
private static final String MONITOR_HTTP_CLIENT_TRUST_STORE_PATH = "monitor.http-client.trust-store-path";
private static final String MONITOR_HTTP_CLIENT_TRUST_STORE_PASSWORD = "monitor.http-client.trust-store-password";
private static final List<String> REQUIRED_MONITOR_MTLS_KEYS = List.of(
"monitor.http-client.key-store-path",
"monitor.http-client.key-store-password",
"monitor.http-client.trust-store-path",
"monitor.http-client.trust-store-password");

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

3 participants