Class: AWSCDK::WAFv2::CfnWebACL::RequestInspectionProperty

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

Overview

The criteria for inspecting login requests, used by the ATP rule group to validate credentials usage.

This is part of the AWSManagedRulesATPRuleSet configuration in ManagedRuleGroupConfig .

In these settings, you specify how your application accepts login attempts by providing the request payload type and the names of the fields within the request body where the username and password are provided.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(password_field:, payload_type:, username_field:) ⇒ RequestInspectionProperty

Returns a new instance of RequestInspectionProperty.

Parameters:



5098
5099
5100
5101
5102
5103
5104
5105
# File 'wa_fv2/cfn_web_acl.rb', line 5098

def initialize(password_field:, payload_type:, username_field:)
  @password_field = password_field.is_a?(Hash) ? ::AWSCDK::WAFv2::CfnWebACL::FieldIdentifierProperty.new(**password_field.transform_keys(&:to_sym)) : password_field
  Jsii::Type.check_type(@password_field, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c193YWZ2Mi5DZm5XZWJBQ0wuRmllbGRJZGVudGlmaWVyUHJvcGVydHkifV19fQ==")), "passwordField")
  @payload_type = payload_type
  Jsii::Type.check_type(@payload_type, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "payloadType")
  @username_field = username_field.is_a?(Hash) ? ::AWSCDK::WAFv2::CfnWebACL::FieldIdentifierProperty.new(**username_field.transform_keys(&:to_sym)) : username_field
  Jsii::Type.check_type(@username_field, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c193YWZ2Mi5DZm5XZWJBQ0wuRmllbGRJZGVudGlmaWVyUHJvcGVydHkifV19fQ==")), "usernameField")
end

Instance Attribute Details

#password_fieldAWSCDK::IResolvable, AWSCDK::WAFv2::CfnWebACL::FieldIdentifierProperty (readonly)

The name of the field in the request payload that contains your customer's password.

How you specify this depends on the request inspection payload type.

  • For JSON payloads, specify the field name in JSON pointer syntax. For information about the JSON Pointer syntax, see the Internet Engineering Task Force (IETF) documentation JavaScript Object Notation (JSON) Pointer .

For example, for the JSON payload { "form": { "password": "THE_PASSWORD" } } , the password field specification is /form/password .

  • For form encoded payload types, use the HTML form names.

For example, for an HTML form with the input element named password1 , the password field specification is password1 .



5121
5122
5123
# File 'wa_fv2/cfn_web_acl.rb', line 5121

def password_field
  @password_field
end

#payload_typeString (readonly)

The payload type for your login endpoint, either JSON or form encoded.



5126
5127
5128
# File 'wa_fv2/cfn_web_acl.rb', line 5126

def payload_type
  @payload_type
end

#username_fieldAWSCDK::IResolvable, AWSCDK::WAFv2::CfnWebACL::FieldIdentifierProperty (readonly)

The name of the field in the request payload that contains your customer's username.

How you specify this depends on the request inspection payload type.

  • For JSON payloads, specify the field name in JSON pointer syntax. For information about the JSON Pointer syntax, see the Internet Engineering Task Force (IETF) documentation JavaScript Object Notation (JSON) Pointer .

For example, for the JSON payload { "form": { "username": "THE_USERNAME" } } , the username field specification is /form/username .

  • For form encoded payload types, use the HTML form names.

For example, for an HTML form with the input element named username1 , the username field specification is username1



5141
5142
5143
# File 'wa_fv2/cfn_web_acl.rb', line 5141

def username_field
  @username_field
end

Class Method Details

.jsii_propertiesObject



5143
5144
5145
5146
5147
5148
5149
# File 'wa_fv2/cfn_web_acl.rb', line 5143

def self.jsii_properties
  {
    :password_field => "passwordField",
    :payload_type => "payloadType",
    :username_field => "usernameField",
  }
end

Instance Method Details

#to_jsiiObject



5151
5152
5153
5154
5155
5156
5157
5158
5159
# File 'wa_fv2/cfn_web_acl.rb', line 5151

def to_jsii
  result = {}
  result.merge!({
    "passwordField" => @password_field,
    "payloadType" => @payload_type,
    "usernameField" => @username_field,
  })
  result.compact
end