• Contact
  • About Me
  • Privacy Policy
  • Disclaimer
DefenceDev
  • Home
  • Blog
  • Linux Tutorials
    • Bash Scripting Lessons
    • Commands
    • Networking
  • Solutions
    • Docker
  • Network Tutorials
    • FortiGate
    • MikroTik
  • Projects
    • AdGuard
    • Immich
    • Nextcloud
    • WordPress
  • Cloud
  • Video Tutorials
    • YouTube Channel
    • MikroTik Videos
No Result
View All Result
  • Home
  • Blog
  • Linux Tutorials
    • Bash Scripting Lessons
    • Commands
    • Networking
  • Solutions
    • Docker
  • Network Tutorials
    • FortiGate
    • MikroTik
  • Projects
    • AdGuard
    • Immich
    • Nextcloud
    • WordPress
  • Cloud
  • Video Tutorials
    • YouTube Channel
    • MikroTik Videos
No Result
View All Result
DefenceDev
No Result
View All Result
ADVERTISEMENT
Home Network Tutorials FortiGate

FortiGate DDoS Protection: Configure DoS Policies to Secure Self-Hosted Applications

neo by neo
July 2, 2025
in FortiGate
0
FortiGate DDoS Protection: Configure DoS Policies to Secure Self-Hosted Applications

FortiGate DDoS Protection: Configure DoS Policies to Secure Self-Hosted Applications

0
SHARES
15
VIEWS
Share on FacebookShare on Twitter
ADVERTISEMENT

DDoS Protection with Fortinet FortiGate Firewall

Distributed Denial of Service (DDoS) attacks are among the most common and disruptive forms of cyber threats today. Their goal is to overwhelm a server or application with excessive traffic, rendering it slow or completely unavailable to legitimate users.

One common method is a SYN flood attack, where the attacker sends a large volume of incomplete TCP connection requests (SYN packets) to exhaust server resources and prevent new connections. Other variations include UDP floods, ICMP floods, or application-level attacks targeting HTTP or DNS.

Applications that are public-facing and self-hosted — such as web servers, email servers, VPN gateways, or VoIP systems — are especially vulnerable. Without proper mitigation, these services can be brought down quickly by even relatively small-scale attacks.

Fortinet FortiGate firewalls provide a powerful defense mechanism through their DoS Policy and Anomaly-Based Detection features. These allow administrators to define thresholds for various traffic types and automatically detect unusual patterns like SYN floods, connection spikes, or packet anomalies.

In this guide, we’ll walk you through:

  • How FortiGate detects and mitigates abnormal traffic
  • What types of protection you can enable using DoS Policies
  • How to create a rule to protect your self-hosted applications
  • Key best practices for monitoring and adjusting DoS settings

Whether you’re hosting your own services or managing infrastructure for others, proper DDoS protection is not optional — it’s essential.

Understanding FortiGate’s DDoS Detection and Traffic Mitigation

FortiGate uses anomaly-based detection to monitor traffic patterns and identify traffic behavior in real time. Instead of relying solely on static signatures, this method inspects the rate and volume of packets — such as SYN, FIN, RST, UDP, ICMP, and others — to detect suspicious spikes or floods that deviate from expected norms.

Each type of traffic can be individually tracked, and FortiGate allows you to define custom thresholds. For example, you can set a maximum number of SYN packets per second per source IP. If this threshold is exceeded, the firewall can trigger specific actions such as:

  • Block the offending IP temporarily
  • Log the event for review and auditing
  • Send alerts via email or SNMP
  • Rate-limit the traffic to reduce load

Mitigation begins immediately upon detection. FortiGate can drop suspicious packets before they reach the internal network, reducing the burden on servers and protecting application uptime.

In addition to real-time filtering, FortiGate provides historical event logs and reports that help administrators analyze the nature of attempted attacks and fine-tune policies over time. This proactive and adaptive approach ensures a resilient defense against evolving DDoS threats.

What Types of Protection You Can Enable Using DoS Policies

FortiGate’s DoS Policy feature offers granular protection against various forms of network-layer and transport-layer denial-of-service attacks. These policies allow you to define inspection rules that monitor traffic on specific interfaces — typically the one facing the internet — and take automated action when malicious patterns are detected.

