10.4. DNS ALG

Overview

DNS queries can provide a means of attack for malicious third parties. The DNS ALG feature can be used to monitor DNS queries as they flow through the firewall in the following scenarios:

Setting up the DNS ALG

Deploying the DNS ALG requires the following steps:

DNSAlgProfile Properties

The DNSAlgProfile object has the following properties:

State Tracking is Always Enabled

The DNS ALG has state tracking always enabled and there is no setting to control this. State tracking means that DNS queries and responses are matched to each other. A response with no matching query is automatically dropped.

Forms of DNS Attack and DNS ALG Defense Mechanisms

The DNS ALG is designed to provide a defense against the following forms of DNS attack:

DNS Translation

The DNS ALG can provide DNS translation to convert the result of a DNS query from one specific IP address to another. A typical use case for this feature is where the public IP address for a server returned by a DNS server should be translated to its private IP address for internal clients.

To implement IP translations, the steps are as follows:

Example 10.5. Using the DNS ALG with an Internal DNS Server

In this example, the DNS ALG is used to filter UDP DNS queries sent to a protected DNS server on a DMZ which are coming from the Internet. This is illustrated in the diagram below.

Command-Line Interface

Change the current CLI context to be the main IP rule set:

System:/> cc RuleSet IPRuleSet main

Create a SAT IP rule that uses the predefined DNS ALG profile:

System:/IPRuleSet/main> add IPRule
			SourceInterface=wan
			SourceNetwork=all-nets-ip4
			DestinationInterface=core
			DestinationNetwork=wan_ip
			Service=dns-udp
			Action=Allow
			DestinationTranslation=SAT
			SetDestinationAddress=Offset
			NewDestinationIP4=10.0.0.5
			DNSAlgProfile=dns
			Name=SAT_DNS_To_DMZ

Now, return to the default CLI context if no more rules are needed:

System:/IPRuleSet/main> cc
System:/> 

Example 10.6. Using the DNS ALG with Protected Clients

In this example, clients on the internal protected network if1_net are sending DNS queries out to the public Internet using NAT via the interface wan. This is illustrated in the diagram below.

A single translation will be applied that changes a DNS server response so that the IPv4 address 203.0.113.10 will be changed to 10.0.0.10.

Create a DNSTranslationList object:

System:/> add DNSTranslationList my_translations

Add DNSTranslation objects to the list:

Change the CLI context to the list:

System:/> cc DNSTranslationList my_translations

Add the translation:

System:/DNSTranslationList/my_translations> add DNSTranslation
			FromIP=203.0.113.10
			ToIP=10.0.0.10

Return to the default CLI context:

System:/DNSTranslationList/my_translations> cc
System:/> 

Create a custom DNSAlgProfile using the list:

System:/> add DNSAlgProfile my_dns_alg Translations=my_translations

Create an IPRule that uses the profile:

Change the CLI context to be the main IP rule set:

System:/> cc RuleSet IPRuleSet main

Create the IP rule:

System:/IPRuleSet/main> add IPRule
			SourceInterface=if1
			SourceNetwork=if1_net
			DestinationInterface=wan
			DestinationNetwork=all-nets-ip4
			Service=dns-udp
			Action=Allow
			DNSAlgProfile=my_dns_alg
			SourceTranslation=NAT
			SetSourceAddress=InterfaceAddress
			Name=NAT_DNS_to_Internet