Repository navigation
Make delta-kernel follow the session restriction on Azure server credentials - #112637
Conversation
|
would also unblock my usecase, please consider merging |
|
@SmitaRKulkarni Like to check this PR? |
|
Workflow [PR], commit [7c9ff00] Summary: ✅
AI ReviewSummaryThe PR makes the Azure delta-kernel helper read live connection parameters and checks each session before returning Delta Lake metadata or creating read/write operations. It also documents workload identity and adds direct metadata-entrypoint tests. The earlier coverage finding is addressed. One previously reported credential-selection bypass remains; no new inline findings were identified. Findings❌ Blockers
Tests
Missing context / blind spots
Final VerdictStatus: ❌ Block. Close the remaining implicit-authentication bypass with regression coverage, or link a concrete tracked follow-up for the explicitly deferred pre-existing issue before treating the security contract as complete. |
|
@SmitaRKulkarni hello I see the PR / Stress test to be flaky on the master itself is it a review blocker ? |
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Object file sizes13 object files changed (-29.34 KiB total), 0 added.
716 more object files are built by the master warmup baseline only (it builds every object-file target, a pull request build only Compile time of recompiled translation units1465 translation units recompiled, 744 s compile time in total, 1465 of them have a recent master baseline. |
|
Documented the Azure workload-identity surface on the Delta Lake pages:
Azure |
|
@SmitaRKulkarni I addressed your comments. Also the Clickhouse gh pointed out the docs so I updated that too. Please let me know i should instead open a seperate |
Co-Authored-By: Claude Fable 5 <[email protected]>
The SDK credential does not expose the IDs back, so keep them on ConnectionParams and prefer them over the environment in the builder. Co-Authored-By: Claude Fable 5 <[email protected]>
Co-Authored-By: Claude Fable 5 <[email protected]>
Covers the persistence of the IDs on ConnectionParams, not just the builder plumbing. Co-Authored-By: Claude Fable 5 <[email protected]>
Previously only plain-HTTP endpoints were forwarded; for sovereign clouds or custom domains the object_store builder fell back to the default public host derived from the account name. Applies to all auth branches, not only workload identity. Co-Authored-By: Claude Fable 5 <[email protected]>
Co-Authored-By: Claude Fable 5 <[email protected]>
|
@SmitaRKulkarni heads-up on a scope change: #128445 (removing the legacy Delta reader) added workload identity to the delta-kernel Azure path on master, so I merged master and took its implementation of What this PR still changes on top of master: |
|
@omar12eladawy : |
…ernel-azure-workload-identity
The fingerprint reads forbid_implicit_credentials, which every session overwrites in applyNewSettings, so a concurrent opted-in session could let a restricted one reuse a cached engine. Check the querying session itself at the top of each DeltaLakeMetadataDeltaKernel entrypoint that has a context (inside the try in totalRows / totalBytes), without the shared flag, via checkSessionMayUseServerIdentityIgnoringSharedFlag. Keep the fingerprint for the opposite direction and drop the initOrUpdateSnapshot calls in getSnapshotStats / initOrUpdateSchemaIfChanged. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
@SmitaRKulkarni agreed, done in d7e23a1 (after merging master): added It's called at the top of every Kept the fingerprint, dropped the |
The integration tests are refused earlier, when applyNewSettings rebuilds the client, so they pass without the entrypoint checks. Call each DeltaLakeMetadataDeltaKernel entrypoint directly with a restricted session while forbid_implicit_credentials is false, as a concurrent opted-in session leaves it: each throws ACCESS_DENIED, and totalRows / totalBytes return no value after logging the refusal. An opted-in session and a disk pass the check. Co-Authored-By: Claude Opus 5.5 <[email protected]>
After a restart the table loads with the shared restriction flag already set, so applyNewSettings does not rebuild the client for a restricted session and the metadata checks are the only guard. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
@omar12eladawy : Can we update the changelog to As this is not an issue for deltaLakeAzure. |
|
@SmitaRKulkarni updated the changelog entry, thanks for the review! |
|
@omar12eladawy : Looks like the test fails are related. Please add |
…ernel-azure-workload-identity # Conflicts: # src/Storages/ObjectStorage/DataLakes/DeltaLake/KernelHelper.cpp
restart_clickhouse needs stay_alive=True. Also return the results of the entrypoints from the gtest lambdas, as master marks them [[nodiscard]]. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ernel-azure-workload-identity # Conflicts: # src/Storages/ObjectStorage/DataLakes/DeltaLake/KernelHelper.cpp
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ernel-azure-workload-identity
…ernel-azure-workload-identity
|
@SmitaRKulkarni All addressed and merged master for the tests |
|
📊 Cloud Performance Report ✅ AI verdict: no significant changes detected. K_source=4 K_base=11 flagged=0/65 clickbench🟢 No significant changes tpch_adapted_1_official🟢 No significant changes Debug info
|
Since #128445,
DeltaLakeAzure/deltaLakeAzureread through delta-kernel with Azure workload identity (extra_credentials(client_id = ..., tenant_id = ...),use_workload_identity). Since #120343, a SQL-defined Azure storage that uses the server's own identity follows theallow_server_credentials_in_user_queriesrestriction of each accessing session. The delta-kernel path did not:AzureKernelHelperkept a copy of the connection params taken when the table metadata was created, so a restricted session could forward the server's identity to delta-kernel. It now reads the livegetAzureBlobStorageConnectionParams()increateBuilder, asS3KernelHelperdoes.TableSnapshotcaches built kernel engines and rebuilds them only when the credentials fingerprint changes, which was always empty for Azure. The fingerprint now covers the session restriction, so for a restricted session a cached engine is rebuilt and refused withACCESS_DENIED.getSnapshotStatsand the schema getters returned cached values without that check, so withdelta_lake_snapshot_versionpinned a restricted session could getcount()or the schema of a snapshot an opted-in session had cached. They now check first.Also:
connection_stringtogether withclient_id/tenant_idis rejected withBAD_ARGUMENTSinstead of being accepted.DeltaLakeAzure,deltaLakeAzure,deltaLakeAzureCluster,azureBlobStorageandazureBlobStorageCluster, including the session opt-in; the Azure DeltaLake examples useDeltaLakeAzure.Tests:
test_azure_workload_identitygetsDeltaLakeAzurecases on a second node with a plain-HTTP mock that serves a minimal Delta log: after an opted-in read, a restricted session is refused without a token or storage request, also for a pinnedcount()served from cached stats. Unit tests cover non-default and private-link hosts, explicit IDs surviving reattach, andconnection_stringwithextra_credentials.Related: #113267 (resolved by #128445), #120343
Changelog category (leave one):
Changelog entry:
DeltaLakeAzurewith the server's own Azure identity (workload or managed identity) now follows theallow_server_credentials_in_user_queriesrestriction of each querying session in the delta-kernel path, including for cached snapshots.Workflow [PR]
Sync PR [sync-upstream/pr/112637]
Version info
26.12.1.50-master(included in26.12and later)