With DoS Policies, you can enable protection for the following types of traffic anomalies:

  • SYN Flood – Protects against excessive TCP handshake attempts that can exhaust server resources.
  • UDP Flood – Detects and blocks high-volume, connectionless traffic used to overwhelm applications.
  • ICMP Flood – Prevents attackers from flooding your system with ping requests.
  • RST and FIN Floods – Monitors abnormal rates of TCP connection teardown packets.
  • Port Scan Detection – Identifies and mitigates scanning behavior used for reconnaissance.
  • Session Flood – Limits the number of concurrent sessions a source can create in a given timeframe.

Each of these anomaly types can be configured with threshold values for:

  • Log Only – Monitor the activity but allow the traffic.
  • Block – Drop packets that exceed the threshold.
  • Both Log and Block – Recommended for security-critical interfaces.

These protections are particularly effective for self-hosted applications, such as websites or services behind your FortiGate, where unexpected surges in traffic could indicate an active attack. By enabling the right mix of protections, FortiGate acts as a smart filter — stopping threats before they reach your internal infrastructure.

ADVERTISEMENT
DoS policy creation and list of possible detections
DoS policy creation and list of possible detections
FortiGate - List of possible detections
FortiGate – List of possible detections

In this case, I reduced the thresholds because the location does not have high traffic volume, allowing for stricter limits without impacting legitimate users.

ADVERTISEMENT

How to Create a Rule to Protect Your Self-Hosted Applications

To protect your self-hosted services (such as web servers, VPN gateways, or mail servers) behind a FortiGate firewall, you can create a DoS Policy that applies to the WAN interface and monitors traffic targeting internal servers. Here’s a step-by-step guide on how to configure it through the FortiGate GUI:

ADVERTISEMENT

Step-by-Step FortiGate DoS Configuration

  1. Log in to the FortiGate Web Interface
  2. Navigate to:
    Policy & Objects > DoS Policy
  3. Click “Create New” to add a new rule.
  4. Configure the following settings:
    • Incoming Interface:
      Select your WAN interface (e.g., port1 or wan1)
    • Source Address:
      Set to all or define a specific address group (optional)
    • Destination Address:
      Select the server or service you want to protect (e.g., web-server)
    • Service:
      Choose relevant services like HTTP, HTTPS, DNS, or use ALL if needed
  5. Enable Anomaly Detection: Scroll down to the Anomaly Threshold section and configure detection rules for specific types of traffic:
    • TCP_SYN_FLOOD: e.g., 1000 packets per second
    • UDP_FLOOD: e.g., 500 packets per second
    • ICMP_FLOOD: e.g., 200 packets per second
    • Port Scan, Session Flood, etc.
    You can customize each anomaly by setting:
    • Status: Enable for checking
    • Threshold (pps)
    • Action: Block, Pass
    • Logging
  6. Click OK to save and activate the policy.
Create a new DoS Policy
Create a new DoS Policy
Standard thresholds for new DoS Policy
Standard thresholds for new DoS Policy
If IPv4 DoS Policy Feature is not Visible

If the DoS Policy option is not visible under Policy & Objects, you need to enable it manually:

Go to:
System → Feature Visibility → Additional Features → Enable DoS Policy

This will make the DoS Policy feature available in the GUI for configuration.

FortiGate Enable DoS Policy
FortiGate Enable DoS Policy

If you are interested in more hidden features, check out my post about them at the link.

Optional – Testing the Rule

You can test the protection using controlled traffic generators from an external host to verify that your FortiGate correctly detects and logs abnormal traffic behavior.

Important Warning:

  • Be extremely cautious when performing such tests, as they may violate local laws or ISP terms of service if misused or conducted outside your own infrastructure.
  • DDoS test traffic can degrade network performance or cause service outages, even in controlled environments.
  • Always perform tests only within your own network and under strictly controlled conditions, ideally in a lab or isolated test environment.

Testing is a powerful way to verify your configuration, but it should always be done responsibly and with full awareness of the risks involved.

FortiGate Anamaly Logs
FortiGate Anamaly Logs

DDos Protection Configuration on My FortiGate Device

  • Rule 3: Allows unrestricted access from my trusted public IP address (HOST_HOME-1) without any rate limits or blocking. This ensures your home connection is never affected by DoS protections.
  • Rule 1: Applies strict DoS protection for all other source IP addresses accessing your network via the WAN interface. Traffic from these IPs is monitored and blocked if it exceeds defined anomaly thresholds.

