Description |
This article describes a way to block external DNS queries to an internal DNS server when it is exposed to the internet. |
||
Scope |
FortiGate. |
||
Solution |
The following setup is used in this example:
Topology:
For this solution, the following policies are in place for traffic:
Configuration:
The WAN to DMZ policy:
config firewall policy edit 4 set name "WAN-DMZ" next end
The DNS Filter:
Here, take the most important action to break DNS attacks: create an wildcard *.* with the option to 'Redirect to Block Portal'. Here, there is an option that is not shown in the GUI that must be changed. See below:
The code:
config dnsfilter profile edit "Block-attack" config domain-filter set domain-filter-table 1 end config ftgd-dns config filters edit 1 set category 1 edit 91 set action block next end end set block-action block-sevrfail <- It is critical to change this. next end
If the block-action is not changed from 'redirect' to 'block-servfail', the attacker will receive the answer from the FortiGate (the IP of the Fortinet SDNS portal), and will continue the attack. But if this action is changed to block-servfail, the attacker will receive an error and will likely stop due to understanding that no DNS server will respond.
Conclusion
This is one method to prevent this type of attack. It is recommended to use it in combination with other methods and strategies. |
The Fortinet Security Fabric brings together the concepts of convergence and consolidation to provide comprehensive cybersecurity protection for all users, devices, and applications and across all network edges.
Copyright 2024 Fortinet, Inc. All Rights Reserved.