question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CKV_AWS_107: aws_iam_policy for action ecr:GetAuthorizationToken with resource "*"

See original GitHub issue

Is your feature request related to a problem? Please describe. We have an aws iam policy with the following statement: statement { actions = [ "ecr:GetAuthorizationToken" ] resources = [ "*" ] }

checkov fails here with the message CKV_AWS_107: “Ensure IAM policies does not allow credentials exposure” but according to the aws documentation we found (https://docs.aws.amazon.com/AmazonECR/latest/public/security_iam_id-based-policy-examples.html) we need to set resources = “*”.

Describe the solution you’d like Is it possible to change the check CKV_AWS_107 to allow the above action with resources = “*”?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:3
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

6reactions
schosterbarakcommented, Mar 18, 2021

@kmcquade so we would probably want to exclude that if the resource is attached to ECR but to alarm for the rest. We don’t have that capability yet, but should be available from soon where we will enable resource graph queries in checkov. I’ll keep this ticket open for now and will update once the implementation is done

0reactions
schosterbarakcommented, May 15, 2021

Thanks @kmcquade !

Read more comments on GitHub >

github_iconTop Results From Across the Web

Actions, resources, and condition keys for Amazon Elastic ...
Actions Description Access level CreateRepository Grants permission to create an image repository Write DeleteRegistryPolicy Grants permission to delete the registry policy Permissions manage... GetRegistryPolicy Grants permission...
Read more >
AWS ECR GetAuthorizationToken - Stack Overflow
To make the policy tight, you can grant all actions only to the desired registry and only the ecr:GetAuthorizationToken to all resources.
Read more >
ERROR: Is not authorized to perform: <ACTION> on resource ...
ERROR: Is not authorized to perform: <ACTION> on resource: * with an ... Event needs-retry.ecr.GetAuthorizationToken: calling handler <bound ...
Read more >
ecr:GetAuthorizationToken - Amazon EC2 Container Registry
ecr:GetAuthorizationToken. Retrieves a token that is valid for a specified registry for 12 hours. Open AWS documentation ; Supported Resource-Level Permissions.
Read more >
aws_ecr_repository_policy | Resources | hashicorp/aws
Resource : aws_ecr_repository_policy. Provides an Elastic Container Registry Repository Policy. Note that currently only one policy may be applied to a ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found