This setup creates a clear exception for your trusted IP, while protecting your self-hosted applications and network from potential DDoS attacks originating from other sources.

config firewall DoS-policy
    edit 3
        set interface "wan1"
        set srcaddr "HOST_HOME-1"
        set dstaddr "all"
        set service "ALL"
        config anomaly
            edit "tcp_syn_flood"
                set threshold 2000
            next
            edit "tcp_port_scan"
                set threshold 1000
            next
            edit "tcp_src_session"
                set threshold 5000
            next
            edit "tcp_dst_session"
                set threshold 5000
            next
            edit "udp_flood"
                set threshold 2000
            next
            edit "udp_scan"
                set threshold 2000
            next
            edit "udp_src_session"
                set threshold 5000
            next
            edit "udp_dst_session"
                set threshold 5000
            next
            edit "icmp_flood"
                set threshold 250
            next
            edit "icmp_sweep"
                set threshold 100
            next
            edit "icmp_src_session"
                set threshold 300
            next
            edit "icmp_dst_session"
                set threshold 1000
            next
            edit "ip_src_session"
                set threshold 5000
            next
            edit "ip_dst_session"
                set threshold 5000
            next
            edit "sctp_flood"
                set threshold 2000
            next
            edit "sctp_scan"
                set threshold 1000
            next
            edit "sctp_src_session"
                set threshold 5000
            next
            edit "sctp_dst_session"
                set threshold 5000
            next
        end
    next
    edit 1
        set interface "wan1"
        set srcaddr "all"
        set dstaddr "all"
        set service "ALL"
        config anomaly
            edit "tcp_syn_flood"
                set status enable
                set log enable
                set action block
                set threshold 200
            next
            edit "tcp_port_scan"
                set status enable
                set log enable
                set action block
                set threshold 100
            next
            edit "tcp_src_session"
                set status enable
                set log enable
                set action block
                set threshold 500
            next
            edit "tcp_dst_session"
                set status enable
                set log enable
                set action block
                set threshold 500
            next
            edit "udp_flood"
                set status enable
                set log enable
                set action block
                set threshold 2000
            next
            edit "udp_scan"
                set status enable
                set log enable
                set action block
                set threshold 2000
            next
            edit "udp_src_session"
                set status enable
                set log enable
                set action block
                set threshold 500
            next
            edit "udp_dst_session"
                set status enable
                set log enable
                set action block
                set threshold 500
            next
            edit "icmp_flood"
                set status enable
                set log enable
                set action block
                set threshold 250
            next
            edit "icmp_sweep"
                set status enable
                set log enable
                set action block
                set threshold 100
            next
            edit "icmp_src_session"
                set status enable
                set log enable
                set action block
                set threshold 300
            next
            edit "icmp_dst_session"
                set status enable
                set log enable
                set action block
                set threshold 100
            next
            edit "ip_src_session"
                set status enable
                set log enable
                set action block
                set threshold 500
            next
            edit "ip_dst_session"
                set status enable
                set log enable
                set action block
                set threshold 500
            next
            edit "sctp_flood"
                set status enable
                set log enable
                set action block
                set threshold 200
            next
            edit "sctp_scan"
                set status enable
                set log enable
                set action block
                set threshold 100
            next
            edit "sctp_src_session"
                set status enable
                set log enable
                set action block
                set threshold 500
            next
            edit "sctp_dst_session"
                set status enable
                set log enable
                set action block
                set threshold 500
            next
        end
    next
end

Key Best Practices for Monitoring and Adjusting DoS Settings

