fix(iac): enforce AWS CLI federation guard parity - #459
Merged
Merged
Conversation
Reject invalid federation inputs before AWS calls and require an exact, readable OIDC provider with the requested audience before creating roles. Use AWS thumbprint retrieval and preserve rendered audience defaults. Exercise rendered Bash with local CLI stubs, including lookup failures, lookalike providers, invalid thumbprints, and literal JSON claims. Refs #91
Contributor
|
Warning Review limit reached
This review includes 3 billable files and costs up to $0.75.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Or wait 28 minutes for your next included review. View limit detailsLimit details: You’ve used the included review currently available. Your 70 included PR review attempts over the past 7 days set your current allowance at 1 review per hour. Review configuration: ⚙️ Run configurationConfiguration used: Repository: LeanerCloud/cloud-commitments-platform/.coderabbit.yaml Review profile: CHILL Plan: Essentials Run ID: 📒 Files selected for processing (3)
Comment |
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.
AWS CLI onboarding could reuse a lookalike OIDC provider, continue after lookup failures, and create a provider with an all-zero thumbprint. This change requires an exact provider match and validates its URL, audience and thumbprints before role creation. It rejects invalid claims before AWS calls, preserves rendered audience defaults, builds trust JSON with jq, and lets AWS retrieve the thumbprint when creating a provider.
Refs #91. This PR covers only AWS CLI WIF task 1. Issue #91 remains open for Azure CLI credential handling, GCP issuer parity, Azure Bicep/ARM role parity, host prerequisites including #131, and cross-path CI/documentation plus shared AWS issuer URL hardening. Issuer validation here mirrors the existing Terraform rule; it is not full URL hardening.
Validation: generated Bash regression tests fail against the original template and pass after the fix; affected package race tests, build, vet, pinned golangci-lint 2.10.1, rendered ShellCheck and pre-commit hooks pass. Independent review approved exact commit 944b87e and reran the complete iacfiles race suite successfully.
Verification uses local recording AWS/curl stubs and real jq. It proves script control flow, arguments and JSON, not live AWS acceptance. No cloud resources were changed.