You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@polaris.apache.org by "obelix74 (via GitHub)" <gi...@apache.org> on 2026/09/30 20:51:17 UTC
[PR] Add TABLE_READ_METRICS privilege for metrics RBAC [polaris]
obelix74 opened a new pull request, #5659:
URL: https://github.com/apache/polaris/pull/5659
## Summary
This PR splits the Management API / grants changes out of PR #4115 ("Implement metrics rest api"), per the dev-list discussion on "Proposal for REST endpoints for table metrics and events". These changes did not get a dedicated API change review when they were originally proposed as part of #4115, so they're being pulled into their own PR for focused review, ahead of the REST endpoint work in #4115.
Adds a new `TABLE_READ_METRICS` privilege:
- Grants read-only access to a table's scan and commit metrics reports, without granting access to the table's data.
- Implied by `TABLE_FULL_METADATA`.
- Restricted to `PolarisEntitySubType.ICEBERG_TABLE`, since the metrics ingestion and query paths only cover Iceberg tables today; granting it on a generic table would authorize successfully while returning no reports.
Related to #4115, which will be rebased on top of this once merged (it depends on `TABLE_READ_METRICS` for authorizing its query REST API).
## Checklist
- [x] ๐ก๏ธ Don't disclose security issues! (contact security@apache.org)
- [x] ๐ Clearly explained why the changes are needed, or linked related issues: Related to #4115
- [x] ๐งช Added/updated tests with good coverage, or manually tested (and explained how)
- [x] ๐ก Added comments for complex logic
- [x] ๐งพ Updated `CHANGELOG.md` (if needed)
- [x] ๐ Updated documentation in `site/content/in-dev/unreleased` (if needed)
๐ค Generated with [Claude Code](https://claude.com/claude-code)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add TABLE_READ_METRICS privilege for metrics RBAC [polaris]
Posted by "flyrain (via GitHub)" <gi...@apache.org>.
flyrain commented on code in PR #5659:
URL: https://github.com/apache/polaris/pull/5659#discussion_r4210577213
##########
site/content/in-dev/unreleased/managing-security/access-control.md:
##########
@@ -115,6 +115,7 @@ To grant the full set of privileges (drop, list, read, write, etc.) on an object
| TABLE_WRITE_PROPERTIES | Enables configuring properties for the table. |
| TABLE_READ_DATA | Enables reading data from the table by receiving short-lived read-only storage credentials from the catalog. |
| TABLE_WRITE_DATA | Enables writing data to the table by receiving short-lived read+write storage credentials from the catalog. |
+| TABLE_READ_METRICS | Enables reading table scan and commit metrics reports. Does not grant access to table data. Restricted to Iceberg tables. |
Review Comment:
The revised enum and Javadoc now allow TABLE_READ_METRICS grants on generic tables, but this row, the CHANGELOG entry, and the PR description still say the privilege is restricted to Iceberg tables. Could you update those descriptions to distinguish where the privilege can be granted from which table types currently produce metrics reports?
##########
polaris-core/src/main/java/org/apache/polaris/core/auth/PolarisAuthorizerImpl.java:
##########
@@ -470,6 +472,13 @@ public class PolarisAuthorizerImpl implements PolarisAuthorizer {
SUPER_PRIVILEGES.putAll(
TABLE_FULL_METADATA,
List.of(CATALOG_MANAGE_CONTENT, CATALOG_MANAGE_METADATA, TABLE_FULL_METADATA));
+ SUPER_PRIVILEGES.putAll(
+ TABLE_READ_METRICS,
+ List.of(
+ CATALOG_MANAGE_CONTENT,
+ CATALOG_MANAGE_METADATA,
+ TABLE_FULL_METADATA,
Review Comment:
I thought we got a consensus to not let this imply read metrics, here is dev mailing discussion: https://lists.apache.org/thread/6872nwlr8d7j4ns74bjjlwl7yk89v86q
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add TABLE_READ_METRICS privilege for metrics RBAC [polaris]
Posted by "flyrain (via GitHub)" <gi...@apache.org>.
flyrain commented on code in PR #5659:
URL: https://github.com/apache/polaris/pull/5659#discussion_r4162008960
##########
polaris-core/src/main/java/org/apache/polaris/core/entity/PolarisPrivilege.java:
##########
@@ -263,6 +263,19 @@ public enum PolarisPrivilege {
SEMANTIC_MODEL_DROP(107, PolarisEntityType.SEMANTIC_MODEL),
SEMANTIC_MODEL_FULL_METADATA(108, PolarisEntityType.SEMANTIC_MODEL),
SEMANTIC_MODEL_MANAGE_GRANTS_ON_SECURABLE(109, PolarisEntityType.SEMANTIC_MODEL),
+ /**
+ * Read-only access to table scan and commit metrics reports. Does not grant access to table data.
+ * Implied by TABLE_FULL_METADATA.
Review Comment:
I'm not sure if TABLE_READ_METRICS should be implied by TABLE_FULL_METADATA. Sent a dev mailing discussion for this.
If we agreed on TABLE_FULL_METADATA implies TABLE_READ_METRICS, but this PR didn't make that true. Implication comes from `SUPER_PRIVILEGES` in PolarisAuthorizerImpl. Can we add `SUPER_PRIVILEGES.putAll(TABLE_READ_METRICS, List.of(CATALOG_MANAGE_CONTENT, CATALOG_MANAGE_METADATA, TABLE_FULL_METADATA))` in this PR?
##########
polaris-core/src/main/java/org/apache/polaris/core/entity/PolarisPrivilege.java:
##########
@@ -263,6 +263,19 @@ public enum PolarisPrivilege {
SEMANTIC_MODEL_DROP(107, PolarisEntityType.SEMANTIC_MODEL),
SEMANTIC_MODEL_FULL_METADATA(108, PolarisEntityType.SEMANTIC_MODEL),
SEMANTIC_MODEL_MANAGE_GRANTS_ON_SECURABLE(109, PolarisEntityType.SEMANTIC_MODEL),
+ /**
+ * Read-only access to table scan and commit metrics reports. Does not grant access to table data.
+ * Implied by TABLE_FULL_METADATA.
+ *
+ * <p>Restricted to {@link PolarisEntitySubType#ICEBERG_TABLE}: the metrics ingestion and query
+ * paths only cover Iceberg tables today, and granting this on a generic table would make the
+ * privilege authorize successfully while returning no reports.
+ */
+ TABLE_READ_METRICS(
+ 110,
+ PolarisEntityType.TABLE_LIKE,
+ List.of(PolarisEntitySubType.ICEBERG_TABLE),
Review Comment:
Restricting this to ICEBERG_TABLE here doesn't block anything. `securableSubTypes` is assigned in the constructor but nothing ever reads it. `grantPrivilegeOnTableToRole` in PolarisAdminService accepts GENERIC_TABLE and ICEBERG_TABLE for every privilege, so granting this on a generic table still succeeds. That's exactly the case the javadoc says is prevented.
Maybe we don't have to restrict it to Iceberg Table. WDYT?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add TABLE_READ_METRICS privilege for metrics RBAC [polaris]
Posted by "jbonofre (via GitHub)" <gi...@apache.org>.
jbonofre commented on code in PR #5659:
URL: https://github.com/apache/polaris/pull/5659#discussion_r4206403452
##########
polaris-core/src/main/java/org/apache/polaris/core/entity/PolarisPrivilege.java:
##########
@@ -263,6 +263,19 @@ public enum PolarisPrivilege {
SEMANTIC_MODEL_DROP(107, PolarisEntityType.SEMANTIC_MODEL),
SEMANTIC_MODEL_FULL_METADATA(108, PolarisEntityType.SEMANTIC_MODEL),
SEMANTIC_MODEL_MANAGE_GRANTS_ON_SECURABLE(109, PolarisEntityType.SEMANTIC_MODEL),
+ /**
+ * Read-only access to table scan and commit metrics reports. Does not grant access to table data.
+ * Implied by TABLE_FULL_METADATA.
Review Comment:
I agree with @flyrain here.
Maybe the Javadoc should just be updated.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add TABLE_READ_METRICS privilege for metrics RBAC [polaris]
Posted by "dimas-b (via GitHub)" <gi...@apache.org>.
dimas-b merged PR #5659:
URL: https://github.com/apache/polaris/pull/5659
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@polaris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org