Repository navigation
feat(s3): add OIDC auth via aws-role-arn, unify credentials - #4
Merged
Merged
Conversation
igorjs
force-pushed
the
feat/enterprise-hardening-s3-policy-gate
branch
2 times, most recently
from
September 7, 2026 04:08
a996500 to
5599882
Compare
Adds aws-role-arn and aws-role-session-name inputs. access-key-id and secret-access-key become input-level optional, with explicit bash-level validation replacing the implicit GitHub Actions required check. For backend s3, aws-role-arn selects OIDC auth mode; setting it alongside either static key fails loud. Without aws-role-arn, both static keys are required (static mode), matching prior implicit behavior but now explicit. For backend r2, static keys remain unconditionally required now that the input-level required: true is gone. Adds an auth-mode output (oidc or static) for downstream consumption. Signed-off-by: igorjs <2278164+igorjs@users.noreply.github.com>
Add a dedicated Configure credentials step branching on steps.validate.outputs.auth-mode from WU-6: the OIDC branch invokes aws-actions/configure-aws-credentials, the static branch exports AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY via $GITHUB_ENV. Remove the three duplicated per-step env blocks from Init, Plan, and Apply so they no longer shadow the ambient credentials with empty strings when running in OIDC mode. Signed-off-by: igorjs <2278164+igorjs@users.noreply.github.com>
Add an OIDC for AWS S3 README section covering aws-role-arn/aws-role-session-name, the additive-not-replacement relationship with static keys, the loud validation error when both are set, a trust policy example, and the required id-token: write permission. Add matching rows to the Inputs table. Add a commented-out OIDC with:/permissions: variant to examples/plan-apply.yml for both the plan and apply jobs. Add a CHANGELOG entry under Unreleased. Signed-off-by: igorjs <2278164+igorjs@users.noreply.github.com>
igorjs
force-pushed
the
feat/enterprise-hardening-s4-oidc
branch
from
September 7, 2026 04:11
7ee0a2a to
73005b2
Compare
igorjs
changed the base branch from
feat/enterprise-hardening-s3-policy-gate
to
main
September 7, 2026 04:11
- Add AWS_SESSION_TOKEN to both policy-command credential-isolation unset calls, since OIDC auth also exports a live STS session token - Reject aws-role-arn set together with backend r2 instead of silently ignoring it, matching the fail-loud-on-conflict philosophy - Add an aws_role_arn param to resolve_backend and assert_backend_fails test helpers, with a new scenario covering the r2 rejection - Update the policy-command regression test to require all three AWS credential variables in the unset call Signed-off-by: igorjs <2278164+igorjs@users.noreply.github.com>
igorjs
force-pushed
the
feat/enterprise-hardening-s4-oidc
branch
from
September 7, 2026 04:18
73005b2 to
208fdf5
Compare
igorjs
marked this pull request as ready for review
September 7, 2026 04:18
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
Long-lived AWS keys in repo secrets are a standing credential risk, and GitHub's OIDC token lets a workflow assume an IAM role instead. This adds that path for the
s3backend, and along the way fixes a latent bug: three duplicated per-stepenv:blocks would have silently overridden OIDC-exported credentials with empty strings.What Changed
aws-role-arnandaws-role-session-nameinputs select OIDC auth forbackend: s3viaaws-actions/configure-aws-credentials, instead of staticaccess-key-id/secret-access-key.aws-role-arntogether with the static keys fails loud with a validation error instead of picking one silently.r2has no OIDC equivalent and stays static-key only.env:blocks on Init, Plan, and Apply with one unified credential-configuring step. The old per-step blocks would have re-setAWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEYto empty strings on every step, clobbering whatever OIDC had just exported.permissions: id-token: write, and a minimalwith:block, plus a commented-out OIDC alternative in the example workflow.Notes for reviewers
env:blocks remain, and a grep confirming the OIDC step selectsaws-actions/configure-aws-credentials. Both are now intests/action-logic.sh.feat/enterprise-hardening-s3-policy-gate(PR feat: add policy-as-code gate at plan-time and apply-time #3, already open).Related work
feat/enterprise-hardening-s3-policy-gate).