Skip to content

v1.7.1

Compare
Choose a tag to compare
@cloudposse-releaser cloudposse-releaser released this 10 Jul 03:44
· 13 commits to refs/heads/main since this release
d69dd89

πŸš€ Enhancements

Fix Scope Down Statement Rule @RoseSecurity (#88)

what

  • Corrects byte_match_statement handling within scope-down rules to accurately query scope_down_statement parameters instead of the statement parameters

why

  • The current configuration produces the following error when correct variables are passed into the module:
β”‚ Error: Insufficient text_transformation blocks
β”‚ 
β”‚   on .terraform/dev/modules/aws_waf/rules.tf line 756, in resource "aws_wafv2_web_acl" "default":
β”‚  756:                   content {
β”‚ 
β”‚ At least 1 "text_transformation" blocks are required.
β•΅
β•·
β”‚ Error: Unsupported attribute
β”‚ 
β”‚   on .terraform/dev/modules/aws_waf/rules.tf line 757, in resource "aws_wafv2_web_acl" "default":
β”‚  757:                     positional_constraint = byte_match_statement.value.positional_constraint
β”‚     β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚     β”‚ byte_match_statement.value is object with 4 attributes
β”‚ 
β”‚ This object does not have an attribute named "positional_constraint".
β•΅
β•·
β”‚ Error: Unsupported attribute
β”‚ 
β”‚   on .terraform/dev/modules/aws_waf/rules.tf line 758, in resource "aws_wafv2_web_acl" "default":
β”‚  758:                     search_string         = byte_match_statement.value.search_string
β”‚     β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚     β”‚ byte_match_statement.value is object with 4 attributes
β”‚ 
β”‚ This object does not have an attribute named "search_string".
β•΅
Releasing state lock. This may take a few moments...
exit status 1
  • To correct this, this change proposes to use the proper parameters, allowing for the following values to be passed to the module:
      scope_down_statement = optional(object({
        byte_match_statement = object({
          positional_constraint = string
          search_string         = string
          field_to_match = object({
            all_query_arguments   = optional(bool)
            body                  = optional(bool)
            method                = optional(bool)
            query_string          = optional(bool)
            single_header         = optional(object({ name = string }))
            single_query_argument = optional(object({ name = string }))
            uri_path              = optional(bool)
          })
          text_transformation = list(object({
            priority = number
            type     = string
          }))
        })
      }))