-
Notifications
You must be signed in to change notification settings - Fork 0
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
FUM-3033-waf-module-refactor #4
Conversation
8755b7b
to
8845f86
Compare
fix priorities fix ipv6 list fix-rule-action-override
f7145e0
to
93d003b
Compare
e5cba1c
to
f324794
Compare
variable "self_ips" { | ||
default = [] | ||
description = "The IP from own AWS account (NAT gateways)" | ||
type = set(string) | ||
} | ||
|
||
variable "allowed_ips" { | ||
default = [] | ||
description = "The IPv4 to allow" | ||
type = set(string) | ||
} | ||
|
||
variable "whitelisted_ip_ranges" { | ||
default = [] | ||
description = "List of enterprise IP ranges to be whitelisted. Set to empty list to disable the whitelisting" | ||
type = list(string) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
consolidated into whitelisted_ips_v4
waf.tf
Outdated
# dynamic "challenge_config" { | ||
# # avaliable in the console but seems to be not supported on tf (?) | ||
# # even if is mentioned in the docs https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/wafv2_web_acl#challenge_config-block | ||
# # and is in an open issue https://github.com/hashicorp/terraform-provider-aws/issues/29071 | ||
# for_each = rule.value.action == "challenge" ? [1] : [] | ||
# content { | ||
# immunity_time_property { | ||
# immunity_time = rule.value.immunity_seconds | ||
# } | ||
# } | ||
# } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not clear why this is, but there is no way to set a custom immunity time for challenges in terraform
# Change "count" to "block" if you are under attack and want to | ||
# rate limit to a low number of requests every country apart from Switzerland | ||
rule { | ||
name = "Rate_limit_everything_apart_from_CH" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this was just moved, not completely removed
} | ||
|
||
dynamic "rule" { | ||
for_each = var.enable_count_ch_requests ? [1] : [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved
} | ||
|
||
dynamic "rule" { | ||
for_each = var.aws_managed_rules |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
completely reworked
# rule for var.aws_managed_rules this rule would have no labels to check and therefore should not be created | ||
for_each = length(var.aws_managed_rules_labels) > 0 && length(var.aws_managed_rules) > 0 ? [1] : [] | ||
content { | ||
name = "Rate_limit_based_on_AWS_labels" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
completely reworked
Good stuff, added some comments |
Co-authored-by: Demetrio Carrara <[email protected]>
Co-authored-by: Demetrio Carrara <[email protected]>
Co-authored-by: Demetrio Carrara <[email protected]>
Co-authored-by: Demetrio Carrara <[email protected]>
Co-authored-by: Demetrio Carrara <[email protected]>
Further examples that can be created: regional waf
d843775
to
1a4eb6d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
variables.tf
Outdated
} | ||
|
||
variable "aws_managed_rules_labels" { | ||
variable "aws_managed_rule_lables" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
variable "aws_managed_rule_lables" { | |
variable "aws_managed_rule_labels" { |
Co-authored-by: Demetrio Carrara <[email protected]>
This will be a major release, a lot of breaking changes.
The goal of the refactor is to
Added functionalities: