Skip to content

Conversation

@tmekari
Copy link
Contributor

@tmekari tmekari commented Mar 10, 2023

Description of changes:
Added IAM Perms to CloudFormation.1 remediation to fix issue with nested stacks.

Verified failure before fix, tested and deployed fix, and verified that it succeeded on the same stack.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

iamPerms.addActions('iam:GetRole');
iamPerms.effect = Effect.ALLOW;
iamPerms.addResources(
`arn:${this.partition}:iam::${this.account}:role/${remediationRoleNameBase}${remediationName}`
Copy link
Contributor

Choose a reason for hiding this comment

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

no change needed: this file is written in the style of crafting policies explicitly. CDK offers another way to manage permissions called grants: https://docs.aws.amazon.com/cdk/v2/guide/permissions.html

I think for new code we should try to use that method since you don't have to craft the whole policy and build the arn pattern, you just say role.grant(role, 'GetRole');, I think.

@tmekari tmekari merged commit b158b46 into develop Mar 10, 2023
@tmekari tmekari deleted the bugfix/cloudFormation1IAMPerms branch March 10, 2023 21:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants