forked from umotif-public/terraform-aws-waf-webaclv2
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added support for Regex Match Statements (umotif-public#63)
* Added support for Regex Match Statements * Lint and other fixes Co-authored-by: Tomasz Rychlewicz <tomasz.rychlewicz@explaineverything.com>
- Loading branch information
Showing
22 changed files
with
1,561 additions
and
210 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
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
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
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
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
8 changes: 8 additions & 0 deletions
8
examples/wafv2-custom-json-response-managed-rule-group/main.tf
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
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
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
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
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
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
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
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
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,57 @@ | ||
terraform { | ||
required_version = ">= 0.13.7" | ||
|
||
required_providers { | ||
aws = ">= 4.0.0" | ||
} | ||
} | ||
|
||
provider "aws" { | ||
region = "eu-west-1" | ||
} | ||
##### | ||
# Web Application Firewall configuration | ||
##### | ||
module "waf" { | ||
source = "../.." | ||
|
||
name_prefix = var.name_prefix | ||
|
||
allow_default_action = true | ||
|
||
scope = "REGIONAL" | ||
|
||
create_alb_association = false | ||
|
||
visibility_config = { | ||
cloudwatch_metrics_enabled = false | ||
metric_name = "${var.name_prefix}-waf-setup-waf-main-metrics" | ||
sampled_requests_enabled = false | ||
} | ||
|
||
rules = [ | ||
{ | ||
name = "block-some-path" | ||
priority = "1" | ||
action = "block" | ||
|
||
regex_match_statement = { | ||
field_to_match = { | ||
uri_path = "{}" | ||
} | ||
regex_string = "^/(path1|path2)/" | ||
priority = 0 | ||
type = "NONE" | ||
} | ||
|
||
visibility_config = { | ||
cloudwatch_metrics_enabled = false | ||
sampled_requests_enabled = false | ||
} | ||
} | ||
] | ||
|
||
tags = { | ||
"Environment" = "test" | ||
} | ||
} |
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,24 @@ | ||
output "web_acl_name" { | ||
description = "The name of the WAFv2 WebACL." | ||
value = module.waf.web_acl_name | ||
} | ||
|
||
output "web_acl_arn" { | ||
description = "The ARN of the WAFv2 WebACL." | ||
value = module.waf.web_acl_arn | ||
} | ||
|
||
output "web_acl_capacity" { | ||
description = "The web ACL capacity units (WCUs) currently being used by this web ACL." | ||
value = module.waf.web_acl_capacity | ||
} | ||
|
||
output "web_acl_visibility_config_name" { | ||
description = "The web ACL visibility config name" | ||
value = module.waf.web_acl_visibility_config_name | ||
} | ||
|
||
output "web_acl_rule_names" { | ||
description = "List of created rule names" | ||
value = module.waf.web_acl_rule_names | ||
} |
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,5 @@ | ||
variable "name_prefix" { | ||
description = "A prefix used for naming resources." | ||
type = string | ||
default = "example" | ||
} |
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
Oops, something went wrong.