-
Notifications
You must be signed in to change notification settings - Fork 4k
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
(aws-iam): PermissionsBoundary Not Added to Custom Resource roles #13310
Comments
@joel-aws I believe it's because the role attached to the custom resource is not actually an Reference: #12323 (comment) |
…14754) The role created by `CustomResourceProvider` is a `CfnResource` with a manual type, not a `CfnRole` to avoid a cyclical dependency. But since `PermissionBoundary` assumes all role/user resources in scope are instances of `CfnRole` or `CfnUser`, a permission boundary is not correctly applied to the custom resource's role (or any other role or user created directly through `CfnResource`). This PR solves the above problem by adding extra conditionals for the `CfnResource` case and adds permission boundaries through the `addPropertyOverride` escape hatch. fixes #13310 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
…ws#14754) The role created by `CustomResourceProvider` is a `CfnResource` with a manual type, not a `CfnRole` to avoid a cyclical dependency. But since `PermissionBoundary` assumes all role/user resources in scope are instances of `CfnRole` or `CfnUser`, a permission boundary is not correctly applied to the custom resource's role (or any other role or user created directly through `CfnResource`). This PR solves the above problem by adding extra conditionals for the `CfnResource` case and adds permission boundaries through the `addPropertyOverride` escape hatch. fixes aws#13310 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
When applying a Permissions Boundary to a stack, not all roles in the CFn include
PermissionsBoundary
.Reproduction Steps
What did you expect to happen?
In the outputted CFn, I expected all roles to have their Permissions Boundary set.
What actually happened?
Two roles were created: one defined and the other automatically created as a result of setting
auto_delete_objects=True
in the S3 construct. Only the first role had the Permissions Boundary set; the second did not.Environment
Other
As pointed out by @ottokruse in #3242 (comment), you can work around this by creating an aspect that checks the following conditions:
This is 🐛 Bug Report
The text was updated successfully, but these errors were encountered: