chore(ci): Update AWS credentials configuration in workflows - #88
Conversation
|
Note Gemini is unable to generate a summary for this pull request due to the file types involved not being currently supported. |
WalkthroughThree GitHub Actions workflows switch AWS authentication from static access keys to OIDC role-assumption ( Changes
Sequence Diagram(s)sequenceDiagram
participant GH as GitHub Actions
participant OIDC as GitHub OIDC Provider
participant AWS as AWS STS
participant Action as configure-aws-credentials step
rect rgb(235,245,255)
Note over GH,OIDC: New permission: id-token: write
end
GH->>OIDC: Request ID token (repo & workflow)
OIDC->>GH: Return ID token
GH->>AWS: AssumeRoleWithWebIdentity(ID token, role-to-assume)
AWS-->>GH: Temporary credentials (AccessKey, Secret, SessionToken)
GH->>Action: Provide temporary creds + region (from AWS_REGION secret)
Action-->>GH: AWS client configured (calls to AWS use assumed role)
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Possibly related PRs
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (2)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
🔇 Additional comments (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull Request Overview
This PR migrates AWS authentication from static credentials to IAM role assumption using OIDC (OpenID Connect) for improved security across all GitHub Actions workflows.
- Replaced
aws-access-key-idandaws-secret-access-keywithrole-to-assumeparameter - Removed quotes from
aws-regionvalue for consistency - Applied changes uniformly across tests, publish, and coverage-report workflows
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| .github/workflows/tests.yml | Updated AWS authentication to use IAM role assumption instead of static credentials |
| .github/workflows/publish.yml | Updated AWS authentication to use IAM role assumption instead of static credentials |
| .github/workflows/coverage-report.yml | Updated AWS authentication to use IAM role assumption and removed trailing whitespace |
Comments suppressed due to low confidence (1)
.github/workflows/publish.yml:14
- The
id-token: writepermission is already present in this workflow, which is required for OIDC authentication with AWS. Ensure that the same permission is added to.github/workflows/tests.ymland.github/workflows/coverage-report.ymlas they are now using role-to-assume but may lack the necessary OIDC permission.
id-token: write # Required for OIDC
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
.github/workflows/tests.yml (1)
3-6: Add requiredid-token: writepermission for OIDC.The permissions block is missing
id-token: write, which is required for OIDC federation. Without this permission, theconfigure-aws-credentialsstep cannot generate the OIDC token needed to assume the IAM role, causing the workflow to fail when attempting AWS Parameter Store access.permissions: checks: write pull-requests: write contents: read + id-token: write
🧹 Nitpick comments (1)
.github/workflows/coverage-report.yml (1)
44-44: Remove trailing whitespace from step name.Line 44 contains trailing spaces after the step name that should be trimmed for consistency.
- - name: 🪙 Collect Coins (Configure AWS credentials) + - name: 🪙 Collect Coins (Configure AWS credentials)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
.github/workflows/coverage-report.yml(1 hunks).github/workflows/publish.yml(1 hunks).github/workflows/tests.yml(1 hunks)
🔇 Additional comments (3)
.github/workflows/publish.yml (1)
57-62: Verify region configuration aligns with PR objectives.The implementation uses a hardcoded region (
eu-west-1at line 62), but the PR objectives state the workflow should retrieve the region from theAWS_REGIONsecret. Clarify whether the region should be externalized to a secret as intended or if hardcoding is intentional for this environment..github/workflows/coverage-report.yml (1)
44-48: Verify region configuration aligns with PR objectives.Similar to publish.yml, this workflow uses hardcoded
eu-west-1instead of theAWS_REGIONsecret mentioned in the PR objectives. Ensure consistency across all workflows and clarify the intent..github/workflows/tests.yml (1)
48-52: Verify region configuration aligns with PR objectives.Like the other workflows, this uses hardcoded
eu-west-1instead of theAWS_REGIONsecret mentioned in PR objectives. Ensure the region configuration strategy is consistent across all three workflows.
Pull Request
What does this PR do?
This PR migrates the GitHub Actions workflow from using static AWS credentials to OpenID Connect (OIDC) authentication, significantly enhancing security by eliminating the need to store long-lived AWS credentials as secrets. The workflow now uses
aws-actions/configure-aws-credentials@v5with role assumption through OIDC federation, following AWS security best practices. Additionally, the AWS region is now externalized to GitHub Secrets for better configuration management.Related issues
Type of change
Checklist
Notes for reviewer
Security Improvements:
AWS_ROLE_TO_ASSUME)AWS_REGION) for better configuration management and flexibilityImplementation Details:
aws-actions/configure-aws-credentials@v5actionPrerequisites:
AWS_ROLE_TO_ASSUME: IAM role ARN with test Parameter Store permissionsAWS_REGION: AWS region (e.g.,eu-west-1)This change follows GitHub's recommended security practices for AWS authentication and eliminates the risk associated with credential leakage or rotation. Externalizing the region to secrets also improves configuration flexibility and consistency across workflows.
Summary by CodeRabbit