ci(scratch-aws-access): tag AssumeRole sessions with --source-identity#36639
Draft
jasonhernandez wants to merge 1 commit into
Draft
ci(scratch-aws-access): tag AssumeRole sessions with --source-identity#36639jasonhernandez wants to merge 1 commit into
jasonhernandez wants to merge 1 commit into
Conversation
The plugin currently calls AssumeRole with a fixed role-session-name `ci`, so CloudTrail can't attribute a session to a specific job — every CI run's session looks identical. Adding `--source-identity "$BUILDKITE_JOB_ID"` makes each session uniquely traceable in CloudTrail and lets us write role-trust conditions on `sts:RoleSessionName` / `sts:SourceIdentity` later. Coordination: requires the `mz-scratch-ci-role` trust policy in i2 to allow `sts:SetSourceIdentity` action. Without that, `aws sts assume-role --source-identity ...` fails with AccessDenied. The i2 PR adding that allowance must land first. Tracking: i2 SEC-573 / SEC-566 audit. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Every CI session today appears in CloudTrail under role-session-name `ci` — indistinguishable from every other CI session. Adding `--source-identity "$BUILDKITE_JOB_ID"` makes each AssumeRole call attributable to a specific job, and unlocks future trust-policy conditions on `sts:SourceIdentity` (e.g., "only this build-step can use this role").
Coordination
This requires a paired i2 PR that allows the `sts:SetSourceIdentity` action in the `mz-scratch-ci-role` trust policy — see `MaterializeInc/i2` PR (TBD). Without that allowance, this AssumeRole call fails with `AccessDenied`. Land the i2 PR first.
Tracking: i2 SEC-573 / SEC-566 audit.
Test plan
🤖 Generated with Claude Code