CKV_AWS_111 - cloudformation check cloudwatch:PutMetricData
See original GitHub issueDescribe the bug
When running checkov against a cloudformation template with an IAM policy including the action cloudwatch:PutMetricData
and a condition limiting the action to a specific namepace, the CKV_AWS_111
rule is triggered. Since PutMetricData doesn’t support limiting by a resource, the condition seems like it should be a sufficient control to limit write access.
To Reproduce Steps to reproduce the behavior:
- Create a Cloudformation template containing a policy that looks like:
- Sid: AllowPutMetricData
Effect: Allow
Action:
- cloudwatch:PutMetricData
Resource: "*"
Condition:
StringEquals:
cloudwatch:namespace: Namespace
- Run
checkov -d </path/to/cloudformation> --quiet
- You should see checkov flag the policy as a violation of
CKV_AWS_111
Expected behavior
I expect checkov to consider that policy valid for the CKV_AWS_111
rule.
Desktop (please complete the following information):
- OS: MacOS
- Checkov Version 1.0.844
Thanks ahead of time for reviewing this and thanks for the awesome tool!
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:6 (3 by maintainers)
Top Results From Across the Web
CloudWatch::Alarm MetricDataQuery - AWS CloudFormation
The MetricDataQuery property type specifies the metric data to return, and whether this call is just retrieving a batch set of data for...
Read more >Adding Custom Metric to CloudFormation template
You can use cloudformation simple template to add metrics. resource "AWS::Logs::MetricFilter" specifies a metric filter that describes how ...
Read more >Amazon CloudFormation template for setting up the Route 53 ...
When using global endpoints you have to have a Route 53 health check to monitor the status of your Regions. The following template...
Read more >AWS CloudFormation Templates - Check Point Support Center
The table below lists CloudFormation templates provided and maintained by Check Point that simplify the deployment of Check Point security ...
Read more >aws-cloudformation/cfn-lint: CloudFormation Linter - GitHub
Includes checking valid values for resource properties and best practices. Warning. This is an attempt to provide validation for AWS CloudFormation templates ...
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
@schosterbarak I like that idea from @yi2020 too. If you want to contribute that to Cloudsplaining, we can fix it in both places!
@kmcquade our approach with Cloudrail has been to assume that if there are conditions, it’s not really *. We do in some cases dig through the condition to see if it really limits anything, but the amount of logic required was insane.