To ensure your FortiGate firewall provides effective and reliable DDoS protection, it’s important not only to configure DoS Policies, but also to monitor and fine-tune them regularly. Overly strict thresholds can block legitimate traffic, while lenient settings might let attacks through. Here are some key best practices:

  1. Start with Logging Mode
    When implementing new DoS policies, begin with “log only” mode to observe traffic behavior without enforcing blocks. This helps you identify normal traffic baselines.
  2. Analyze Event Logs Frequently
    Use the Log & Report > Anomaly section in the GUI to review detected anomalies. This will show you which IPs triggered alerts, what type of traffic was involved, and whether thresholds need to be adjusted.
  3. Use Interface-Specific Policies
    Apply DoS Policies only on the WAN interface (usually port1 or wan1) to inspect incoming traffic. Internal interfaces typically don’t need these protections.
  4. Set Realistic Thresholds
    Configure packet thresholds based on the average traffic your applications receive. Consider the number of users, peak hours, and expected session counts.
  5. Enable Notifications
    Configure alerts via email or SNMP to be notified in real-time when a DoS threshold is crossed. This allows for quick investigation and response.
  6. Update Firmware Regularly
    FortiOS updates often include improvements to anomaly detection and DoS logic. Keeping your device up to date ensures maximum effectiveness.
  7. Combine with Other Security Features
    Use DoS policies together with IP reputation, Geo-IP filters, and Web Application Firewall (WAF) for a layered defense approach.

By continuously monitoring and adjusting your DoS policies, you can maintain strong protection while minimizing false positives and service disruption. An adaptive security posture is the best defense against ever-changing DDoS tactics.

About The Author

neo

See author's posts

Tags: fortigate
ADVERTISEMENT
Previous Post

Fortinet FortiGate Site-to-Site IPsec VPN Troubleshooting

neo

neo

Related Posts

Fortinet FortiGate Site-to-Site IPsec VPN Troubleshooting
FortiGate

Fortinet FortiGate Site-to-Site IPsec VPN Troubleshooting

Why Upgrade to a FortiGate Firewall? Enhanced Security, Visibility & Performance for Businesses
FortiGate

Why Upgrade to a FortiGate Firewall? Enhanced Security, Visibility & Performance for Businesses

Configure FortiGate as a DHCP Server via GUI and CLI
FortiGate

Configure FortiGate as a DHCP Server via GUI and CLI

Fortinet FortiGate Logging: Log Management and Best Practices
FortiGate

Fortinet FortiGate Logging: Log Management and Best Practices

FortiGate Antivirus: Configuration, Best Practices, and Troubleshooting
FortiGate

FortiGate Antivirus: Configuration, Best Practices, and Troubleshooting

How to Reset a FortiGate Firewall to Factory Settings
FortiGate

How to Reset a FortiGate Firewall to Factory Settings

Leave a Reply

Your email address will not be published. Required fields are marked *


Recommended

Lesson 1: Introduction to Bash Scripting

Lesson 1: Introduction to Bash Scripting

Fortinet FortiGate Site-to-Site IPsec VPN Troubleshooting

Fortinet FortiGate Site-to-Site IPsec VPN Troubleshooting

FortiGate DDoS Protection: Configure DoS Policies to Secure Self-Hosted Applications

FortiGate DDoS Protection: Configure DoS Policies to Secure Self-Hosted Applications

Fortinet FortiGate Site-to-Site IPsec VPN Troubleshooting

Fortinet FortiGate Site-to-Site IPsec VPN Troubleshooting

Raspberry Pi Monitoring with Monit: Docker, Temperature, Network & More

Raspberry Pi Monitoring with Monit: Docker, Temperature & More

ADVERTISEMENT

DefenceDev Tutorials

defencedev Logo

Whether you’re just starting or looking to expand your skills, I hope you find useful information and engaging discussions here. Let me take you through my journey and the goals behind this space!

Follow Us

Recent News

FortiGate DDoS Protection: Configure DoS Policies to Secure Self-Hosted Applications

FortiGate DDoS Protection: Configure DoS Policies to Secure Self-Hosted Applications

Fortinet FortiGate Site-to-Site IPsec VPN Troubleshooting

Fortinet FortiGate Site-to-Site IPsec VPN Troubleshooting

  • Site Map
  • Privacy Policy
  • Facebook Page
  • Disclaimer
  • Contact
  • About Me

© 2025 defencedev.com - All rights reserved.

No Result
View All Result
  • Home
  • Blog
  • Linux Tutorials
    • Bash Scripting Lessons
    • Commands
    • Networking
  • Solutions
    • Docker
  • Network Tutorials
    • FortiGate
    • MikroTik
  • Projects
    • AdGuard
    • Immich
    • Nextcloud
    • WordPress
  • Cloud
  • Video Tutorials
    • YouTube Channel
    • MikroTik Videos

© 2025 defencedev.com - All rights reserved.