You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@polaris.apache.org by "adutra (via GitHub)" <gi...@apache.org> on 2026/03/18 15:40:10 UTC

[PR] Allow setting ARN role and external ID on catalogs that had none [polaris]

adutra opened a new pull request, #4019:
URL: https://github.com/apache/polaris/pull/4019

   Fixes: https://github.com/apache/polaris/discussions/3885
   
   Catalogs created without a role ARN (e.g. not using STS) could not be updated to add one, because the validation treated going from null to a non-null value as a forbidden AWS account ID change. The same applied to external IDs.
   
   This change relaxes the validation in `validateUpdateCatalogDiffOrThrow()` so that setting a previously-null role ARN or external ID is allowed, while still preventing changes to the AWS account ID or external ID once set.
   
   This change also changes the error message from the misleading "Cannot modify Role ARN" (the role name *can* be changed) to the more accurate "Cannot modify AWS account ID".
   
   <!--
   ๐Ÿ“ Describe what changes you're proposing, especially breaking or user-facing changes. 
   ๐Ÿ“– See https://github.com/apache/polaris/blob/main/CONTRIBUTING.md for more.
   -->
   
   ## Checklist
   - [ ] ๐Ÿ›ก๏ธ Don't disclose security issues! (contact security@apache.org)
   - [ ] ๐Ÿ”— Clearly explained why the changes are needed, or linked related issues: Fixes #
   - [ ] ๐Ÿงช Added/updated tests with good coverage, or manually tested (and explained how)
   - [ ] ๐Ÿ’ก Added comments for complex logic
   - [ ] ๐Ÿงพ Updated `CHANGELOG.md` (if needed)
   - [ ] ๐Ÿ“š Updated documentation in `site/content/in-dev/unreleased` (if needed)
   


-- 
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] Allow setting ARN role and external ID on catalogs that had none [polaris]

Posted by "adutra (via GitHub)" <gi...@apache.org>.
adutra commented on code in PR #4019:
URL: https://github.com/apache/polaris/pull/4019#discussion_r2955149362


