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

FortiGate Brute Force Protection: Ban IPs After Failed Admin Login

by neo
December 10, 2025
in FortiGate
0
FortiGate Brute Force Protection: Ban IPs After Failed Admin Login

FortiGate Brute Force Protection: Ban IPs After Failed Admin Login

0
SHARES
140
VIEWS
Share on FacebookShare on LinkedIn
Table of Contents
  • Auto-Ban IPs After Failed Admin Login Attempts
  • Solution: SHAPER-BAN for Admin Login (CLI)
    • Check currently blocked IPs:
    • Clear all bans manually (if needed):
  • Risks / Considerations
  • Conclusion
    • Further Reading

Auto-Ban IPs After Failed Admin Login Attempts

Brute force attacks targeting FortiGate admin accounts are common. Hackers attempt to guess passwords, often trying multiple usernames and passwords from the same IP address. Each failed login attempt is logged, for example:

FGT[] Automation Stitch:E-Mail_Admin login failed is triggered.
log: date=2025-11-19 time=22:40:40 logid="0100032002" type="event" subtype="system" level="alert" vd="root" eventtime=1763588440 logdesc="Admin login failed" sn="0" user="ameier" ui="https(xxx.xxx.xxx.xxx)" method="https" srcip=xxx.xxx.xxx.xxx dstip=192.168.1.253 action="login" status="failed" reason="name_invalid" msg="Administrator ameier login failed from https(xxx.xxx.xxx.xxx) because of invalid user name"

In my case, I received an automatic email alert from my FortiGate firewall notifying me that someone was attempting to log in to the admin account. This kind of alert is part of FortiGate’s automation features and is critical for timely response.

Even though I use a complex and strong password, there is always a risk that an attacker could eventually crack it using brute-force techniques. Each additional safeguard, such as limiting failed login attempts and automatically banning IPs, significantly reduces this risk and adds a critical layer of protection to your network.

Even a single compromised account can be dangerous, and repeated login attempts increase the risk of breach.

Solution: SHAPER-BAN for Admin Login (CLI)

FortiGate provides a built-in mechanism to automatically block IP addresses after a configurable number of failed admin login attempts. Here’s how to configure it:

config system global
    set admin-lockout-threshold 2
    set admin-lockout-duration 86400
end

Explanation:

  • admin-lockout-threshold = Number of failed login attempts before the IP is blocked (2 in this case)
  • admin-lockout-duration = Duration of the ban in seconds (86400 seconds = 24 hours)

Check currently blocked IPs:

diagnose sys lockout list

Clear all bans manually (if needed):

diagnose sys lockout clear

Risks / Considerations

  • Locking yourself out: If you mistype your admin password twice, your IP will be blocked. Always test from a secondary management IP or VPN.
  • DoS risk: A malicious actor could intentionally trigger failed logins from another IP to “blacklist” your admin access. Consider combining SHAPER-BAN with VPN-only admin access.
  • Monitoring: Keep logs and alerts active to track lockouts and detect suspicious behavior.

Conclusion

Using SHAPER-BAN on FortiGate is an effective way to immediately block brute-force attempts, protecting your firewall and network from unauthorized access. Combined with VPN-only admin access and strong passwords, it dramatically reduces the attack surface for hackers targeting your admin accounts.

For even stronger security, it is highly recommended to disable direct admin access via SSH or HTTPS from the internet. Instead, access the FortiGate admin interface only through a secure VPN. This ensures that even if attackers try brute-force attacks, they cannot reach your firewall directly from the public internet.

Further Reading

  • FortiGate DDoS Protection: Configure DoS Policies to Secure Self-Hosted Applications
  • How to Protect a Self-Hosted Application from Brute Force Attacks with FortiGate

Tags: fortigate
Previous Post

Install Portainer on Ubuntu 24.04 Using Docker Compose

Next Post

Maximizing Network Efficiency with AdGuard: My 7-Day Results

neo

Related Posts

FortiGate Country Address Object Generator – Block or Allow Access by Country
FortiGate

FortiGate Country Address Object Generator – Block or Allow Access by Country

Home Lab with Fortinet FortiGate 60D Firewall
FortiGate

Home Lab with Fortinet FortiGate 60D Firewall

My Ultimate FortiGate Command Cheat Sheet
FortiGate

My Ultimate FortiGate Command Cheat Sheet

Setting Up IPS (Intrusion Detection System) Profiles on FortiGate to Detect Web Attacks
FortiGate

Setting Up IPS (Intrusion Detection System) Profiles on FortiGate to Detect Web Attacks

Protect a Self-Hosted Application from Brute Force Attacks with FortiGate
FortiGate

How to Protect a Self-Hosted Application from Brute Force Attacks with FortiGate

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

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

Next Post
Maximizing Network Efficiency with AdGuard: My 7-Day Results

Maximizing Network Efficiency with AdGuard: My 7-Day Results

Recommended

Linux Process, List all Running Services with ps Command

Check Running Processes and Services in Linux via ps

Lesson 4: Bash Control Structures – loops (for, while, until)

Lesson 4: Bash Control Structures – loops (for, while, until)

My Top 5 Applications to Run on Raspberry Pi with Ubuntu

My Top 5 Applications to Run on Raspberry Pi with Ubuntu (2026)

Maximizing Network Efficiency with AdGuard: My 7-Day Results

Maximizing Network Efficiency with AdGuard: My 7-Day Results

FortiGate Brute Force Protection: Ban IPs After Failed Admin Login

FortiGate Brute Force Protection: Ban IPs After Failed Admin Login

Categories

  • Blog
  • Cloud
    • Private
  • Linux Tutorials
    • Bash Scripting Tutorials
    • Commands
    • Networking
  • Network Tutorials
    • FortiGate
    • MikroTik
  • Projects
    • AdGuard
    • Immich
    • Nextcloud
    • WordPress
  • Solutions
    • Docker
  • Video Tutorials
    • MikroTik Videos
  • Web Tools

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

My Top 5 Applications to Run on Raspberry Pi with Ubuntu

My Top 5 Applications to Run on Raspberry Pi with Ubuntu (2026)

Maximizing Network Efficiency with AdGuard: My 7-Day Results

Maximizing Network Efficiency with AdGuard: My 7-Day Results

  • 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
    • Bash Scripts
  • Solutions
    • Docker
  • Network Tutorials
    • FortiGate
    • MikroTik
  • Projects
    • AdGuard
    • Immich
    • Nextcloud
    • WordPress
  • Cloud
  • Video Tutorials
    • YouTube Channel
    • MikroTik Videos
  • Web Tools

© 2025 defencedev.com - All rights reserved.