Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AWS::WAFv2::WebACL RateBasedStatement Limit Validation #1446

Closed
andrewdieken opened this issue Mar 27, 2020 · 2 comments · Fixed by #1507
Closed

AWS::WAFv2::WebACL RateBasedStatement Limit Validation #1446

andrewdieken opened this issue Mar 27, 2020 · 2 comments · Fixed by #1507
Labels
good first issue Good for newcomers

Comments

@andrewdieken
Copy link

cfn-lint version: 0.29.2

Description of issue.
When creating a WAF rule that includes a RateBasedStatement there is no validation done on the value set for the Limit. It wasn't until deploying the CloudFormation template that I received an error:
Model validation failed (#/Rules: 3 schema violations found) #/Rules/4/Statement/RateBasedStatement/Limit: failed validation constraint for keyword [minimum] (#/Rules/4/Statement/RateBasedStatement/Limit) #/Rules/5/Statement/RateBasedStatement/Limit: failed validation constraint for keyword [minimum] (#/Rules/5/Statement/RateBasedStatement/Limit) #/Rules/6/Statement/RateBasedStatement/Limit: failed validation constraint for keyword [minimum] (#/Rules/6/Statement/RateBasedStatement/Limit)

The error is due to my Limit value being set below the minimum value allowed. I was able to find this info after attempting to create my rule through the AWS console where I noticed they had a note:
Screen Shot 2020-03-12 at 7 40 14 PM

A note about it can also be found here: https://aws.amazon.com/about-aws/whats-new/2019/08/lower-threshold-for-aws-waf-rate-based-rules/

Note that there is nothing mentioned about the minimum / maximum limit anywhere in the CloudFormation documentation: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-wafv2-webacl-ratebasedstatementone.html

Feature request.
I'm suggesting that validation be added to ensure the Limit value is set between the minimum, 100, and maximum, 20000000, limit. This small feature will be extremely valuable for users due to the lack of CloudFormation documentation, and hopefully save people quite a bit of time!

@PatMyron PatMyron added the good first issue Good for newcomers label Mar 27, 2020
@andrewdieken
Copy link
Author

andrewdieken commented Mar 30, 2020

@PatMyron correct, this applies to both AWS::WAFv2::RuleGroup.RateBasedStatementOne and AWS::WAFv2::RuleGroup.RateBasedStatementTwo

What should next steps be? Should I open a PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants