Skip to content

Commit

Permalink
Rationalise ratelimit exemption rules.
Browse files Browse the repository at this point in the history
Make it clearer as to what the rule does.
  • Loading branch information
sengi committed Dec 14, 2023
1 parent 7fbfe96 commit 645d041
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions terraform/projects/infra-public-wafs/cache_public_rule.tf
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ resource "aws_wafv2_ip_set" "govuk_requesting_ips" {
addresses = concat(var.traffic_replay_ips, local.nat_gateway_ips, var.eks_egress_ips)
}

resource "aws_wafv2_ip_set" "external_partner_ips" {
name = "external_partner_ips"
description = "The IP addresses are used by our partners."
resource "aws_wafv2_ip_set" "high_request_rate" {
name = "high_request_rate"
description = "Source addresses from which we allow a higher ratelimit."
scope = "REGIONAL"
ip_address_version = "IPV4"
addresses = var.allow_external_ips
addresses = var.allow_high_request_rate_from_cidrs
}

resource "aws_cloudwatch_log_group" "public_cache_waf" {
Expand Down
4 changes: 2 additions & 2 deletions terraform/projects/infra-public-wafs/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,9 @@ variable "eks_egress_ips" {
description = "An array of CIDR blocks for the corresponding EKS environment's NAT gateway IPs"
}

variable "allow_external_ips" {
variable "allow_high_request_rate_from_cidrs" {
type = list(string)
description = "An array of CIDR blocks that are our partners using to send traffic to us"
description = "Source IP netblocks from which we allow a higher rate of requests."
}

variable "waf_log_retention_days" {
Expand Down

0 comments on commit 645d041

Please sign in to comment.