Gokul Kolady has posted comments on this change. ( 
https://gerrit.cloudera.org/25247 )

Change subject: IMPALA-14331: Support proxy for JWKS URL download
......................................................................


Patch Set 4:

(6 comments)

https://gerrit.cloudera.org/#/c/25247/4/be/src/kudu/util/curl_util.cc
File be/src/kudu/util/curl_util.cc:

https://gerrit.cloudera.org/#/c/25247/4/be/src/kudu/util/curl_util.cc@293
PS4, Line 293:     if (!proxy_ca_certificates_.empty()) {
The proxy CA and pinned-key options are only applied when proxy_ is non-empty. 
A caller that does set_noproxy("") plus set_proxy_pinned_public_key(...) and 
relies on https_proxy from the environment gets the pin silently dropped — a 
security control failing open. No caller does this today, but for API 
consistency these should be set whenever they're non-empty, the way noproxy_ 
now is.


https://gerrit.cloudera.org/#/c/25247/4/be/src/util/jwt-util.h
File be/src/util/jwt-util.h:

https://gerrit.cloudera.org/#/c/25247/4/be/src/util/jwt-util.h@70
PS4, Line 70:   Status Init(const std::string& jwks_uri, bool 
jwks_verify_server_certificate,
This signature (and JWKSMgr::Init / JWKSSnapshot::LoadKeysFromUrl) is now 9 
positional parameters with three defaulted std::strings at the tail. 
jwks_proxy_ca_certificate and jwks_proxy_pinned_public_key are adjacent 
same-typed strings — swapping them at a call site compiles and appears to work 
until a cert check misbehaves. The defaults exist only for test convenience; 
the one production caller (oauth-servers-manager.cc:53) already holds an 
OAuthServerConfig. Passing that struct, or a small JwksDownloadOptions subset, 
would collapse all three signatures and remove the default arguments. Worth 
doing now rather than after a fourth proxy field lands.


https://gerrit.cloudera.org/#/c/25247/4/be/src/util/jwt-util.cc
File be/src/util/jwt-util.cc:

https://gerrit.cloudera.org/#/c/25247/4/be/src/util/jwt-util.cc@883
PS4, Line 883:         new_jwks->LoadKeysFromUrl(jwks_uri_, 
jwks_verify_server_certificate_,
The commit message states the proxy is used "for the periodic JWKS refresh", 
but currently nothing tests that path. This would be cheap to cover in 
jwt-util-test with jwks_update_frequency_secs = 1 and waiting for a second 
entry in FakeHttpProxy::request_lines().


https://gerrit.cloudera.org/#/c/25247/4/be/src/util/oauth-server-config.cc
File be/src/util/oauth-server-config.cc:

https://gerrit.cloudera.org/#/c/25247/4/be/src/util/oauth-server-config.cc@64
PS4, Line 64:     "defaults to caCertFilePath (an empty value uses the default 
CA bundle). It must "
The flag text says an empty jwksProxyCaCertFilePath "uses the default CA 
bundle", but that isn't what happens when --trusted_certificate_file is set. In 
curl_util.cc, the verify_peer_ branch sets CURLOPT_PROXY_CAINFO from 
FLAGS_trusted_certificate_file and the proxy_ca_certificates_ override below it 
is skipped when empty — so an empty value means "the Kudu flag's bundle", not 
the system bundle. 
test_jwks_url_through_https_proxy_with_empty_proxy_ca_cert_fails would also 
behave differently in a deployment with that flag set. We should either reword 
the flag description or document the interaction.


https://gerrit.cloudera.org/#/c/25247/4/tests/custom_cluster/test_shell_oauth_servers_auth.py
File tests/custom_cluster/test_shell_oauth_servers_auth.py:

https://gerrit.cloudera.org/#/c/25247/4/tests/custom_cluster/test_shell_oauth_servers_auth.py@66
PS4, Line 66: SERVER_CERT_PUBLIC_KEY_PIN = 
'sha256//y7E6Qo4FannXJEqZ8kQhNub3tjcyjJRNs3xLmeRE5gk='
This pin is hard-coded against the current be/src/testutil/server-cert.pem. A 
future regen with a fresh key breaks 
test_jwks_url_through_https_proxy_with_pinned_public_key with an opaque 
"impalad failed to start", and nothing in certificates-info.txt records the 
dependency. We should compute the pin from SERVER_CERT at test time (hashlib 
over the DER public key, or a one-shot openssl subprocess) and keep the comment 
above as documentation.


https://gerrit.cloudera.org/#/c/25247/4/tests/util/proxy_servers.py
File tests/util/proxy_servers.py:

https://gerrit.cloudera.org/#/c/25247/4/tests/util/proxy_servers.py@157
PS4, Line 157:         method, target, version = request_line.split(' ', 2)
This raises ValueError: not enough values to unpack when request_line is empty, 
which happens in the wrong-pin test: the TLS handshake completes server-side 
and curl then aborts on the pin check without ever sending a request, so 
readline() returns b''. ThreadingTCPServer.handle_error dumps a traceback to 
stderr for each of those tests. The assertions still pass, but it's avoidable 
noise — we could add an early if not request_line: return after line 150.



--
To view, visit https://gerrit.cloudera.org/25247
To unsubscribe, visit https://gerrit.cloudera.org/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I6741b8e107f707d3fcc0a9e15ac01b5769191924
Gerrit-Change-Number: 25247
Gerrit-PatchSet: 4
Gerrit-Owner: Anubhav Jindal <[email protected]>
Gerrit-Reviewer: Alexey Serbin <[email protected]>
Gerrit-Reviewer: Anubhav Jindal <[email protected]>
Gerrit-Reviewer: Gokul Kolady <[email protected]>
Gerrit-Reviewer: Impala Public Jenkins <[email protected]>
Gerrit-Reviewer: Jason Fehr <[email protected]>
Gerrit-Reviewer: Yida Wu <[email protected]>
Gerrit-Comment-Date: Tue, 17 Nov 2026 18:06:56 +0000
Gerrit-HasComments: Yes

Reply via email to