-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add waf rule to inspect for header values
- Loading branch information
olamide
committed
Apr 3, 2024
1 parent
295df88
commit 1f17f91
Showing
2 changed files
with
32 additions
and
7 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
variable "header_match_rules" { | ||
description = "Rule statement to inspect and match the header for an incoming request." | ||
type = map(object({ | ||
name = string # Name of the header match rule group | ||
priority = number # Relative processing order for header match rule relative to other rules processed by AWS WAF. | ||
header_name = string # This is the name of the header to inspect for all incoming requests. | ||
header_value = string # This is the value to look out for a matching header name for all incoming requests | ||
count_override = optional(bool, true) # If true, this will override the rule action setting to `count`, if false, the rule action will be set to `block`. Default value is false. | ||
country_list = optional(list(string), []) # List of countries to apply the header match to. If populated, from other countries will be ignored by this rule. IF empty, the rule will apply to all traffic. You must either specify country_list or exempt_country_list, but not both. | ||
exempt_country_list = optional(list(string), []) # List of countries to exempt from the header match rule. If populated, the selected countries will be ignored by this rule. IF empty, the rule will apply to all traffic. You must either specify country_list or exempt_country_list, but not both. | ||
})) | ||
|
||
# default = { | ||
# "default-header-rule" = { | ||
|
||
# } | ||
# } | ||
default = null | ||
} | ||
|
||
output "name" { | ||
value = var.header_match_rules | ||
} |
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