Repository navigation
Forward static S3 credentials for Unity DataLakeCatalog tables - #96910
Conversation
|
Workflow [PR], commit [adfb275] Summary: ✅
AI ReviewSummaryThis PR now does what it claims: for non- Final Verdict
|
|
Hi @kgeg401! Thanks for the contribution. Could you please update the PR description to follow the PR template? Specifically, it should include:
This helps us maintain accurate changelogs for our users. Thank you! |
10da76e to
84c948d
Compare
|
No code changes in this pass for #96910. The branch remains scoped to static credential forwarding and associated unit tests, with prior CI green. Please re-review/merge when maintainer bandwidth allows. |
|
@melvynator will review this PR. |
|
@melvynator Scope is unchanged, CI is green, and this is ready for your review when you have a cycle. |
|
@kgeg401 Did you test the PR against a real catalog? On AWS: |
|
is there any update on this bug fix? can we have it merged to master? |
|
From my testing the S3 credentials were not passed correctly. We need it as part of our E2E testing so we will fix it, but if you want to fix it please go ahead. |
When a user sets vended_credentials=false on a DataLakeCatalog database together with static credentials (aws_access_key_id / aws_secret_access_key), their intent is that the catalog should not be consulted for object-store credentials at all. However, the catalog's refresh callback was wired into every storage created from such a database, so a transient access error would silently trigger a vended-credentials fetch and overwrite the user's static credentials. As @melvynator reported on ClickHouse#96910, this caused a query to succeed against S3 even when the user supplied a deliberately wrong secret, masking misconfiguration. Drop the catalog refresh callback when vended_credentials=false, so the static credentials configured above remain the only credentials used. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
|
@melvynator I traced through the case you reported. The static credentials were being attached to the table engine arguments, but the catalog's I pushed commit Could you re-run your test against this commit when you get a chance? |
…-static-creds # Conflicts: # src/Databases/DataLake/DatabaseDataLake.cpp
…-static-creds # Conflicts: # .github/workflows/pull_request.yml
@alexey-milovidov I verified on Private PR with commit cherry-picked. I added explicit regression tests for scenario — aws_secret_access_key='WRONG_SECRET' + vended_credentials=false — on both dispatch paths:
Both pass: the SELECT fails with an S3 credential error rather than silently succeeding via the refresh callback. |
Workflow files in this branch were stale or had been deleted as a workaround for GitHub's workflow-scope check. Restoring them to match `master` so the PR diff no longer contains those unrelated changes.
|
Continued work on this PR:
No production code changes in this pass. |
The descriptions of `aws_access_key_id`, `aws_secret_access_key` and the `storage_aws_*` pair only mentioned the `Glue` catalog. Since this PR also forwards these settings as static S3 storage credentials for non-`Glue` `DataLakeCatalog` table reads when `vended_credentials = false`, the descriptions (which feed user-facing settings docs/help) were misleading. Update them to describe both uses and fix a stray trailing apostrophe in the secret-key descriptions. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
|
Hi @kgeg401 are you still working on this? |
|
Continued work on this PR:
The re-merge re-triggers public CI and the sync. The new unit tests are unchanged by the merge ( |
|
@zlareb1 Yes, still engaged here. Alexey has continued the PR and the latest public CI run is green with review threads resolved. From my side, the remaining blocker I see is the private |
…-static-creds # Conflicts: # src/Parsers/tests/gtest_Parser.cpp
|
Updated the branch against current The PR is now mergeable again on GitHub; public CI and sync are rerunning on the refreshed head. |
LLVM Coverage Report
Changed lines: Changed C/C++ lines covered: 137/153 (89.54%) · Uncovered code |
|
@zlareb1 please run e2e tests with Unity catalog to validate the fix |
The DataLake credential-bearing settings (catalog_credential, auth_header, aws_access_key_id, aws_secret_access_key and their legacy storage_* aliases) are declared in DataLakeStorageSettings.h, which is shared by the DataLakeCatalog database engine AND the Iceberg*/Paimon*/DeltaLake* table engines via registerStorageObjectStorage. ASTSetQuery::formatImpl only redacted them when create_engine_name equalled 'DataLakeCatalog', so SHOW CREATE TABLE, system.tables.engine_full and the formatForLogging path printed the secret values verbatim for the table engines. Any user with the relevant SELECT/SHOW grant could read them. hasSecretParts() already treats these settings as secret without an engine gate, so the format path was inconsistent with it. Redact DataLake::SETTINGS_TO_HIDE settings regardless of engine name, matching hasSecretParts(). Extend the regression test to cover the IcebergLocal table engine in addition to the DataLakeCatalog database engine. Also adds storage_catalog_credential and storage_auth_header to the redaction map (storage_aws_* were already added on master by ClickHouse#96910). Co-Authored-By: Claude Opus 4.8 <[email protected]>
…static-creds Forward static S3 credentials for Unity DataLakeCatalog tables
The DataLake credential-bearing settings (catalog_credential, auth_header, aws_access_key_id, aws_secret_access_key and their legacy storage_* aliases) are declared in DataLakeStorageSettings.h, which is shared by the DataLakeCatalog database engine AND the Iceberg*/Paimon*/DeltaLake* table engines via registerStorageObjectStorage. ASTSetQuery::formatImpl only redacted them when create_engine_name equalled 'DataLakeCatalog', so SHOW CREATE TABLE, system.tables.engine_full and the formatForLogging path printed the secret values verbatim for the table engines. Any user with the relevant SELECT/SHOW grant could read them. hasSecretParts() already treats these settings as secret without an engine gate, so the format path was inconsistent with it. Redact DataLake::SETTINGS_TO_HIDE settings regardless of engine name, matching hasSecretParts(). Extend the regression test to cover the IcebergLocal table engine in addition to the DataLakeCatalog database engine. Also adds storage_catalog_credential and storage_auth_header to the redaction map (storage_aws_* were already added on master by ClickHouse#96910). Co-Authored-By: Claude Opus 4.8 <[email protected]>
Forward static S3-compatible credentials from
DataLakeCatalogdatabase settings into Unity catalog table reads when catalog-vended credentials are disabled (vended_credentials = false).Before this change, if
vended_credentials = false, Unity table reads backed by S3-compatible storage (including GCS HMAC viastorage.googleapis.com) could run without credentials even when the database settings providedaws_access_key_idandaws_secret_access_key. As a result, Delta kernel object-store requests could be anonymous and fail with HTTP 403.Closes: #96798
What changed
DataLake::tryGetStaticStorageCredentials:src/Databases/DataLake/StaticStorageCredentials.hsrc/Databases/DataLake/StaticStorageCredentials.cppDatabaseDataLake::tryGetTableImpl:vended_credentials = falsewith no static credentials), suppress the catalog-vended refresh callback so it cannot silently override the user-supplied credentials.Glueprovider-chain refresh (STS/role/instance-profile/web-identity) remains active because it is orthogonal to credential vending.storage_aws_*settings support, without mixing the two namespaces, and masking for them inSETTINGS_TO_HIDE.src/Databases/DataLake/tests/gtest_static_storage_credentials.cpp) coveringaws_*settings,storage_aws_*compatibility settings, precedence when both are set, missing-key handling, and non-S3 storage handling.tests/integration/test_database_iceberg_lakekeeper_catalog) asserting that withvended_credentials = falseand only static credentials in database settings, a read with the correct static pair succeeds and a read with a wrong static pair fails (rather than being silently rescued by a leaked catalog refresh callback).Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Forward static S3 credentials to Unity
DataLakeCatalogtable reads whenvended_credentialsis disabled, preventing anonymous object-storage access failures.Documentation entry for user-facing changes
Version info
26.7.1.543(included in26.7and later)