-
Notifications
You must be signed in to change notification settings - Fork 4.3k
feat(iam): add feature flag to validate PolicyStatement SID is alphanumeric #36150
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
camerondurham
wants to merge
4
commits into
aws:main
Choose a base branch
from
camerondurham:feat/iam-sid-validation-flag-main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
feat(iam): add feature flag to validate PolicyStatement SID is alphanumeric #36150
camerondurham
wants to merge
4
commits into
aws:main
from
camerondurham:feat/iam-sid-validation-flag-main
+1,119
−0
Conversation
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
aws-cdk-automation
previously requested changes
Nov 21, 2025
Collaborator
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(This review is outdated)
Author
|
Will fix later today after work. |
This was referenced Nov 21, 2025
…umeric - Add IAM_POLICY_STATEMENT_VALIDATE_SID feature flag - Validate SIDs are alphanumeric (A-Z, a-z, 0-9) when flag enabled - Fix invalid SIDs in aws-ecs cluster.ts - Add comprehensive test coverage for SID validation - Add README documentation and integ test Closes aws#34819
5860098 to
78f1ade
Compare
✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.
1 task
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
beginning-contributor
[Pilot] contributed between 0-2 PRs to the CDK
bug
This issue is a bug.
effort/medium
Medium work item – several days of effort
p2
pr/needs-community-review
This PR needs a review from a Trusted Community Member or Core Team Member.
pr/needs-further-review
PR requires additional review from our team specialists due to the scope or complexity of changes.
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.
Resolves #34819 by throwing error when PolicyStatement Statement id contains characters not allowed by the API.
Note this does duplicate #34828. I realized that PR makes too many changes to existing integ tests. This change is intended to be less intrusive.
Reference: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_sid.html
Issue # (if applicable)
Closes #34819
Reason for this change
CDK build allows users to write invalid statement ids containing dashes when building policy statements, then failed on deployment. To reduce time to a successful deployment, I believe the CDK should throw an exception at build time to help user make a fix locally before a failed deployment.
Description of changes
Validate that statement id matches requirements specified in https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_sid.html in the constructor.
Add tests that verify only valid statement ids are set in constructor.
Describe any new or updated permissions being added
n/a
Description of how you validated changes
yes, added unit tests
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license