Skip to content
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

fix(iam): permissions boundaries not added to custom resource roles #14754

Merged
merged 2 commits into from
May 20, 2021

Conversation

BenChaimberg
Copy link
Contributor

@BenChaimberg BenChaimberg commented May 18, 2021

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

@gitpod-io
Copy link

gitpod-io bot commented May 18, 2021

@BenChaimberg BenChaimberg requested a review from rix0rrr May 18, 2021 23:47
@BenChaimberg BenChaimberg marked this pull request as ready for review May 18, 2021 23:47
@mergify mergify bot added the contribution/core This is a PR that came from AWS. label May 18, 2021
@mergify
Copy link
Contributor

mergify bot commented May 20, 2021

Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject89A8053A-LhjRyN9kxr8o
  • Commit ID: 24b45a9
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mergify mergify bot merged commit f36feb5 into master May 20, 2021
@mergify mergify bot deleted the chaimber/permission_cfn_resource branch May 20, 2021 12:08
@mergify
Copy link
Contributor

mergify bot commented May 20, 2021

Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

hollanddd pushed a commit to hollanddd/aws-cdk that referenced this pull request Aug 26, 2021
…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*
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution/core This is a PR that came from AWS.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

(aws-iam): PermissionsBoundary Not Added to Custom Resource roles
3 participants