You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ECRDeployment construct always adds a default policy (below) that contains wildcard permissions to the ECR deployment role, even if a custom role is passed to the construct. This unfortunately fails CDK-nag security checks, and requires suppression rules.
I would like to be able to implement least-privilege IAM policies i.e. limit IAM actions to the specific repo/s3 bucket arn.
If a custom role is passed, I expect as the default behavior to not have any additional policies added to the role.
Even apart from the permissions themselves, I'm having trouble suppressing the generated CDK-Nag errors - I think because of the use of a Singleton Lambda? For example the below within a Construct does not suppress the error:
constdeployment=newecrDeploy.ECRDeployment(this,"Deployment",{...});NagSuppressions.addResourceSuppressions(deployment,[{id: "AwsSolutions-IAM4",reason: "Can't control managed policies within ECRDeployment resource",},{id: "AwsSolutions-IAM5",reason: "Can't control wildcard policies within ECRDeployment resource",},],true,// Even with applyToChildren=true);
...Because the generated resource that causes the violation is at:
...NOT under the deployment construct itself or even the this parent construct that creates it.
Since ECRDeployment.handler is private, I can't find any more granular way than to suppress the errors on cdk.Stack.of(this) with applyToChildren=true: Ignoring ALL IAM4 and IAM5 violations on the entire (nested) stack.
I understand this could be worked around by passing a custom role, but has anybody found a good way to suppress the CDK-Nag warnings when allowing ECRDeployment to create its own singleton role?
ECRDeployment construct always adds a default policy (below) that contains wildcard permissions to the ECR deployment role, even if a custom role is passed to the construct. This unfortunately fails CDK-nag security checks, and requires suppression rules.
I would like to be able to implement least-privilege IAM policies i.e. limit IAM actions to the specific repo/s3 bucket arn.
If a custom role is passed, I expect as the default behavior to not have any additional policies added to the role.
The text was updated successfully, but these errors were encountered: