Class: AWSCDK::WAFv2::CfnRuleGroup::RateBasedStatementCustomKeyProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
wa_fv2/cfn_rule_group.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:



2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
# File 'wa_fv2/cfn_rule_group.rb', line 2859

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::CfnRuleGroup::RateLimitCookieProperty.new(**cookie.transform_keys(&:to_sym)) : cookie
  Jsii::Type.check_type(@cookie, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c193YWZ2Mi5DZm5SdWxlR3JvdXAuUmF0ZUxpbWl0Q29va2llUHJvcGVydHkifV19fQ==")), "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::CfnRuleGroup::RateLimitHeaderProperty.new(**header.transform_keys(&:to_sym)) : header
  Jsii::Type.check_type(@header, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c193YWZ2Mi5DZm5SdWxlR3JvdXAuUmF0ZUxpbWl0SGVhZGVyUHJvcGVydHkifV19fQ==")), "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::CfnRuleGroup::RateLimitJA3FingerprintProperty.new(**ja3_fingerprint.transform_keys(&:to_sym)) : ja3_fingerprint
  Jsii::Type.check_type(@ja3_fingerprint, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c193YWZ2Mi5DZm5SdWxlR3JvdXAuUmF0ZUxpbWl0SkEzRmluZ2VycHJpbnRQcm9wZXJ0eSJ9XX19")), "ja3Fingerprint") unless @ja3_fingerprint.nil?
  @ja4_fingerprint = ja4_fingerprint.is_a?(Hash) ? ::AWSCDK::WAFv2::CfnRuleGroup::RateLimitJA4FingerprintProperty.new(**ja4_fingerprint.transform_keys(&:to_sym)) : ja4_fingerprint
  Jsii::Type.check_type(@ja4_fingerprint, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c193YWZ2Mi5DZm5SdWxlR3JvdXAuUmF0ZUxpbWl0SkE0RmluZ2VycHJpbnRQcm9wZXJ0eSJ9XX19")), "ja4Fingerprint") unless @ja4_fingerprint.nil?
  @label_namespace = label_namespace.is_a?(Hash) ? ::AWSCDK::WAFv2::CfnRuleGroup::RateLimitLabelNamespaceProperty.new(**label_namespace.transform_keys(&:to_sym)) : label_namespace
  Jsii::Type.check_type(@label_namespace, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c193YWZ2Mi5DZm5SdWxlR3JvdXAuUmF0ZUxpbWl0TGFiZWxOYW1lc3BhY2VQcm9wZXJ0eSJ9XX19")), "labelNamespace") unless @label_namespace.nil?
  @query_argument = query_argument.is_a?(Hash) ? ::AWSCDK::WAFv2::CfnRuleGroup::RateLimitQueryArgumentProperty.new(**query_argument.transform_keys(&:to_sym)) : query_argument
  Jsii::Type.check_type(@query_argument, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c193YWZ2Mi5DZm5SdWxlR3JvdXAuUmF0ZUxpbWl0UXVlcnlBcmd1bWVudFByb3BlcnR5In1dfX0=")), "queryArgument") unless @query_argument.nil?
  @query_string = query_string.is_a?(Hash) ? ::AWSCDK::WAFv2::CfnRuleGroup::RateLimitQueryStringProperty.new(**query_string.transform_keys(&:to_sym)) : query_string
  Jsii::Type.check_type(@query_string, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c193YWZ2Mi5DZm5SdWxlR3JvdXAuUmF0ZUxpbWl0UXVlcnlTdHJpbmdQcm9wZXJ0eSJ9XX19")), "queryString") unless @query_string.nil?
  @uri_path = uri_path.is_a?(Hash) ? ::AWSCDK::WAFv2::CfnRuleGroup::RateLimitURIPathProperty.new(**uri_path.transform_keys(&:to_sym)) : uri_path
  Jsii::Type.check_type(@uri_path, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c193YWZ2Mi5DZm5SdWxlR3JvdXAuUmF0ZUxpbWl0VXJpUGF0aFByb3BlcnR5In1dfX0=")), "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.



2892
2893
2894
# File 'wa_fv2/cfn_rule_group.rb', line 2892

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.



2899
2900
2901
# File 'wa_fv2/cfn_rule_group.rb', line 2899

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.



2910
2911
2912
# File 'wa_fv2/cfn_rule_group.rb', line 2910

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.



2917
2918
2919
# File 'wa_fv2/cfn_rule_group.rb', line 2917

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.



2924
2925
2926
# File 'wa_fv2/cfn_rule_group.rb', line 2924

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 .



2931
2932
2933
# File 'wa_fv2/cfn_rule_group.rb', line 2931

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.



2938
2939
2940
# File 'wa_fv2/cfn_rule_group.rb', line 2938

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.



2945
2946
2947
# File 'wa_fv2/cfn_rule_group.rb', line 2945

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 .



2956
2957
2958
# File 'wa_fv2/cfn_rule_group.rb', line 2956

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.



2963
2964
2965
# File 'wa_fv2/cfn_rule_group.rb', line 2963

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.



2970
2971
2972
# File 'wa_fv2/cfn_rule_group.rb', line 2970

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.



2977
2978
2979
# File 'wa_fv2/cfn_rule_group.rb', line 2977

def uri_path
  @uri_path
end

Class Method Details

.jsii_propertiesObject



2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
# File 'wa_fv2/cfn_rule_group.rb', line 2979

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



2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
# File 'wa_fv2/cfn_rule_group.rb', line 2996

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