Class: AWSCDK::WAFv2::CfnWebACL::RateBasedStatementCustomKeyProperty

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

Overview

Specifies a single custom aggregate key for a rate-base rule.

Web requests that are missing any of the components specified in the aggregation keys are omitted from the rate-based rule evaluation and handling.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(asn: nil, cookie: nil, forwarded_ip: nil, header: nil, http_method: nil, ip: nil, ja3_fingerprint: nil, ja4_fingerprint: nil, label_namespace: nil, query_argument: nil, query_string: nil, uri_path: nil) ⇒ RateBasedStatementCustomKeyProperty

Returns a new instance of RateBasedStatementCustomKeyProperty.

Parameters:



4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
# File 'wa_fv2/cfn_web_acl.rb', line 4091

def initialize(asn: nil, cookie: nil, forwarded_ip: nil, header: nil, http_method: nil, ip: nil, ja3_fingerprint: nil, ja4_fingerprint: nil, label_namespace: nil, query_argument: nil, query_string: nil, uri_path: nil)
  @asn = asn
  Jsii::Type.check_type(@asn, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "asn") unless @asn.nil?
  @cookie = cookie.is_a?(Hash) ? ::AWSCDK::WAFv2::CfnWebACL::RateLimitCookieProperty.new(**cookie.transform_keys(&:to_sym)) : cookie
  Jsii::Type.check_type(@cookie, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c193YWZ2Mi5DZm5XZWJBQ0wuUmF0ZUxpbWl0Q29va2llUHJvcGVydHkifV19fQ==")), "cookie") unless @cookie.nil?
  @forwarded_ip = forwarded_ip
  Jsii::Type.check_type(@forwarded_ip, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "forwardedIp") unless @forwarded_ip.nil?
  @header = header.is_a?(Hash) ? ::AWSCDK::WAFv2::CfnWebACL::RateLimitHeaderProperty.new(**header.transform_keys(&:to_sym)) : header
  Jsii::Type.check_type(@header, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c193YWZ2Mi5DZm5XZWJBQ0wuUmF0ZUxpbWl0SGVhZGVyUHJvcGVydHkifV19fQ==")), "header") unless @header.nil?
  @http_method = http_method
  Jsii::Type.check_type(@http_method, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "httpMethod") unless @http_method.nil?
  @ip = ip
  Jsii::Type.check_type(@ip, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "ip") unless @ip.nil?
  @ja3_fingerprint = ja3_fingerprint.is_a?(Hash) ? ::AWSCDK::WAFv2::CfnWebACL::RateLimitJA3FingerprintProperty.new(**ja3_fingerprint.transform_keys(&:to_sym)) : ja3_fingerprint
  Jsii::Type.check_type(@ja3_fingerprint, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c193YWZ2Mi5DZm5XZWJBQ0wuUmF0ZUxpbWl0SkEzRmluZ2VycHJpbnRQcm9wZXJ0eSJ9XX19")), "ja3Fingerprint") unless @ja3_fingerprint.nil?
  @ja4_fingerprint = ja4_fingerprint.is_a?(Hash) ? ::AWSCDK::WAFv2::CfnWebACL::RateLimitJA4FingerprintProperty.new(**ja4_fingerprint.transform_keys(&:to_sym)) : ja4_fingerprint
  Jsii::Type.check_type(@ja4_fingerprint, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c193YWZ2Mi5DZm5XZWJBQ0wuUmF0ZUxpbWl0SkE0RmluZ2VycHJpbnRQcm9wZXJ0eSJ9XX19")), "ja4Fingerprint") unless @ja4_fingerprint.nil?
  @label_namespace = label_namespace.is_a?(Hash) ? ::AWSCDK::WAFv2::CfnWebACL::RateLimitLabelNamespaceProperty.new(**label_namespace.transform_keys(&:to_sym)) : label_namespace
  Jsii::Type.check_type(@label_namespace, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c193YWZ2Mi5DZm5XZWJBQ0wuUmF0ZUxpbWl0TGFiZWxOYW1lc3BhY2VQcm9wZXJ0eSJ9XX19")), "labelNamespace") unless @label_namespace.nil?
  @query_argument = query_argument.is_a?(Hash) ? ::AWSCDK::WAFv2::CfnWebACL::RateLimitQueryArgumentProperty.new(**query_argument.transform_keys(&:to_sym)) : query_argument
  Jsii::Type.check_type(@query_argument, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c193YWZ2Mi5DZm5XZWJBQ0wuUmF0ZUxpbWl0UXVlcnlBcmd1bWVudFByb3BlcnR5In1dfX0=")), "queryArgument") unless @query_argument.nil?
  @query_string = query_string.is_a?(Hash) ? ::AWSCDK::WAFv2::CfnWebACL::RateLimitQueryStringProperty.new(**query_string.transform_keys(&:to_sym)) : query_string
  Jsii::Type.check_type(@query_string, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c193YWZ2Mi5DZm5XZWJBQ0wuUmF0ZUxpbWl0UXVlcnlTdHJpbmdQcm9wZXJ0eSJ9XX19")), "queryString") unless @query_string.nil?
  @uri_path = uri_path.is_a?(Hash) ? ::AWSCDK::WAFv2::CfnWebACL::RateLimitURIPathProperty.new(**uri_path.transform_keys(&:to_sym)) : uri_path
  Jsii::Type.check_type(@uri_path, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c193YWZ2Mi5DZm5XZWJBQ0wuUmF0ZUxpbWl0VXJpUGF0aFByb3BlcnR5In1dfX0=")), "uriPath") unless @uri_path.nil?
end

Instance Attribute Details

#asnObject? (readonly)

Use an Autonomous System Number (ASN) derived from the request's originating or forwarded IP address as an aggregate key.

Each distinct ASN contributes to the aggregation instance.



4124
4125
4126
# File 'wa_fv2/cfn_web_acl.rb', line 4124

def asn
  @asn
end

Use the value of a cookie in the request as an aggregate key.

Each distinct value in the cookie contributes to the aggregation instance. If you use a single cookie as your custom key, then each value fully defines an aggregation instance.



4131
4132
4133
# File 'wa_fv2/cfn_web_acl.rb', line 4131

def cookie
  @cookie
end

#forwarded_ipObject? (readonly)

Use the first IP address in an HTTP header as an aggregate key.

Each distinct forwarded IP address contributes to the aggregation instance.

When you specify an IP or forwarded IP in the custom key settings, you must also specify at least one other key to use. You can aggregate on only the forwarded IP address by specifying FORWARDED_IP in your rate-based statement's AggregateKeyType .

With this option, you must specify the header to use in the rate-based rule's ForwardedIPConfig property.



4142
4143
4144
# File 'wa_fv2/cfn_web_acl.rb', line 4142

def forwarded_ip
  @forwarded_ip
end

#headerAWSCDK::IResolvable, ... (readonly)

Use the value of a header in the request as an aggregate key.

Each distinct value in the header contributes to the aggregation instance. If you use a single header as your custom key, then each value fully defines an aggregation instance.



4149
4150
4151
# File 'wa_fv2/cfn_web_acl.rb', line 4149

def header
  @header
end

#http_methodObject? (readonly)

Use the request's HTTP method as an aggregate key.

Each distinct HTTP method contributes to the aggregation instance. If you use just the HTTP method as your custom key, then each method fully defines an aggregation instance.



4156
4157
4158
# File 'wa_fv2/cfn_web_acl.rb', line 4156

def http_method
  @http_method
end

#ipObject? (readonly)

Use the request's originating IP address as an aggregate key. Each distinct IP address contributes to the aggregation instance.

When you specify an IP or forwarded IP in the custom key settings, you must also specify at least one other key to use. You can aggregate on only the IP address by specifying IP in your rate-based statement's AggregateKeyType .



4163
4164
4165
# File 'wa_fv2/cfn_web_acl.rb', line 4163

def ip
  @ip
end

#ja3_fingerprintAWSCDK::IResolvable, ... (readonly)

Use the request's JA3 fingerprint as an aggregate key.

If you use a single JA3 fingerprint as your custom key, then each value fully defines an aggregation instance.



4170
4171
4172
# File 'wa_fv2/cfn_web_acl.rb', line 4170

def ja3_fingerprint
  @ja3_fingerprint
end

#ja4_fingerprintAWSCDK::IResolvable, ... (readonly)

Use the request's JA4 fingerprint as an aggregate key.

If you use a single JA4 fingerprint as your custom key, then each value fully defines an aggregation instance.



4177
4178
4179
# File 'wa_fv2/cfn_web_acl.rb', line 4177

def ja4_fingerprint
  @ja4_fingerprint
end

#label_namespaceAWSCDK::IResolvable, ... (readonly)

Use the specified label namespace as an aggregate key.

Each distinct fully qualified label name that has the specified label namespace contributes to the aggregation instance. If you use just one label namespace as your custom key, then each label name fully defines an aggregation instance.

This uses only labels that have been added to the request by rules that are evaluated before this rate-based rule in the web ACL.

For information about label namespaces and names, see Label syntax and naming requirements in the AWS WAF Developer Guide .



4188
4189
4190
# File 'wa_fv2/cfn_web_acl.rb', line 4188

def label_namespace
  @label_namespace
end

#query_argumentAWSCDK::IResolvable, ... (readonly)

Use the specified query argument as an aggregate key.

Each distinct value for the named query argument contributes to the aggregation instance. If you use a single query argument as your custom key, then each value fully defines an aggregation instance.



4195
4196
4197
# File 'wa_fv2/cfn_web_acl.rb', line 4195

def query_argument
  @query_argument
end

#query_stringAWSCDK::IResolvable, ... (readonly)

Use the request's query string as an aggregate key.

Each distinct string contributes to the aggregation instance. If you use just the query string as your custom key, then each string fully defines an aggregation instance.



4202
4203
4204
# File 'wa_fv2/cfn_web_acl.rb', line 4202

def query_string
  @query_string
end

#uri_pathAWSCDK::IResolvable, ... (readonly)

Use the request's URI path as an aggregate key.

Each distinct URI path contributes to the aggregation instance. If you use just the URI path as your custom key, then each URI path fully defines an aggregation instance.



4209
4210
4211
# File 'wa_fv2/cfn_web_acl.rb', line 4209

def uri_path
  @uri_path
end

Class Method Details

.jsii_propertiesObject



4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
# File 'wa_fv2/cfn_web_acl.rb', line 4211

def self.jsii_properties
  {
    :asn => "asn",
    :cookie => "cookie",
    :forwarded_ip => "forwardedIp",
    :header => "header",
    :http_method => "httpMethod",
    :ip => "ip",
    :ja3_fingerprint => "ja3Fingerprint",
    :ja4_fingerprint => "ja4Fingerprint",
    :label_namespace => "labelNamespace",
    :query_argument => "queryArgument",
    :query_string => "queryString",
    :uri_path => "uriPath",
  }
end

Instance Method Details

#to_jsiiObject



4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
# File 'wa_fv2/cfn_web_acl.rb', line 4228

def to_jsii
  result = {}
  result.merge!({
    "asn" => @asn,
    "cookie" => @cookie,
    "forwardedIp" => @forwarded_ip,
    "header" => @header,
    "httpMethod" => @http_method,
    "ip" => @ip,
    "ja3Fingerprint" => @ja3_fingerprint,
    "ja4Fingerprint" => @ja4_fingerprint,
    "labelNamespace" => @label_namespace,
    "queryArgument" => @query_argument,
    "queryString" => @query_string,
    "uriPath" => @uri_path,
  })
  result.compact
end