Skip to content

Honor AWS_ENDPOINT_URL_STS for web identity and fix STS endpoint for eusc - #126761

Merged
asya-ch merged 3 commits into
masterfrom
asya/sts-endpoint-override-web-identity
Oct 29, 2026
Merged

asya-ch merged 3 commits into
masterfrom
asya/sts-endpoint-override-web-identity

Conversation

@asya-ch

@asya-ch asya-ch commented Oct 19, 2026 •

Copy link
Copy Markdown
Collaborator

Related: ClickHouse/aws-sdk-cpp#42
Closes: #110699

Changelog category (leave one):

  • Improvement

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

Support the AWS_ENDPOINT_URL_STS environment variable for S3 web identity credentials, and use the .amazonaws.eu STS endpoint in eusc-* regions.


Workflow [PR]
Sync PR [sync-upstream/pr/126761]

Version info

  • Merged into: 26.11.1.884-master (included in 26.11 and later)

@clickhouse-gh

clickhouse-gh Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [6aba61c]

Summary: ✅


AI Review

Summary

The PR adds AWS_ENDPOINT_URL_STS support for S3 web identity credentials and updates the AWS SDK to derive .amazonaws.eu STS endpoints for eusc-* regions. Reviewing head 6aba61c7a5d164651c978bf98a3439a7100cff09 leaves two previously reported configuration concerns unresolved. Both were dismissed by the author and are retained below without further inline replies. No additional findings were identified.

Missing context / blind spots
  • ⚠️ The latest CI run is still in progress, and this checkout has no build directory. The new unit tests were inspected but were not executed locally; completed unit-test results would close runtime validation.
Findings

