feat: Add AWS STS Session Tags support for credential vending#3327
feat: Add AWS STS Session Tags support for credential vending#3327jbonofre merged 13 commits intoapache:mainfrom
Conversation
|
This is a cool feature ! looking forward to the change :) ~ |
polaris-core/src/main/java/org/apache/polaris/core/storage/cache/StorageCredentialCache.java
Outdated
Show resolved
Hide resolved
polaris-core/src/main/java/org/apache/polaris/core/storage/cache/StorageCredentialCache.java
Outdated
Show resolved
Hide resolved
polaris-core/src/main/java/org/apache/polaris/core/storage/CredentialVendingContext.java
Show resolved
Hide resolved
...service/src/main/java/org/apache/polaris/service/catalog/io/StorageAccessConfigProvider.java
Outdated
Show resolved
Hide resolved
polaris-core/src/main/java/org/apache/polaris/core/config/FeatureConfiguration.java
Outdated
Show resolved
Hide resolved
Thanks. Sent an email to the ML. I addressed most of your comments. I have a question on one of them. Thanks again. |
...core/src/main/java/org/apache/polaris/core/storage/aws/AwsCredentialsStorageIntegration.java
Outdated
Show resolved
Hide resolved
polaris-core/src/main/java/org/apache/polaris/core/storage/PolarisCredentialVendor.java
Show resolved
Hide resolved
polaris-core/src/main/java/org/apache/polaris/core/storage/CredentialVendingContext.java
Outdated
Show resolved
Hide resolved
I removed using Do I make sense? |
...core/src/main/java/org/apache/polaris/core/storage/aws/AwsCredentialsStorageIntegration.java
Show resolved
Hide resolved
|
@singhpk234 as discussed, removed |
...core/src/main/java/org/apache/polaris/core/storage/aws/AwsCredentialsStorageIntegration.java
Outdated
Show resolved
Hide resolved
polaris-core/src/main/java/org/apache/polaris/core/storage/cache/StorageCredentialCache.java
Outdated
Show resolved
Hide resolved
polaris-core/src/main/java/org/apache/polaris/core/storage/PolarisCredentialVendor.java
Show resolved
Hide resolved
polaris-core/src/main/java/org/apache/polaris/core/storage/StorageCredentialsVendor.java
Show resolved
Hide resolved
...core/src/main/java/org/apache/polaris/core/storage/aws/AwsCredentialsStorageIntegration.java
Outdated
Show resolved
Hide resolved
...core/src/main/java/org/apache/polaris/core/storage/aws/AwsCredentialsStorageIntegration.java
Outdated
Show resolved
Hide resolved
polaris-core/src/main/java/org/apache/polaris/core/config/FeatureConfiguration.java
Outdated
Show resolved
Hide resolved
dimas-b
left a comment
There was a problem hiding this comment.
Let's wait a few days for other reviewers to have a chance at commenting since it's a holiday season 😉
adnanhemani
left a comment
There was a problem hiding this comment.
LGTM, I think this will be an exciting feature that many will use!
singhpk234
left a comment
There was a problem hiding this comment.
LGTM, thanks @obelix74 for the all work !
...c/test/java/org/apache/polaris/service/storage/aws/AwsCredentialsStorageIntegrationTest.java
Outdated
Show resolved
Hide resolved
...core/src/main/java/org/apache/polaris/core/storage/aws/AwsCredentialsStorageIntegration.java
Show resolved
Hide resolved
polaris-core/src/main/java/org/apache/polaris/core/storage/aws/AwsSessionTagsBuilder.java
Outdated
Show resolved
Hide resolved
|
I see that @jbonofre wants to review. I will wait for them. |
|
@jbonofre : I see you added yourself as a reviewer... Do you need more time or are you ok with merging? |
jbonofre
left a comment
There was a problem hiding this comment.
I did the review and it looks good to me ! Thanks !
…#3327) * feat: Add AWS STS Session Tags support for credential vending Fixes apache#3325 * Minor fixes * Review comments * Review comments. * Remove request_id from the PR * Review comment: added activated roles * Review comments * Update AwsSessionTagsBuilder.java * Spotless fixes * Update StorageCredentialCacheKey.java * fix failing tests * Review comments. * Reverting last commit based on review comments for cache collisions. --------- Co-authored-by: Anand Kumar Sankaran <anand.sankaran@workday.com>
* feat: Add AWS STS Session Tags support for credential vending (apache#3327) * feat: Add AWS STS Session Tags support for credential vending Fixes apache#3325 * Minor fixes * Review comments * Review comments. * Remove request_id from the PR * Review comment: added activated roles * Review comments * Update AwsSessionTagsBuilder.java * Spotless fixes * Update StorageCredentialCacheKey.java * fix failing tests * Review comments. * Reverting last commit based on review comments for cache collisions. --------- Co-authored-by: Anand Kumar Sankaran <anand.sankaran@workday.com> * chore(deps): update registry.access.redhat.com/ubi9/openjdk-21-runtime docker tag to v1.24-2.1767639862 (apache#3383) * Added HttpRoute and Gateway to Helm Chart (apache#3314) * Added httproute and gateway * added to readme * updated helm site docs * updated changelog * Added tests * fixed broken test * fixed test part 2 * removed odd comment * added check for httproute and gateway * shuffled the gateway documentation * better gateway instructions * removed extra case in validateRouting * Errorprone: prepare for v2.46.0 (apache#3384) This tackles the current failure in apache#3382: `-XDaddTypeAnnotationsToSymbol=true is required by Error Prone on JDK 21` * NoSQL: Metastore maintenance (apache#3268) Implementation of the NoSQL meta-store maintenance implementation. It adds the meta-store specific handling to the existing NoSQL maintenance service to purge unreferenced and unneeded data from the database. * Update release workflows to use the new GPG private key (apache#3399) * [tech debt] Cleanup `gradle/libs.versions.toml` (apache#3394) This change removes unreferenced dependency references, inlines single usages of a version-reference and adds a dependency for checkstyle to get that version managed by renovate. * fix(deps): update dependency org.keycloak:keycloak-admin-client to v26.0.8 (apache#3405) * fix(deps): update dependency com.google.errorprone:error_prone_core to v2.46.0 (apache#3382) * [doc]: Add Minio OSS disclaimer (apache#3390) * [Releasy] Let Maven artifact publication propagate failures (apache#3407) The Gradle build to publish the Maven artifacts is invoked like `./gradlew ... | tee <log>`. The (overall) exit code of pipes is the exit code of the _last_ command. The exit codes of all pipe "parts" is available in bash's `PIPESTATUS` array and needs to be checked. * Fix Gradle up-to-date of jars (apache#3401) The change apache#1036 added the Maven pom.xml to all built jars. However, the `GenerateMavenPom` Gradle task type is never up-to-date, in consequence no jar can ever be up-to-date, leading to unnecessarily longer build times. This change ensures that the pom.xml is included in release builds, but not in developer/snapshot builds. * fix(deps): update dependency net.ltgt.gradle:gradle-errorprone-plugin to v4.4.0 (apache#3406) * fix(deps): update dependency com.puppycrawl.tools:checkstyle to v13 (apache#3403) * fix(deps): update dependency io.opentelemetry:opentelemetry-bom to v1.58.0 (apache#3408) * fix(deps): update dependency software.amazon.awssdk:bom to v2.41.5 (apache#3416) * chore(deps): update dependency jupyterlab to v4.5.2 (apache#3419) * Release workflows should retry svn checkout in case of failure (apache#3393) * Change parser option to be required (apache#3413) * Support hierarchical namespace in Azure (apache#3347) * Support hierarchical namespace in Azure * Add `hierarchical` to `AzureStorageConfigInfo` (the default is unset translating to current behaviour). * Use `DataLakeDirectoryClient` instead of `DataLakeFileSystemClient` for generating SAS tokens when `hierarchical` is set to `true`. * Add `cloudTest` classes for testing with credential vending in ADLS. * chore(test): Increase Authorization Test Coverage (apache#3332) * increase test coverage * update docstrings * clean up * make use of same helper method * remove duplicate tests from OpaIntegrationTest * use tempdir * fix(deps): update dependency io.micrometer:micrometer-bom to v1.16.2 (apache#3422) * chore(deps): update registry.access.redhat.com/ubi9/openjdk-21-runtime docker tag to v1.24-2.1767878250 (apache#3421) * Last merged commit 1996156 * Add free-disk-space action * Add free-disk-space action to regtest + spark_client_regtests --------- Co-authored-by: Anand K Sankaran <lists@anands.net> Co-authored-by: Anand Kumar Sankaran <anand.sankaran@workday.com> Co-authored-by: Mend Renovate <bot@renovateapp.com> Co-authored-by: cccs-cat001 <56204545+cccs-cat001@users.noreply.github.com> Co-authored-by: Pierre Laporte <pierre@pingtimeout.fr> Co-authored-by: Yong Zheng <yongzheng0809@gmail.com> Co-authored-by: Dmitri Bourlatchkov <dmitri.bourlatchkov@gmail.com> Co-authored-by: Sung Yun <107272191+sungwy@users.noreply.github.com>

Fixes #3325
Summary
Adds support for AWS STS Session Tags when vending S3 credentials, enabling correlation between Polaris catalog operations and S3 access in AWS CloudTrail. This feature is controlled by a new feature flag
INCLUDE_SESSION_TAGS_IN_SUBSCOPED_CREDENTIAL(default:false).Motivation
When Polaris vends temporary AWS credentials via STS
AssumeRole, there's no way to correlate S3 access events in CloudTrail back to the originating Polaris catalog operation. This makes audit trails incomplete and security investigations difficult.AWS STS Session Tags solve this by attaching metadata to the assumed role session that appears in CloudTrail events for all subsequent API calls made with those credentials.
Changes
New Components
CredentialVendingContext- Immutable value class holding session tag context (catalog name, namespace, table name, request-id)INCLUDE_SESSION_TAGS_IN_SUBSCOPED_CREDENTIAL- Feature flag inFeatureConfiguration(default:false)AWS Integration
AwsCredentialsStorageIntegration- Adds 5 session tags toAssumeRoleRequestwhen feature enabled:polaris:principal- The authenticated principal namepolaris:catalog- The catalog being accessedpolaris:namespace- The namespace being accessedpolaris:table- The table being accessedpolaris:request-id- The originating request ID for correlation"unknown"placeholder for consistent CloudTrail presenceCache Key Updates
StorageCredentialCacheKey- Now includesCredentialVendingContextwhen session tags enabledStorageCredentialCache- Includes principal in cache key when session tags OR principal-name-in-session features areenabled (prevents credential cross-contamination)
toSanitizedLogString()for safe debug logging without exposing sensitive contextInterface Updates
PolarisStorageIntegration,PolarisCredentialVendor,StorageCredentialsVendorto acceptCredentialVendingContextTesting
AwsCredentialsStorageIntegrationTest:testSessionTagsIncludedWhenFeatureEnabledtestSessionTagsNotIncludedWhenFeatureDisabledtestSessionTagsWithPartialContexttestSessionTagsWithLongValuestestSessionTagsWithEmptyContexttestSessionTagsAccessDeniedGracefulHandlingpolaris-core:test,polaris-runtime-service:testConfiguration
To enable session tags, set in your Polaris configuration:
IAM Requirements
When enabled, the IAM role's trust policy must allow
sts:TagSession:Breaking Changes
None. Feature is off by default and all interface changes are backward compatible.
Checklist
CHANGELOG.md(if needed)site/content/in-dev/unreleased(if needed)