Route53GlobalResolver / Client / create_firewall_rule

create_firewall_rule

Route53GlobalResolver.Client.create_firewall_rule(**kwargs)

Creates a DNS firewall rule. Firewall rules define actions (ALLOW, BLOCK, or ALERT) to take on DNS queries that match specified domain lists, managed domain lists, or advanced threat protections.

See also: AWS API Documentation

Request Syntax

response = client.create_firewall_rule(
    action='ALLOW'|'ALERT'|'BLOCK',
    blockOverrideDnsType='CNAME',
    blockOverrideDomain='string',
    blockOverrideTtl=123,
    blockResponse='NODATA'|'NXDOMAIN'|'OVERRIDE',
    clientToken='string',
    confidenceThreshold='LOW'|'MEDIUM'|'HIGH',
    description='string',
    dnsAdvancedProtection='DGA'|'DNS_TUNNELING',
    firewallDomainListId='string',
    name='string',
    priority=123,
    dnsViewId='string',
    qType='string'
)
Parameters:
  • action (string) –

    [REQUIRED]

    The action that DNS Firewall should take on a DNS query when it matches one of the domains in the rule’s domain list:

    • ALLOW - Permit the request to go through.

    • ALERT - Permit the request and send metrics and logs to CloudWatch.

    • BLOCK - Disallow the request. This option requires additional details in the rule’s BlockResponse.

  • blockOverrideDnsType (string) –

    The DNS record’s type. This determines the format of the record value that you provided in BlockOverrideDomain. Used for the rule action BLOCK with a BlockResponse setting of OVERRIDE.

    This setting is required if the BlockResponse setting is OVERRIDE.

  • blockOverrideDomain (string) –

    The custom DNS record to send back in response to the query. Used for the rule action BLOCK with a BlockResponse setting of OVERRIDE.

    This setting is required if the BlockResponse setting is OVERRIDE.

  • blockOverrideTtl (integer) –

    The recommended amount of time, in seconds, for the DNS resolver or web browser to cache the provided override record. Used for the rule action BLOCK with a BlockResponse setting of OVERRIDE.

    This setting is required if the BlockResponse setting is OVERRIDE.

  • blockResponse (string) – The response to return when the action is BLOCK. Valid values are NXDOMAIN (domain does not exist), NODATA (domain exists but no records), or OVERRIDE (return custom response).

  • clientToken (string) –

    A unique, case-sensitive identifier to ensure idempotency. This means that making the same request multiple times with the same clientToken has the same result every time.

    This field is autopopulated if not provided.

  • confidenceThreshold (string) – The confidence threshold for advanced threat detection. Valid values are HIGH, MEDIUM, or LOW, indicating the accuracy level required for threat detection.

  • description (string) – An optional description for the firewall rule.

  • dnsAdvancedProtection (string) – Whether to enable advanced DNS threat protection for this rule. Advanced protection can detect and block DNS tunneling and Domain Generation Algorithm (DGA) threats.

  • firewallDomainListId (string) – The ID of the firewall domain list to use in this rule.

  • name (string) –

    [REQUIRED]

    A descriptive name for the firewall rule.

  • priority (integer) – The priority of this rule. Rules are evaluated in priority order, with lower numbers having higher priority. When a DNS query matches multiple rules, the rule with the highest priority (lowest number) is applied.

  • dnsViewId (string) –

    [REQUIRED]

    The ID of the DNS view to associate with this firewall rule.

  • qType (string) – The DNS query type to match for this rule. Examples include A (IPv4 address), AAAA (IPv6 address), MX (mail exchange), or TXT (text record).

Return type:

dict

Returns:

Response Syntax

{
    'action': 'ALLOW'|'ALERT'|'BLOCK',
    'blockOverrideDnsType': 'CNAME',
    'blockOverrideDomain': 'string',
    'blockOverrideTtl': 123,
    'blockResponse': 'NODATA'|'NXDOMAIN'|'OVERRIDE',
    'confidenceThreshold': 'LOW'|'MEDIUM'|'HIGH',
    'createdAt': datetime(2015, 1, 1),
    'description': 'string',
    'dnsAdvancedProtection': 'DGA'|'DNS_TUNNELING',
    'firewallDomainListId': 'string',
    'id': 'string',
    'name': 'string',
    'priority': 123,
    'dnsViewId': 'string',
    'queryType': 'string',
    'status': 'CREATING'|'OPERATIONAL'|'UPDATING'|'DELETING',
    'updatedAt': datetime(2015, 1, 1)
}

Response Structure

  • (dict) –

    • action (string) –

      The action that DNS Firewall takes on DNS queries that match this rule.

    • blockOverrideDnsType (string) –

      The DNS record type for the custom response when blockResponse is OVERRIDE.

    • blockOverrideDomain (string) –

      The custom domain to return when the action is BLOCK and blockResponse is OVERRIDE.

    • blockOverrideTtl (integer) –

      The time-to-live (TTL) value for the custom response when blockResponse is OVERRIDE.

    • blockResponse (string) –

      The response to return when the action is BLOCK.

    • confidenceThreshold (string) –

      The confidence threshold for advanced threat detection.

    • createdAt (datetime) –

      The date and time when the firewall rule was created.

    • description (string) –

      The description of the firewall rule.

    • dnsAdvancedProtection (string) –

      Whether advanced DNS threat protection is enabled for this rule.

    • firewallDomainListId (string) –

      The ID of the firewall domain list used in this rule.

    • id (string) –

      The unique identifier for the firewall rule.

    • name (string) –

      The name of the firewall rule.

    • priority (integer) –

      The priority of the firewall rule.

    • dnsViewId (string) –

      The ID of the DNS view associated with this firewall rule.

    • queryType (string) –

      The DNS query type that this rule matches.

    • status (string) –

      The operational status of the firewall rule.

    • updatedAt (datetime) –

      The date and time when the firewall rule was last updated.

Exceptions

  • Route53GlobalResolver.Client.exceptions.InternalServerException

  • Route53GlobalResolver.Client.exceptions.ValidationException

  • Route53GlobalResolver.Client.exceptions.ConflictException

  • Route53GlobalResolver.Client.exceptions.ServiceQuotaExceededException

  • Route53GlobalResolver.Client.exceptions.AccessDeniedException

  • Route53GlobalResolver.Client.exceptions.ThrottlingException

  • Route53GlobalResolver.Client.exceptions.ResourceNotFoundException