Class: AWSCDK::WAFv2::CfnRuleGroup::RegexPatternSetReferenceStatementProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
wa_fv2/cfn_rule_group.rb

Overview

A rule statement used to search web request components for matches with regular expressions.

To use this, create a RegexPatternSet that specifies the expressions that you want to detect, then use the ARN of that set in this statement. A web request matches the pattern set rule statement if the request component matches any of the patterns in the set.

Each regex pattern set rule statement references a regex pattern set. You create and maintain the set independent of your rules. This allows you to use the single set in multiple rules. When you update the referenced set, AWS WAF automatically updates all rules that reference it.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(arn:, field_to_match:, text_transformations:) ⇒ RegexPatternSetReferenceStatementProperty

Returns a new instance of RegexPatternSetReferenceStatementProperty.

Parameters:



3584
3585
3586
3587
3588
3589
3590
3591
# File 'wa_fv2/cfn_rule_group.rb', line 3584

def initialize(arn:, field_to_match:, text_transformations:)
  @arn = arn
  Jsii::Type.check_type(@arn, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "arn")
  @field_to_match = field_to_match.is_a?(Hash) ? ::AWSCDK::WAFv2::CfnRuleGroup::FieldToMatchProperty.new(**field_to_match.transform_keys(&:to_sym)) : field_to_match
  Jsii::Type.check_type(@field_to_match, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c193YWZ2Mi5DZm5SdWxlR3JvdXAuRmllbGRUb01hdGNoUHJvcGVydHkifV19fQ==")), "fieldToMatch")
  @text_transformations = text_transformations
  Jsii::Type.check_type(@text_transformations, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfd2FmdjIuQ2ZuUnVsZUdyb3VwLlRleHRUcmFuc2Zvcm1hdGlvblByb3BlcnR5In1dfX0sImtpbmQiOiJhcnJheSJ9fV19fQ==")), "textTransformations")
end

Instance Attribute Details

#arnString (readonly)

The Amazon Resource Name (ARN) of the RegexPatternSet that this statement references.



3597
3598
3599
# File 'wa_fv2/cfn_rule_group.rb', line 3597

def arn
  @arn
end

#text_transformationsAWSCDK::IResolvable, Array<AWSCDK::IResolvable, AWSCDK::WAFv2::CfnRuleGroup::TextTransformationProperty> (readonly)

Text transformations eliminate some of the unusual formatting that attackers use in web requests in an effort to bypass detection.

If you specify one or more transformations in a rule statement, AWS WAF performs all transformations on the content of the request component identified by FieldToMatch , starting from the lowest priority setting, before inspecting the content for a match.



3609
3610
3611
# File 'wa_fv2/cfn_rule_group.rb', line 3609

def text_transformations
  @text_transformations
end

Class Method Details

.jsii_propertiesObject



3611
3612
3613
3614
3615
3616
3617
# File 'wa_fv2/cfn_rule_group.rb', line 3611

def self.jsii_properties
  {
    :arn => "arn",
    :field_to_match => "fieldToMatch",
    :text_transformations => "textTransformations",
  }
end

Instance Method Details

#to_jsiiObject



3619
3620
3621
3622
3623
3624
3625
3626
3627
# File 'wa_fv2/cfn_rule_group.rb', line 3619

def to_jsii
  result = {}
  result.merge!({
    "arn" => @arn,
    "fieldToMatch" => @field_to_match,
    "textTransformations" => @text_transformations,
  })
  result.compact
end