CKV_AWS_107: aws_iam_policy for action ecr:GetAuthorizationToken with resource "*"
See original GitHub issueIs 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:
- Created 3 years ago
- Reactions:3
- Comments:6 (4 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@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
Thanks @kmcquade !