⚠️ Majors

  • Endpoint opt-outs must prevent sending web identity tokens to disabled endpoints. Credentials.cpp:800 [dismissed by author -- https://github.com/Honor AWS_ENDPOINT_URL_STS for web identity and fix STS endpoint for eusc #126761#discussion_r4317351470]. With AWS_ENDPOINT_URL_STS configured, either AWS_IGNORE_CONFIGURED_ENDPOINT_URLS=true or the active profile's ignore_configured_endpoint_urls=true should suppress the override under the AWS endpoint configuration contract. The direct environment read bypasses both checks, so an upgrade can start forwarding the token to an explicitly disabled destination. The decision to ignore the global AWS_ENDPOINT_URL does not address these independent opt-outs. Preserve both checks while retaining the STS-specific lookup, and add coverage for each opt-out.

  • HTTP STS overrides must use the HTTP proxy configuration. Credentials.cpp:803 [dismissed by author -- https://github.com/Honor AWS_ENDPOINT_URL_STS for web identity and fix STS endpoint for eusc #126761#discussion_r4317351474]. S3CredentialsProviderChain creates the configuration with the default https protocol; ClientFactory::createClientConfiguration captures that protocol's resolver in per_request_configuration. Assigning endpointOverride leaves this callback unchanged. Consequently, AWS_ENDPOINT_URL_STS=http://minio:9000 with http_proxy set and https_proxy unset sends STS traffic directly, failing credential acquisition where the HTTP proxy is required. The author's dismissal leaves this concrete routing failure unchanged. Resolve the endpoint before choosing proxy callbacks, or rebuild both proxy callbacks for its scheme, and cover different HTTP/HTTPS proxy settings.

Final Verdict

Status: ⚠️ Request changes. Honor the configured-endpoint opt-outs and select proxy callbacks from the resolved STS endpoint scheme, with focused regression coverage.

@clickhouse-gh clickhouse-gh Bot added pr-bugfix Pull request with bugfix, not backported by default submodule changed At least one submodule changed in this PR. comp-object-storage Object storage connectivity (S3/GCS/Azure) including credentials, retries, multipart, etc. labels Oct 19, 2026
Comment thread src/IO/S3/Credentials.cpp
aws_client_configuration.scheme = Aws::Http::Scheme::HTTPS;
aws_client_configuration.region = std::move(tmp_region);

if (auto sts_endpoint = Aws::Environment::GetEnv("AWS_ENDPOINT_URL_STS"); !sts_endpoint.empty())

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[P2] Preserve the configured-endpoint opt-out

With both AWS_ENDPOINT_URL_STS and AWS_IGNORE_CONFIGURED_ENDPOINT_URLS=true set, this code still forwards the web identity token to the custom endpoint. The same happens with ignore_configured_endpoint_urls=true in the active AWS profile. These opt-outs are checked by the bundled SDK's Aws::Config::EndpointResolver::EndpointSource, but reading the environment directly and assigning endpointOverride bypasses that resolver. An upgrade therefore starts sending tokens to an endpoint that the operator explicitly disabled. Please use the SDK resolver for STS, or preserve its opt-out semantics here, and cover the disabled-override cases. See the AWS endpoint configuration contract.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This doesn't seem necessary IMO. We want to bypass the resolver, actually, I'll leave a comment and add a test to explain why.

Comment thread src/IO/S3/Credentials.cpp
if (auto sts_endpoint = Aws::Environment::GetEnv("AWS_ENDPOINT_URL_STS"); !sts_endpoint.empty())
{
LOG_INFO(logger, "Using STS endpoint {} from AWS_ENDPOINT_URL_STS", sts_endpoint);
aws_client_configuration.endpointOverride = std::move(sts_endpoint);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[P2] Select the proxy resolver from the STS override scheme

An HTTP override still uses the HTTPS proxy configuration. S3CredentialsProviderChain constructs this configuration with the default https protocol, and ClientFactory::createClientConfiguration captures that protocol's proxy resolver in per_request_configuration. Changing endpointOverride here does not update the callback. For example, with AWS_ENDPOINT_URL_STS=http://minio:9000, http_proxy configured, and https_proxy unset, the STS request goes directly to MinIO instead of through the required HTTP proxy, so credential acquisition fails on networks that require that proxy. Resolve the endpoint before choosing the proxy resolver, or rebuild the proxy callbacks for its scheme, and add coverage with different HTTP/HTTPS proxy settings.

@asya-ch asya-ch Oct 19, 2026 •

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I don't think this is needed.

@clickhouse-gh clickhouse-gh Bot added pr-improvement Pull request with some product improvements and removed pr-bugfix Pull request with bugfix, not backported by default labels Oct 19, 2026
@clickhouse-gh

clickhouse-gh Bot commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

Build profile diff (arm_release)

Comparing 6aba61c7a with master edcf68499 (stripped binary size, per-symbol sizes and ThinLTO time; compile times per translation unit against the most recent warmup build that recompiled it).

✅ No significant changes.

Binary sizes

programs/clickhouse-stripped: smaller than the master baseline by the known offset between the two builds, so the difference is not shown. A delta that differs from the offset by more than 50% of it is shown, in either direction.

The official master build is compiled with -g and a pull request build is not, and XRay counts debug instructions towards its instrumentation threshold, so master instruments thousands of functions more and its binary is ~0.4% larger no matter what the pull request does.

Compile time of recompiled translation units

98 translation units recompiled, 803 s compile time in total, 98 of them have a recent master baseline.

Median compile-time ratio to the baselines is ×1.05 (machine-speed difference or a change affecting every TU); per-TU deltas below are relative to that ratio.
The matched translation units cost +12.2 s (+2%) in total before that adjustment.

Job report

@SmitaRKulkarni SmitaRKulkarni self-assigned this Oct 28, 2026

@SmitaRKulkarni SmitaRKulkarni left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@asya-ch
asya-ch added this pull request to the merge queue Oct 29, 2026
Merged via the queue into master with commit 30f76bd Oct 29, 2026
179 checks passed
@asya-ch
asya-ch deleted the asya/sts-endpoint-override-web-identity branch October 29, 2026 13:14
@robot-ch-test-poll3 robot-ch-test-poll3 added the pr-synced-to-cloud The PR is synced to the cloud repo label Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp-object-storage Object storage connectivity (S3/GCS/Azure) including credentials, retries, multipart, etc. pr-improvement Pull request with some product improvements pr-synced-to-cloud The PR is synced to the cloud repo submodule changed At least one submodule changed in this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

S3 disk web-identity credentials ignore AWS_ENDPOINT_URL_STS — AssumeRoleWithWebIdentity always calls AWS STS (breaks MinIO/Ceph/S3-compatible)

3 participants