##########
runtime/service/src/main/java/org/apache/polaris/service/admin/PolarisAdminService.java:
##########
@@ -852,16 +852,19 @@ private void validateUpdateCatalogDiffOrThrow(
     if (currentStorageConfig instanceof AwsStorageConfigurationInfo currentAwsConfig
         && newStorageConfig instanceof AwsStorageConfigurationInfo newAwsConfig) {
 
-      if (!Objects.equals(currentAwsConfig.getAwsAccountId(), newAwsConfig.getAwsAccountId())) {
+      // Allow setting a role ARN when none was previously configured, but prevent changing the
+      // AWS account ID once it has been set.
+      if (currentAwsConfig.getAwsAccountId() != null
+          && !currentAwsConfig.getAwsAccountId().equals(newAwsConfig.getAwsAccountId())) {

Review Comment:
   Yes. This has always been like this, presumably for security reasons (i.e. prevent a malicious client from changing to a role in another AWS account). Maybe @dennishuo or @collado-mike know more.



-- 
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] Allow setting ARN role and external ID on catalogs that had none [polaris]

Posted by "adutra (via GitHub)" <gi...@apache.org>.
adutra commented on PR #4019:
URL: https://github.com/apache/polaris/pull/4019#issuecomment-4197421741

   This PR has been in review for 2 weeks. Let's merge it by today EOD if there are no objections.


-- 
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] Allow setting ARN role and external ID on catalogs that had none [polaris]

Posted by "dimas-b (via GitHub)" <gi...@apache.org>.
dimas-b commented on code in PR #4019:
URL: https://github.com/apache/polaris/pull/4019#discussion_r2968474664


##########
runtime/service/src/main/java/org/apache/polaris/service/admin/PolarisAdminService.java:
##########
@@ -852,16 +852,19 @@ private void validateUpdateCatalogDiffOrThrow(
     if (currentStorageConfig instanceof AwsStorageConfigurationInfo currentAwsConfig
         && newStorageConfig instanceof AwsStorageConfigurationInfo newAwsConfig) {
 
-      if (!Objects.equals(currentAwsConfig.getAwsAccountId(), newAwsConfig.getAwsAccountId())) {
+      // Allow setting a role ARN when none was previously configured, but prevent changing the
+      // AWS account ID once it has been set.

Review Comment:
   Thx! I believe the feature flag will allow maintaining  the old (current) behaviour when the Polaris owner so wishes, and allow more flexibility in fresh deployments.



-- 
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] Allow setting ARN role and external ID on catalogs that had none [polaris]

Posted by "adutra (via GitHub)" <gi...@apache.org>.
adutra merged PR #4019:
URL: https://github.com/apache/polaris/pull/4019


-- 
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] Allow setting ARN role and external ID on catalogs that had none [polaris]

Posted by "adutra (via GitHub)" <gi...@apache.org>.
adutra commented on code in PR #4019:
URL: https://github.com/apache/polaris/pull/4019#discussion_r2955283490


##########
runtime/service/src/main/java/org/apache/polaris/service/admin/PolarisAdminService.java:
##########
@@ -852,16 +852,19 @@ private void validateUpdateCatalogDiffOrThrow(
     if (currentStorageConfig instanceof AwsStorageConfigurationInfo currentAwsConfig
         && newStorageConfig instanceof AwsStorageConfigurationInfo newAwsConfig) {
 
-      if (!Objects.equals(currentAwsConfig.getAwsAccountId(), newAwsConfig.getAwsAccountId())) {
+      // Allow setting a role ARN when none was previously configured, but prevent changing the
+      // AWS account ID once it has been set.
+      if (currentAwsConfig.getAwsAccountId() != null
+          && !currentAwsConfig.getAwsAccountId().equals(newAwsConfig.getAwsAccountId())) {

Review Comment:
   Me too ๐Ÿ˜„ The original discussion https://github.com/apache/polaris/discussions/3885 was precisely about that.



-- 
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] Allow setting ARN role and external ID on catalogs that had none [polaris]

Posted by "adutra (via GitHub)" <gi...@apache.org>.
adutra commented on code in PR #4019:
URL: https://github.com/apache/polaris/pull/4019#discussion_r2967450310


##########
runtime/service/src/main/java/org/apache/polaris/service/admin/PolarisAdminService.java:
##########
@@ -852,16 +852,19 @@ private void validateUpdateCatalogDiffOrThrow(
     if (currentStorageConfig instanceof AwsStorageConfigurationInfo currentAwsConfig
         && newStorageConfig instanceof AwsStorageConfigurationInfo newAwsConfig) {
 
-      if (!Objects.equals(currentAwsConfig.getAwsAccountId(), newAwsConfig.getAwsAccountId())) {
+      // Allow setting a role ARN when none was previously configured, but prevent changing the
+      // AWS account ID once it has been set.

Review Comment:
   I don't disagree ๐Ÿ˜„ 
   
   Since we don't have feedback from the original Polaris authors, let's go with the feature flag approach.



-- 
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] Allow setting ARN role and external ID on catalogs that had none [polaris]

Posted by "dimas-b (via GitHub)" <gi...@apache.org>.
dimas-b commented on code in PR #4019:
URL: https://github.com/apache/polaris/pull/4019#discussion_r2956377174


##########
runtime/service/src/main/java/org/apache/polaris/service/admin/PolarisAdminService.java:
##########
@@ -852,16 +852,19 @@ private void validateUpdateCatalogDiffOrThrow(
     if (currentStorageConfig instanceof AwsStorageConfigurationInfo currentAwsConfig
         && newStorageConfig instanceof AwsStorageConfigurationInfo newAwsConfig) {
 
-      if (!Objects.equals(currentAwsConfig.getAwsAccountId(), newAwsConfig.getAwsAccountId())) {
+      // Allow setting a role ARN when none was previously configured, but prevent changing the
+      // AWS account ID once it has been set.

Review Comment:
   TBH, I do not see much value in allowing changes from unset to a new roles is some account, but preventing changing to a role in another account.
   
   The security implications are the same for changing from unset to some role as for changing from one account to another, IMHO.
   
   If the new role has more access to the data in storage than the Polaris Administrator considers valid (for whatever reason), and Polaris is able to assume that role with current credentials, it is a mistake in the authorization setup in the new role's account. 
   
   This can hardly be a concern when the Polaris owner (who controls Polaris storage access credentials) and the catalog owner is the same person or entity.
   
   I can see this being a concern when the Polaris owner is different from the catalog admin.
   
   Therefore, I'd prefer adding a feature flag to enable any role changes (at the discretion of the Polaris owner). If the flag is not set, let's keep current behaviour. The default should probably be `off` (current, more restricted behaviour).
   
   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] Allow setting ARN role and external ID on catalogs that had none [polaris]

Posted by "singhpk234 (via GitHub)" <gi...@apache.org>.
singhpk234 commented on code in PR #4019:
URL: https://github.com/apache/polaris/pull/4019#discussion_r2955127757


##########
runtime/service/src/main/java/org/apache/polaris/service/admin/PolarisAdminService.java:
##########
@@ -852,16 +852,19 @@ private void validateUpdateCatalogDiffOrThrow(
     if (currentStorageConfig instanceof AwsStorageConfigurationInfo currentAwsConfig
         && newStorageConfig instanceof AwsStorageConfigurationInfo newAwsConfig) {
 
-      if (!Objects.equals(currentAwsConfig.getAwsAccountId(), newAwsConfig.getAwsAccountId())) {
+      // Allow setting a role ARN when none was previously configured, but prevent changing the
+      // AWS account ID once it has been set.
+      if (currentAwsConfig.getAwsAccountId() != null
+          && !currentAwsConfig.getAwsAccountId().equals(newAwsConfig.getAwsAccountId())) {

Review Comment:
   This means we allow updating the role A to role B if they are same account ? any reason why 
   



-- 
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] Allow setting ARN role and external ID on catalogs that had none [polaris]

Posted by "singhpk234 (via GitHub)" <gi...@apache.org>.
singhpk234 commented on code in PR #4019:
URL: https://github.com/apache/polaris/pull/4019#discussion_r2955172227


##########
runtime/service/src/main/java/org/apache/polaris/service/admin/PolarisAdminService.java:
##########
@@ -852,16 +852,19 @@ private void validateUpdateCatalogDiffOrThrow(
     if (currentStorageConfig instanceof AwsStorageConfigurationInfo currentAwsConfig
         && newStorageConfig instanceof AwsStorageConfigurationInfo newAwsConfig) {
 
-      if (!Objects.equals(currentAwsConfig.getAwsAccountId(), newAwsConfig.getAwsAccountId())) {
+      // Allow setting a role ARN when none was previously configured, but prevent changing the
+      // AWS account ID once it has been set.
+      if (currentAwsConfig.getAwsAccountId() != null
+          && !currentAwsConfig.getAwsAccountId().equals(newAwsConfig.getAwsAccountId())) {

Review Comment:
   I would love to know about the history, because i think malicious client can also point it to a role within the same account but different privledge if they have the access to catalog ? want to understand the attack vector more (not a blocker for this pr)



-- 
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] Allow setting ARN role and external ID on catalogs that had none [polaris]

Posted by "dimas-b (via GitHub)" <gi...@apache.org>.
dimas-b commented on code in PR #4019:
URL: https://github.com/apache/polaris/pull/4019#discussion_r2956377174


##########
runtime/service/src/main/java/org/apache/polaris/service/admin/PolarisAdminService.java:
##########
@@ -852,16 +852,19 @@ private void validateUpdateCatalogDiffOrThrow(
     if (currentStorageConfig instanceof AwsStorageConfigurationInfo currentAwsConfig
         && newStorageConfig instanceof AwsStorageConfigurationInfo newAwsConfig) {
 
-      if (!Objects.equals(currentAwsConfig.getAwsAccountId(), newAwsConfig.getAwsAccountId())) {
+      // Allow setting a role ARN when none was previously configured, but prevent changing the
+      // AWS account ID once it has been set.

Review Comment:
   TBH, I do not see much value in allowing changes from unset to a new roles in some account, but preventing changing to a role in another account.
   
   The security implications are the same for changing from unset to some role as for changing from one account to another, IMHO.
   
   If the new role has more access to the data in storage than the Polaris Administrator considers valid (for whatever reason), and Polaris is able to assume that role with current credentials, it is a mistake in the authorization setup in the new role's account. 
   
   This can hardly be a concern when the Polaris owner (who controls Polaris storage access credentials) and the catalog owner is the same person or entity.
   
   I can see this being a concern when the Polaris owner is different from the catalog admin.
   
   Therefore, I'd prefer adding a feature flag to enable any role changes (at the discretion of the Polaris owner). If the flag is not set, let's keep current behaviour. The default should probably be `off` (current, more restricted behaviour).
   
   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