[2/2] Enforce encrypted Iceberg metadata integrity - #5186
Open
hkwi wants to merge 2 commits into
Open
Conversation
Pin encryption.key-id, including its absence, in trusted Polaris entity state. Enforce the pin across catalog updates, register and notification paths, and metadata loaded from storage while leaving unpinned legacy tables outside the invariant.
Store and verify a versioned canonical SHA-256 digest for protected encrypted table metadata. Define trusted admission and re-admission boundaries, reject unauthenticated encrypted notification updates, map integrity failures to non-retryable responses, and stop asynchronous cleanup without deleting storage when verification fails.
singhpk234
self-requested a review
July 30, 2026 06:13
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
TABLE_FULL_METADATA-authorized re-admission after key-ID validation.This implements the metadata-integrity alternative in Iceberg's catalog security requirements for deployments where plaintext
metadata.jsonis held in storage that must not be treated as authoritative. The digest construction follows Iceberg HiveCatalog: canonicalTableMetadataParserJSON, UTF-8 SHA-256, and Base64 storage outside the metadata file.Stack
This is 2/2 of a stacked change and depends on the key-ID pinning PR: #5185.
Both PRs target
mainbecause their head branches are in an external fork. The branch for this PR contains the first PR's commit followed by one metadata-integrity commit. Until the first PR lands, the incremental second-layer diff is:hkwi/polaris@upstream/enforce-immutable-encryption-key-id...upstream/enforce-encrypted-metadata-integrity
After the first PR is merged, this head branch will need to be updated against the resulting
mainhistory so that this PR contains only the metadata-integrity layer. This follow-up Git operation is required because the fork-only parent branch cannot be selected as the base of a PR inapache/polaris.Guarantee and compatibility boundary
Verification
./gradlew format compileAllTestHTTPResourceManagerinitialization path; all 28 suites report the sameParameterResolutionExceptioncaused by the NPE atTestHTTPResourceManager.java:190.Checklist
CHANGELOG.md(if needed)site/content/in-dev/unreleased(if needed): not needed for internal catalog invariants