-
Notifications
You must be signed in to change notification settings - Fork 509
Fix /v1/config disclosing catalog properties without CATALOG_READ_PROPERTIES #5246
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -30,6 +30,7 @@ | |
| import static org.apache.polaris.core.entity.PolarisPrivilege.CATALOG_MANAGE_CONTENT; | ||
| import static org.apache.polaris.core.entity.PolarisPrivilege.CATALOG_MANAGE_GRANTS_ON_SECURABLE; | ||
| import static org.apache.polaris.core.entity.PolarisPrivilege.CATALOG_MANAGE_METADATA; | ||
| import static org.apache.polaris.core.entity.PolarisPrivilege.CATALOG_READ_CONFIG; | ||
| import static org.apache.polaris.core.entity.PolarisPrivilege.CATALOG_READ_PROPERTIES; | ||
| import static org.apache.polaris.core.entity.PolarisPrivilege.CATALOG_ROLE_CREATE; | ||
| import static org.apache.polaris.core.entity.PolarisPrivilege.CATALOG_ROLE_DROP; | ||
|
|
@@ -496,6 +497,42 @@ public class PolarisAuthorizerImpl implements PolarisAuthorizer { | |
| CATALOG_READ_PROPERTIES, | ||
| CATALOG_WRITE_PROPERTIES, | ||
| SERVICE_MANAGE_ACCESS)); | ||
| // CATALOG_READ_CONFIG gates client bootstrap via the Iceberg REST /v1/config endpoint, so it | ||
| // is subsumed by every privilege that is exercised through that client: the catalog-level | ||
| // read/manage privileges and all catalog-content privileges. Note the check still evaluates | ||
| // grants on the catalog path, so content privileges must be granted at catalog level (or | ||
| // above) to subsume; grants scoped to a single namespace or table are not visible to the | ||
| // catalog-level check. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The logic is fine from my POV, but it looks like a breaking change (in cases where grants are specific too individual tables). Let's reflect that in the change log.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Noted in the upgrade notes (table/ns-scoped grants don't pass the catalog-path check once enforcement is on). Flag defaults false so it's not a day-one break... |
||
| SUPER_PRIVILEGES.putAll( | ||
| CATALOG_READ_CONFIG, | ||
| List.of( | ||
| CATALOG_FULL_METADATA, | ||
| CATALOG_MANAGE_CONTENT, | ||
| CATALOG_MANAGE_METADATA, | ||
| CATALOG_READ_CONFIG, | ||
| CATALOG_READ_PROPERTIES, | ||
| CATALOG_WRITE_PROPERTIES, | ||
| NAMESPACE_CREATE, | ||
| NAMESPACE_DROP, | ||
| NAMESPACE_FULL_METADATA, | ||
| NAMESPACE_LIST, | ||
| NAMESPACE_READ_PROPERTIES, | ||
| NAMESPACE_WRITE_PROPERTIES, | ||
| TABLE_CREATE, | ||
| TABLE_DROP, | ||
| TABLE_FULL_METADATA, | ||
| TABLE_LIST, | ||
| TABLE_READ_DATA, | ||
| TABLE_READ_PROPERTIES, | ||
| TABLE_WRITE_DATA, | ||
| TABLE_WRITE_PROPERTIES, | ||
| VIEW_CREATE, | ||
| VIEW_DROP, | ||
| VIEW_FULL_METADATA, | ||
| VIEW_LIST, | ||
| VIEW_READ_PROPERTIES, | ||
| VIEW_WRITE_PROPERTIES, | ||
| SERVICE_MANAGE_ACCESS)); | ||
| SUPER_PRIVILEGES.putAll( | ||
| CATALOG_WRITE_PROPERTIES, | ||
| List.of( | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -62,6 +62,8 @@ | |
| import static org.apache.polaris.core.auth.PolarisAuthorizableOperation.GET_APPLICABLE_POLICIES_ON_NAMESPACE; | ||
| import static org.apache.polaris.core.auth.PolarisAuthorizableOperation.GET_APPLICABLE_POLICIES_ON_TABLE; | ||
| import static org.apache.polaris.core.auth.PolarisAuthorizableOperation.GET_CATALOG; | ||
| import static org.apache.polaris.core.auth.PolarisAuthorizableOperation.GET_CATALOG_CONFIG; | ||
| import static org.apache.polaris.core.auth.PolarisAuthorizableOperation.GET_CATALOG_CONFIG_PROPERTIES; | ||
| import static org.apache.polaris.core.auth.PolarisAuthorizableOperation.GET_CATALOG_ROLE; | ||
| import static org.apache.polaris.core.auth.PolarisAuthorizableOperation.GET_PRINCIPAL; | ||
| import static org.apache.polaris.core.auth.PolarisAuthorizableOperation.GET_PRINCIPAL_ROLE; | ||
|
|
@@ -136,6 +138,7 @@ | |
| import static org.apache.polaris.core.entity.PolarisPrivilege.CATALOG_DROP; | ||
| import static org.apache.polaris.core.entity.PolarisPrivilege.CATALOG_LIST; | ||
| import static org.apache.polaris.core.entity.PolarisPrivilege.CATALOG_MANAGE_GRANTS_ON_SECURABLE; | ||
| import static org.apache.polaris.core.entity.PolarisPrivilege.CATALOG_READ_CONFIG; | ||
| import static org.apache.polaris.core.entity.PolarisPrivilege.CATALOG_READ_PROPERTIES; | ||
| import static org.apache.polaris.core.entity.PolarisPrivilege.CATALOG_ROLE_CREATE; | ||
| import static org.apache.polaris.core.entity.PolarisPrivilege.CATALOG_ROLE_DROP; | ||
|
|
@@ -337,6 +340,8 @@ private static void register( | |
| register(GET_CATALOG, CATALOG_READ_PROPERTIES); | ||
| register(UPDATE_CATALOG, CATALOG_WRITE_PROPERTIES); | ||
| register(DELETE_CATALOG, CATALOG_DROP); | ||
| register(GET_CATALOG_CONFIG, CATALOG_READ_CONFIG); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ideally we should release this in two phases: 1) new permissions, 2) enforcement - this is to allow users to do the necessary grants before the upgrade that starts checking for them. However, if the community is ok with a single release (and risk of client breakage on upgrade), we can do that too. Could you open a It might be worth isolating
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Makes sense. I went with a soft rollout in this PR: It’s basically the same idea as the two-phase approach without having to split the PRs. We can still isolate it later if you prefer. I’ll also start a short dev@ thread about the flag and the plan to flip the default.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good idea 👍
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I do not see |
||
| register(GET_CATALOG_CONFIG_PROPERTIES, CATALOG_READ_PROPERTIES); | ||
|
|
||
| // Principal operations | ||
| register(LIST_PRINCIPALS, PRINCIPAL_LIST); | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.