-
Notifications
You must be signed in to change notification settings - Fork 7
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
fix: Remove rate limiting WAF on api domain url #889
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
⚠ Terrform update availableTerraform: 1.9.8 (using 1.9.2)
Terragrunt: 0.68.12 (using 0.63.2) |
Staging: load_balancer✅ Terraform Init: Plan: 0 to add, 1 to change, 0 to destroy Show summary
Show planResource actions are indicated with the following symbols:
~ update in-place
Terraform will perform the following actions:
# aws_wafv2_rule_group.rate_limiters_group will be updated in-place
~ resource "aws_wafv2_rule_group" "rate_limiters_group" {
id = "51f888d4-a82d-4c56-8031-0da78ea6df8c"
name = "RateLimitersGroup"
tags = {}
# (7 unchanged attributes hidden)
- rule {
- name = "BlanketRequestLimit" -> null
- priority = 1 -> null
- action {
- block {
}
}
- statement {
- rate_based_statement {
- aggregate_key_type = "IP" -> null
- evaluation_window_sec = 300 -> null
- limit = 2500 -> null
}
}
- visibility_config {
- cloudwatch_metrics_enabled = true -> null
- metric_name = "BlanketRequestLimit" -> null
- sampled_requests_enabled = true -> null
}
}
- rule {
- name = "PostRequestLimit" -> null
- priority = 2 -> null
- action {
- block {
}
}
- statement {
- rate_based_statement {
- aggregate_key_type = "IP" -> null
- evaluation_window_sec = 300 -> null
- limit = 100 -> null
- scope_down_statement {
- byte_match_statement {
- positional_constraint = "EXACTLY" -> null
- search_string = "post" -> null
- field_to_match {
- method {}
}
- text_transformation {
- priority = 1 -> null
- type = "LOWERCASE" -> null
}
}
}
}
}
- visibility_config {
- cloudwatch_metrics_enabled = true -> null
- metric_name = "PostRequestRateLimit" -> null
- sampled_requests_enabled = true -> null
}
}
+ rule {
+ name = "BlanketRequestLimit"
+ priority = 1
+ action {
+ block {
}
}
+ statement {
+ rate_based_statement {
+ aggregate_key_type = "IP"
+ evaluation_window_sec = 300
+ limit = 2500
+ scope_down_statement {
+ not_statement {
+ statement {
+ byte_match_statement {
+ positional_constraint = "EXACTLY"
+ search_string = "api.forms-staging.cdssandbox.xyz"
+ field_to_match {
+ single_header {
+ name = "host"
}
}
+ text_transformation {
+ priority = 1
+ type = "LOWERCASE"
}
}
}
}
}
}
}
+ visibility_config {
+ cloudwatch_metrics_enabled = true
+ metric_name = "BlanketRequestLimit"
+ sampled_requests_enabled = true
}
}
+ rule {
+ name = "PostRequestLimit"
+ priority = 2
+ action {
+ block {
}
}
+ statement {
+ rate_based_statement {
+ aggregate_key_type = "IP"
+ evaluation_window_sec = 300
+ limit = 100
+ scope_down_statement {
+ and_statement {
+ statement {
+ not_statement {
+ statement {
+ byte_match_statement {
+ positional_constraint = "EXACTLY"
+ search_string = "api.forms-staging.cdssandbox.xyz"
+ field_to_match {
+ single_header {
+ name = "host"
}
}
+ text_transformation {
+ priority = 1
+ type = "LOWERCASE"
}
}
}
}
}
+ statement {
+ byte_match_statement {
+ positional_constraint = "EXACTLY"
+ search_string = "post"
+ field_to_match {
+ method {}
}
+ text_transformation {
+ priority = 1
+ type = "LOWERCASE"
}
}
}
}
}
}
}
+ visibility_config {
+ cloudwatch_metrics_enabled = true
+ metric_name = "PostRequestRateLimit"
+ sampled_requests_enabled = true
}
}
# (1 unchanged block hidden)
}
Plan: 0 to add, 1 to change, 0 to destroy.
─────────────────────────────────────────────────────────────────────────────
Saved the plan to: plan.tfplan
To perform exactly these actions, run the following command to apply:
terraform apply "plan.tfplan"
Show Conftest resultsWARN - plan.json - main - Missing Common Tags: ["aws_acm_certificate.form_viewer"]
WARN - plan.json - main - Missing Common Tags: ["aws_acm_certificate.form_viewer_maintenance_mode"]
WARN - plan.json - main - Missing Common Tags: ["aws_acm_certificate.forms_api"]
WARN - plan.json - main - Missing Common Tags: ["aws_alb_listener_rule.forms_api"]
WARN - plan.json - main - Missing Common Tags: ["aws_cloudfront_distribution.maintenance_mode"]
WARN - plan.json - main - Missing Common Tags: ["aws_iam_role.firehose_waf_logs"]
WARN - plan.json - main - Missing Common Tags: ["aws_kinesis_firehose_delivery_stream.firehose_waf_logs"]
WARN - plan.json - main - Missing Common Tags: ["aws_lb.form_viewer"]
WARN - plan.json - main - Missing Common Tags: ["aws_lb_listener.form_viewer_http"]
WARN - plan.json - main - Missing Common Tags: ["aws_lb_listener.form_viewer_https"]
WARN - plan.json - main - Missing Common Tags: ["aws_lb_target_group.form_viewer_1"]
WARN - plan.json - main - Missing Common Tags: ["aws_lb_target_group.form_viewer_2"]
WARN - plan.json - main - Missing Common Tags: ["aws_lb_target_group.forms_api"]
WARN - plan.json - main - Missing Common Tags: ["aws_s3_bucket.maintenance_mode"]
WARN - plan.json - main - Missing Common Tags: ["aws_s3_object.maintenance_static_page_css_files[\"style.css\"]"]
WARN - plan.json - main - Missing Common Tags: ["aws_s3_object.maintenance_static_page_html_files[\"index-fr.html\"]"]
WARN - plan.json - main - Missing Common Tags: ["aws_s3_object.maintenance_static_page_html_files[\"index.html\"]"]
WARN - plan.json - main - Missing Common Tags: ["aws_s3_object.maintenance_static_page_ico_files[\"favicon.ico\"]"]
WARN - plan.json - main - Missing Common Tags: ["aws_s3_object.maintenance_static_page_svg_files[\"site-unavailable.svg\"]"]
WARN - plan.json - main - Missing Common Tags: ["aws_shield_protection.alb"]
WARN - plan.json - main - Missing Common Tags: ["aws_shield_protection.route53_hosted_zone[0]"]
WARN - plan.json - main - Missing... |
patheard
approved these changes
Nov 13, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary | Résumé
Removes the blanket and POST rate limiting on the API Server URL that is co-hosted with the GCForms app in ECS and share the same Load Balancer and WAF Rules.
The API remains protected through it's own implementation of Token Bucket Rate Limiting.