|
@@ -40,9 +40,9 @@ resource "aws_wafv2_ip_set" "allowed" {
|
|
|
}
|
|
|
|
|
|
resource "aws_wafv2_rule_group" "xdr_custom_rules" {
|
|
|
- name = "${local.waf_name}_xdr_custom_rules_rev2" # update name when updating
|
|
|
+ name = "${local.waf_name}_xdr_custom_rules_rev3" # update name when updating
|
|
|
scope = "REGIONAL"
|
|
|
- capacity = 50
|
|
|
+ capacity = 60
|
|
|
|
|
|
# Note, there is visibilty config for the group and for the rule
|
|
|
visibility_config {
|
|
@@ -84,73 +84,129 @@ resource "aws_wafv2_rule_group" "xdr_custom_rules" {
|
|
|
# }
|
|
|
}
|
|
|
|
|
|
- rule {
|
|
|
- name = "Block_log4j_Exploit_20211210"
|
|
|
- action {
|
|
|
- block {}
|
|
|
- }
|
|
|
- priority = 110
|
|
|
-
|
|
|
- #rule_label {
|
|
|
- # name = "xdr_custom:log4j"
|
|
|
- #}
|
|
|
-
|
|
|
- visibility_config {
|
|
|
- cloudwatch_metrics_enabled = true
|
|
|
- metric_name = "Block_Log4j_exploit_20211210"
|
|
|
- sampled_requests_enabled = true
|
|
|
- }
|
|
|
-
|
|
|
- statement {
|
|
|
- or_statement {
|
|
|
- statement {
|
|
|
- byte_match_statement {
|
|
|
- field_to_match {
|
|
|
- single_header {
|
|
|
- name = "user-agent"
|
|
|
- }
|
|
|
- }
|
|
|
- positional_constraint = "STARTS_WITH"
|
|
|
- search_string = "$${jndi:ldap://"
|
|
|
- text_transformation {
|
|
|
- priority = 2
|
|
|
- type = "LOWERCASE"
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- statement {
|
|
|
- byte_match_statement {
|
|
|
- field_to_match {
|
|
|
- single_header {
|
|
|
- name = "user-agent"
|
|
|
- }
|
|
|
- }
|
|
|
- positional_constraint = "STARTS_WITH"
|
|
|
- search_string = "$${jndi:rmi:"
|
|
|
- text_transformation {
|
|
|
- priority = 2
|
|
|
- type = "LOWERCASE"
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- statement {
|
|
|
- byte_match_statement {
|
|
|
- field_to_match {
|
|
|
- single_header {
|
|
|
- name = "user-agent"
|
|
|
- }
|
|
|
- }
|
|
|
- positional_constraint = "STARTS_WITH"
|
|
|
- search_string = "$${jndi:dns:"
|
|
|
- text_transformation {
|
|
|
- priority = 2
|
|
|
- type = "LOWERCASE"
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+# rule {
|
|
|
+# name = "Block_log4j_Exploit_20211210"
|
|
|
+# action {
|
|
|
+# block {}
|
|
|
+# }
|
|
|
+# priority = 110
|
|
|
+#
|
|
|
+# #rule_label {
|
|
|
+# # name = "xdr_custom:log4j"
|
|
|
+# #}
|
|
|
+#
|
|
|
+# visibility_config {
|
|
|
+# cloudwatch_metrics_enabled = true
|
|
|
+# metric_name = "Block_Log4j_exploit_20211210"
|
|
|
+# sampled_requests_enabled = true
|
|
|
+# }
|
|
|
+#
|
|
|
+# statement {
|
|
|
+# or_statement {
|
|
|
+# statement {
|
|
|
+# byte_match_statement {
|
|
|
+# field_to_match {
|
|
|
+# single_header {
|
|
|
+# name = "user-agent"
|
|
|
+# }
|
|
|
+# }
|
|
|
+# positional_constraint = "STARTS_WITH"
|
|
|
+# search_string = "$${jndi:" # ldap://"
|
|
|
+#
|
|
|
+# text_transformation {
|
|
|
+# priority = 1
|
|
|
+# type = "BASE64_DECODE"
|
|
|
+# }
|
|
|
+#
|
|
|
+# #text_transformation {
|
|
|
+# # priority = 3
|
|
|
+# # type = "HEX_DECODE"
|
|
|
+# #}
|
|
|
+#
|
|
|
+# text_transformation {
|
|
|
+# priority = 5
|
|
|
+# type = "LOWERCASE"
|
|
|
+# }
|
|
|
+# }
|
|
|
+# }
|
|
|
+#
|
|
|
+## statement {
|
|
|
+## byte_match_statement {
|
|
|
+## field_to_match {
|
|
|
+## method {}
|
|
|
+## }
|
|
|
+## positional_constraint = "STARTS_WITH"
|
|
|
+## search_string = "$${jndi:" # ldap://"
|
|
|
+##
|
|
|
+## text_transformation {
|
|
|
+## priority = 1
|
|
|
+## type = "BASE64_DECODE"
|
|
|
+## }
|
|
|
+##
|
|
|
+## text_transformation {
|
|
|
+## priority = 3
|
|
|
+## type = "HEX_DECODE"
|
|
|
+## }
|
|
|
+##
|
|
|
+## text_transformation {
|
|
|
+## priority = 5
|
|
|
+## type = "LOWERCASE"
|
|
|
+## }
|
|
|
+## }
|
|
|
+## }
|
|
|
+##
|
|
|
+## statement {
|
|
|
+## byte_match_statement {
|
|
|
+## field_to_match {
|
|
|
+## query_string {}
|
|
|
+## }
|
|
|
+## positional_constraint = "CONTAINS"
|
|
|
+## search_string = "$${jndi:" # ldap://"
|
|
|
+##
|
|
|
+## text_transformation {
|
|
|
+## priority = 1
|
|
|
+## type = "BASE64_DECODE"
|
|
|
+## }
|
|
|
+##
|
|
|
+## #text_transformation {
|
|
|
+## # priority = 3
|
|
|
+## # type = "HEX_DECODE"
|
|
|
+## #}
|
|
|
+##
|
|
|
+## text_transformation {
|
|
|
+## priority = 5
|
|
|
+## type = "LOWERCASE"
|
|
|
+## }
|
|
|
+## }
|
|
|
+## }
|
|
|
+#
|
|
|
+# statement {
|
|
|
+# byte_match_statement {
|
|
|
+# field_to_match {
|
|
|
+# uri_path {}
|
|
|
+# }
|
|
|
+# positional_constraint = "CONTAINS"
|
|
|
+# search_string = "$${jndi:" # ldap://"
|
|
|
+#
|
|
|
+# text_transformation {
|
|
|
+# priority = 1
|
|
|
+# type = "BASE64_DECODE"
|
|
|
+# }
|
|
|
+#
|
|
|
+# #text_transformation {
|
|
|
+# # priority = 3
|
|
|
+# # type = "HEX_DECODE"
|
|
|
+# #}
|
|
|
+#
|
|
|
+# text_transformation {
|
|
|
+# priority = 5
|
|
|
+# type = "LOWERCASE"
|
|
|
+# }
|
|
|
+# }
|
|
|
+# }
|
|
|
+# }
|
|
|
+# }
|
|
|
+# }
|
|
|
# Add additional custom rules here
|
|
|
|
|
|
lifecycle {
|