Repository navigation
fix(warehouse): use pod identity for rudder-storage flow; keep S3-copy user fallback for user S3 destinations - #7167
Conversation
f5213ce to
cd5d4ad
Compare
E2E Test ReportVerified against a local Results
Pod-identity emulation (for #4/#5)No IRSA cluster was available, so the pod-identity path was exercised by feeding AWS creds to rudder-server through the SDK default credential provider chain via env vars. The executed code path is identical to IRSA: Not run
VerdictThe security-critical behaviors verified end-to-end: (a) missing S3 credentials now hard-fail with no fallthrough to any RudderStack-owned credential (#3), and (b) the 🤖 E2E run via Claude Code |
cd5d4ad to
ce566fd
Compare
… S3 destinations Hardens object-storage credential resolution so RudderStack-owned credentials can never be used to authenticate writes to a user-configured S3 destination. - Remove the shared "S3-copy" IAM user from the code path. No non-test code reads RUDDER_AWS_S3_COPY_USER_ACCESS_KEY_ID/KEY anymore. Access to the intermediate rudder-warehouse-storage* buckets (the useRudderStorage flow) now resolves through the AWS SDK default credential chain (pod identity / IRSA) instead of a broadly-scoped static credential. - Require explicit auth for user S3 destinations. misc.GetObjectStorageConfig now returns (map, error) and warehouseutils.CreateAWSSessionConfig errors with the new sentinel misc.ErrS3MissingCredentials when an S3 destination supplies neither an IAM role ARN nor access keys. Previously such a destination silently fell back to the shared copy-user credentials; it now fails (retry-then-abort) and can never fall through to the pod identity role. - Fix the warehouse COPY temp-credential path. GetTemporaryS3Cred now retrieves already-temporary credentials from the default chain directly (role-based auth and pod identity), and only calls STS GetSessionToken for customer-supplied long-term static keys. Tests updated accordingly: no-auth S3 asserts the sentinel error, copy-user env is never consulted, untestable useRudderStorage integration cases are dropped, and upload/cleanup tests supply explicit S3 credentials. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
ce566fd to
d095e0d
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #7167 +/- ##
==========================================
+ Coverage 80.01% 80.12% +0.11%
==========================================
Files 595 595
Lines 66133 66155 +22
==========================================
+ Hits 52915 53008 +93
+ Misses 10071 10011 -60
+ Partials 3147 3136 -11 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…ic AWS env Re-add the useRudderStorage upload/merge integration cases dropped in the previous commit (redshift, snowflake, deltalake). Instead of the retired app-specific copy-user envs (RUDDER_AWS_S3_COPY_USER_ACCESS_KEY_ID/KEY), these now supply generic AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY envs so the AWS SDK default credential chain resolves them automatically — the same path the useRudderStorage flow uses in production (pod identity / IRSA). Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Deltalake's COPY runs on Databricks via the S3A TemporaryAWSCredentialsProvider, which requires a non-empty session token. In production the useRudderStorage path authenticates via IRSA/pod-identity, whose credentials are already temporary and carry a session token, so the COPY works. A static-key integration test cannot produce a session token, so the case cannot be faithfully exercised in CI. This is a test-environment limitation, not a production bug — redshift and snowflake tolerate an empty token and remain restored. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…TS session token Deltalake's COPY runs on Databricks via the S3A TemporaryAWSCredentialsProvider, which requires a non-empty session token. Production resolves temporary, session-token credentials from the AWS SDK default chain (IRSA/pod-identity). Mirror that in the test: mint a session token from the static test keys via STS GetSessionToken and export it through the standard AWS_ACCESS_KEY_ID / AWS_SECRET_ACCESS_KEY / AWS_SESSION_TOKEN envs, so the SDK default chain resolves temporary creds with a token — no production code change and no app-specific credential env. redshift/snowflake are unchanged (their COPY tolerates an empty token and already pass). Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
… in deltalake temp-cred minting Matches production, which resolves the region hint via misc.GetRegionHint() (defaults to us-east-1, overridable via AWS_S3_REGION_HINT) rather than hardcoding it. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
The copy-user credentials (RUDDER_AWS_S3_COPY_USER_*) must only be dropped from the rudder-storage flow. Customer-configured (non-rudder-storage) S3 locations that provide neither an IAM role ARN nor access keys still rely on the shared RudderStack copy user, which customers grant write access to their bucket. Restore the copy-user fallback in misc.GetObjectStorageConfig and warehouseutils.CreateAWSSessionConfig (reverting GetObjectStorageConfig to its non-error signature and dropping ErrS3MissingCredentials), while keeping the rudder-storage flow on the AWS SDK default credential chain (pod identity / IRSA). Added comments explaining the fallback where the env is consumed. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
db977eb to
65f3ef5
Compare
…creds Replace the sessionConfig.AccessKeyID == "" proxy in GetTemporaryS3Cred with an explicit misc.IsConfiguredToUseRudderObjectStorage check, so the retrieve-directly path is taken only for role-based auth and the rudder-storage (IRSA/pod-identity) flow. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
65f3ef5 to
0234ddf
Compare
🤖 I have created a release *beep* *boop* --- ## [1.81.0-rc.1](v1.80.0...v1.81.0-rc.1) (2026-07-20) ### Features * run python transformation tests on ephemeral per-request pyt deployments ([#7177](#7177)) ([1008ae7](1008ae7)) * support partition migration job fanout per jobsdb ([#7141](#7141)) ([be42e48](be42e48)) ### Bug Fixes * abort snowpipe events on channel bad request ([#7118](#7118)) ([6c08584](6c08584)) * avoid redundant transformer statTags unmarshalling ([#7182](#7182)) ([c3c283c](c3c283c)) * classify reverse-ETL sources from config for MAR metering ([#7159](#7159)) ([fa7870f](fa7870f)) * detect server-side snowpipe channel failures via per-channel status at stuck threshold ([#7166](#7166)) ([581410c](581410c)) * kafkamanager compilation error ([#7189](#7189)) ([1fb7f6e](1fb7f6e)) * **kafka:** support insecure TLS skip verify config ([#7022](#7022)) ([d01574f](d01574f)) * preserve order when overflowing snowpipe insert batches ([#7178](#7178)) ([9c01fa0](9c01fa0)) * quote postgres warehouse ddl identifiers ([#7127](#7127)) ([5aeb481](5aeb481)) * **router:** emit invalid payload metric ([#7168](#7168)) ([6e2009a](6e2009a)) * update null to #N/A for salesforce bulk upload ([#7151](#7151)) ([1dffd93](1dffd93)) * **warehouse:** use pod identity for rudder-storage flow; keep S3-copy user fallback for user S3 destinations ([#7167](#7167)) ([3f9aa32](3f9aa32)) ### Miscellaneous * add contract tests for test endpoints in pytransformer ([#7147](#7147)) ([3b210ec](3b210ec)) * bump compose-test to v0.1.5 to remediate pgx CVE-2026-33815 ([#7162](#7162)) ([7672f96](7672f96)) * **deps:** bump actions/checkout from 6.0.3 to 7.0.0 ([#7132](#7132)) ([d453c93](d453c93)) * **deps:** bump actions/setup-go from 6.4.0 to 6.5.0 ([#7150](#7150)) ([75d9648](75d9648)) * **deps:** bump aws-actions/amazon-ecr-login from 2.1.5 to 2.1.6 ([#7109](#7109)) ([7b2a859](7b2a859)) * **deps:** bump aws-actions/configure-aws-credentials from 6.2.0 to 6.2.2 ([#7152](#7152)) ([c984268](c984268)) * **deps:** bump golangci/golangci-lint-action from 9.2.1 to 9.3.0 ([#7170](#7170)) ([4565d25](4565d25)) * **deps:** bump the frequent group across 1 directory with 4 updates ([#6891](#6891)) ([88a0ddf](88a0ddf)) * support compression in bqstream destinations ([#7142](#7142)) ([0694f12](0694f12)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: rudderstack-github-actions[bot] <236995729+rudderstack-github-actions[bot]@users.noreply.github.com>
🤖 I have created a release *beep* *boop* --- ## [1.81.0](v1.80.0...v1.81.0) (2026-07-20) ### Features * run python transformation tests on ephemeral per-request pyt deployments ([#7177](#7177)) ([1008ae7](1008ae7)) * support partition migration job fanout per jobsdb ([#7141](#7141)) ([be42e48](be42e48)) ### Bug Fixes * abort snowpipe events on channel bad request ([#7118](#7118)) ([6c08584](6c08584)) * avoid redundant transformer statTags unmarshalling ([#7182](#7182)) ([c3c283c](c3c283c)) * classify reverse-ETL sources from config for MAR metering ([#7159](#7159)) ([fa7870f](fa7870f)) * detect server-side snowpipe channel failures via per-channel status at stuck threshold ([#7166](#7166)) ([581410c](581410c)) * kafkamanager compilation error ([#7189](#7189)) ([1fb7f6e](1fb7f6e)) * **kafka:** support insecure TLS skip verify config ([#7022](#7022)) ([d01574f](d01574f)) * preserve order when overflowing snowpipe insert batches ([#7178](#7178)) ([9c01fa0](9c01fa0)) * quote postgres warehouse ddl identifiers ([#7127](#7127)) ([5aeb481](5aeb481)) * **router:** emit invalid payload metric ([#7168](#7168)) ([6e2009a](6e2009a)) * update null to #N/A for salesforce bulk upload ([#7151](#7151)) ([1dffd93](1dffd93)) * **warehouse:** use pod identity for rudder-storage flow; keep S3-copy user fallback for user S3 destinations ([#7167](#7167)) ([3f9aa32](3f9aa32)) ### Miscellaneous * add contract tests for test endpoints in pytransformer ([#7147](#7147)) ([3b210ec](3b210ec)) * bump compose-test to v0.1.5 to remediate pgx CVE-2026-33815 ([#7162](#7162)) ([7672f96](7672f96)) * **deps:** bump actions/checkout from 6.0.3 to 7.0.0 ([#7132](#7132)) ([d453c93](d453c93)) * **deps:** bump actions/setup-go from 6.4.0 to 6.5.0 ([#7150](#7150)) ([75d9648](75d9648)) * **deps:** bump aws-actions/amazon-ecr-login from 2.1.5 to 2.1.6 ([#7109](#7109)) ([7b2a859](7b2a859)) * **deps:** bump aws-actions/configure-aws-credentials from 6.2.0 to 6.2.2 ([#7152](#7152)) ([c984268](c984268)) * **deps:** bump golangci/golangci-lint-action from 9.2.1 to 9.3.0 ([#7170](#7170)) ([4565d25](4565d25)) * **deps:** bump the frequent group across 1 directory with 4 updates ([#6891](#6891)) ([88a0ddf](88a0ddf)) * support compression in bqstream destinations ([#7142](#7142)) ([0694f12](0694f12)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: rudderstack-github-actions[bot] <236995729+rudderstack-github-actions[bot]@users.noreply.github.com>
What
Stops the
useRudderStorageflow from authenticating with a broadly-scoped static credential, while preserving the shared S3-copy user as the fallback for customer-configured S3 destinations that supply no auth of their own.misc.GetRudderObjectStorageConfigand theuseRudderStoragebranch ofwarehouseutils.CreateAWSSessionConfigno longer readRUDDER_AWS_S3_COPY_USER_ACCESS_KEY_ID/KEY. Access to the intermediaterudder-warehouse-storage*buckets now resolves through the AWS SDK default credential chain — i.e. the pod identity role (IRSA) — instead of the static copy-user credential.misc.GetObjectStorageConfigand the non-rudder-storage branch ofCreateAWSSessionConfigstill fall back to the shared copy-user credentials when a user-configured S3 destination provides neither an IAM role ARN nor access keys. Customers grant this user write access to their bucket precisely so RudderStack can deliver data when they don't supply their own credentials, so this path must be retained.GetTemporaryS3Crednow retrieves already-temporary credentials directly from the default chain when there are no static keys (sessionConfig.AccessKeyID == ""), in addition to the role-based case. This is needed because the rudder-storage flow now returns a credential-less session config:GetSessionTokenrejects the temporary credentials the default chain hands back, so the pod-identity path would otherwise fail. Customer-supplied long-term static keys still go through STSGetSessionTokenas before.Why
Only the
useRudderStorageflow should stop using the shared copy user — that flow targets RudderStack-owned buckets and should authenticate via pod identity (IRSA). The non-rudder-storage flow is different: our customers explicitly grant the copy user write access to their S3 bucket for the case where they configure no IAM role or access keys, so removing the fallback there would break delivery to those destinations.Infra pre-conditions
rudder-warehouse-storage*, so theuseRudderStorageupload/COPY flow authenticates via the AWS SDK default credential chain with no further infra change.RUDDER_AWS_S3_COPY_USER_ACCESS_KEY_ID/KEYmust remain configured, since the non-rudder-storage fallback still consumes them.Tests
TestGetObjectStorageConfig,TestGetRudderObjectStorageConfig(utils/misc),TestCreateAWSSessionConfig(warehouse/utils). They assert that the rudder-storage flow injects no static creds, and that the non-rudder-storage flow falls back to the copy-user credentials when no role/keys are present.useRudderStoragewarehouse integration cases for redshift and snowflake. Instead of the app-specific copy-user envs, they now supply genericAWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEYenvs so the AWS SDK default credential chain resolves them automatically — exercising the same credential path theuseRudderStorageflow uses in production (pod identity / IRSA).useRudderStoragecase too. Deltalake's COPY runs on Databricks via the S3ATemporaryAWSCredentialsProvider, which requires a non-empty session token. In production theuseRudderStoragepath uses IRSA/pod-identity, whose default-chain credentials are already temporary and carry a session token. The test mirrors this: it mints a session token from the static test keys via STSGetSessionTokenand exports it through the standardAWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY/AWS_SESSION_TOKENenvs — no app-specific credential env reintroduced.go build ./...andgo vetclean across affected packages.🤖 Generated with Claude Code