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): policy added to resource for immutable Role #5568

Merged
merged 3 commits into from
Dec 27, 2019

Conversation

rix0rrr
Copy link
Contributor

@rix0rrr rix0rrr commented Dec 27, 2019

addToPolicy() is supposed to return true or false indicating
whether the policy was added to an identity for the purposes of
determining whether it should be added to a resource policy instead.

It's an error if a Grant can't be added to the identity and it can't
be added to the resource (because the resource doesn't support resource
policies).

Immutable roles should return true (even though they didn't actually
add the statement to any policy), because we assume the user already
put the right permissions on the identity, so we pretend the add worked.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

`addToPolicy()` is supposed to return `true` or `false` indicating
whether the policy was added to an identity for the purposes of
determining whether it should be added to a resource policy instead.

It's an error if a `Grant` can't be added to the identity *and* it can't
be added to the resource (because the resource doesn't support resource
policies).

Immutable roles should return `true` (even though they didn't actually
add the statement to any policy), because we assume the user already
put the right permissions on the identity, so we pretend the add worked.
@rix0rrr rix0rrr requested a review from skinny85 December 27, 2019 13:48
@rix0rrr rix0rrr self-assigned this Dec 27, 2019
@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Dec 27, 2019
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

Copy link
Contributor

@skinny85 skinny85 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@mergify
Copy link
Contributor

mergify bot commented Dec 27, 2019

Thank you for contributing! Your pull request is now being automatically merged.

@mergify
Copy link
Contributor

mergify bot commented Dec 27, 2019

Thank you for contributing! Your pull request is now being automatically merged.

@mergify mergify bot merged commit 950a5f7 into master Dec 27, 2019
@mergify mergify bot deleted the huijbers/iam-immutable-add branch December 27, 2019 17:33
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

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

@eladb
Copy link
Contributor

eladb commented Dec 29, 2019

Maybe in v2.0 we should return an enum instead of a boolean, so it will be more readable.

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.

4 participants