Class: AWSCDK::CloudFront::CfnResponseHeadersPolicy::XSSProtectionProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
cloud_front/cfn_response_headers_policy.rb

Overview

Determines whether CloudFront includes the X-XSS-Protection HTTP response header and the header's value.

For more information about the X-XSS-Protection HTTP response header, see X-XSS-Protection in the MDN Web Docs.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(override:, protection:, mode_block: nil, report_uri: nil) ⇒ XSSProtectionProperty

Returns a new instance of XSSProtectionProperty.

Parameters:

  • override (Boolean, AWSCDK::IResolvable)

    A Boolean that determines whether CloudFront overrides the X-XSS-Protection HTTP response header received from the origin with the one specified in this response headers policy.

  • protection (Boolean, AWSCDK::IResolvable)

    A Boolean that determines the value of the X-XSS-Protection HTTP response header.

  • mode_block (Boolean, AWSCDK::IResolvable, nil) (defaults to: nil)

    A Boolean that determines whether CloudFront includes the mode=block directive in the X-XSS-Protection header.

  • report_uri (String, nil) (defaults to: nil)

    A reporting URI, which CloudFront uses as the value of the report directive in the X-XSS-Protection header.



1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
# File 'cloud_front/cfn_response_headers_policy.rb', line 1440

def initialize(override:, protection:, mode_block: nil, report_uri: nil)
  @override = override
  Jsii::Type.check_type(@override, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "override")
  @protection = protection
  Jsii::Type.check_type(@protection, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "protection")
  @mode_block = mode_block
  Jsii::Type.check_type(@mode_block, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "modeBlock") unless @mode_block.nil?
  @report_uri = report_uri
  Jsii::Type.check_type(@report_uri, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "reportUri") unless @report_uri.nil?
end

Instance Attribute Details

#mode_blockBoolean, ... (readonly)

A Boolean that determines whether CloudFront includes the mode=block directive in the X-XSS-Protection header.

For more information about this directive, see X-XSS-Protection in the MDN Web Docs.



1471
1472
1473
# File 'cloud_front/cfn_response_headers_policy.rb', line 1471

def mode_block
  @mode_block
end

#overrideBoolean, AWSCDK::IResolvable (readonly)

A Boolean that determines whether CloudFront overrides the X-XSS-Protection HTTP response header received from the origin with the one specified in this response headers policy.



1455
1456
1457
# File 'cloud_front/cfn_response_headers_policy.rb', line 1455

def override
  @override
end

#protectionBoolean, AWSCDK::IResolvable (readonly)

A Boolean that determines the value of the X-XSS-Protection HTTP response header.

When this setting is true , the value of the X-XSS-Protection header is 1 . When this setting is false , the value of the X-XSS-Protection header is 0 .

For more information about these settings, see X-XSS-Protection in the MDN Web Docs.



1464
1465
1466
# File 'cloud_front/cfn_response_headers_policy.rb', line 1464

def protection
  @protection
end

#report_uriString? (readonly)

A reporting URI, which CloudFront uses as the value of the report directive in the X-XSS-Protection header.

You cannot specify a ReportUri when ModeBlock is true .

For more information about using a reporting URL, see X-XSS-Protection in the MDN Web Docs.



1480
1481
1482
# File 'cloud_front/cfn_response_headers_policy.rb', line 1480

def report_uri
  @report_uri
end

Class Method Details

.jsii_propertiesObject



1482
1483
1484
1485
1486
1487
1488
1489
# File 'cloud_front/cfn_response_headers_policy.rb', line 1482

def self.jsii_properties
  {
    :override => "override",
    :protection => "protection",
    :mode_block => "modeBlock",
    :report_uri => "reportUri",
  }
end

Instance Method Details

#to_jsiiObject



1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
# File 'cloud_front/cfn_response_headers_policy.rb', line 1491

def to_jsii
  result = {}
  result.merge!({
    "override" => @override,
    "protection" => @protection,
    "modeBlock" => @mode_block,
    "reportUri" => @report_uri,
  })
  result.compact
end