I'm always excited to take on new projects and collaborate with innovative minds.

Phone

+855 12 282 686

Email

samnangrosady9@gmail.com

Social Links

Open Source Contributions

Fail2ban

Wall of safety to keep brute force attack away

Fail2ban

What is Fail2ban?

Fail2Ban is a free, open-source software tool that protects servers from brute-force attacks and other types of malicious activity. It monitors log files for suspicious activity and blocks IP addresses that are trying to access a server.

Why use Fail2ban?

There are several reasons to use Fail2ban:

  • Prevents brute force attacks on services
  • Reduces server load from automated login attempts
  • Provides an extra layer of security beyond firewalls
  • Notify when there is an IP is ban/unban through SMTP, Webhook

How it works

Image description

  • Fail2Ban scans log files for suspicious activity, such as too many access, failed attempts through access or error files
  • Fail2Ban creates a firewall rule to block the IP address that is causing the suspicious activity
  • The IP address is blocked for a specified amount of time

Basic understanding Fail2ban

Jails:

  • Jails serve as rule sets that dictate the conditions under which an IP address should face a ban which defined by monitoring log files
  • Predefined jail configurations can be found in /etc/fail2ban/jail.conf within Fail2ban

Filters:

  • Filters are instrumental in scrutinizing service logs using regex patterns to identify potentially malicious activities, like intrusion attempts.
  • These filters are typically stored in /etc/fail2ban/filter.d/

Actions:

  • Actions encompass a range of responses, from IP address bans to notifications and the execution of custom scripts
  • Commands outlining ban or unban procedures for IP addresses are typically housed in /etc/fail2ban/action.d/

GitHub Sample Repository 🐳

Enjoy you practice 🌟### What is Fail2ban?Fail2Ban is a free, open-source software tool that protects servers from brute-force attacks and other types of malicious activity. It monitors log files for suspicious activity and blocks IP addresses that are trying to access a server.

Why use Fail2ban?

There are several reasons to use Fail2ban:

  • Prevents brute force attacks on services
  • Reduces server load from automated login attempts
  • Provides an extra layer of security beyond firewalls
  • Notify when there is an IP is ban/unban through SMTP, Webhook

How it works

Image description

  • Fail2Ban scans log files for suspicious activity, such as too many access, failed attempts through access or error files
  • Fail2Ban creates a firewall rule to block the IP address that is causing the suspicious activity
  • The IP address is blocked for a specified amount of time

Basic understanding Fail2ban

Jails:

  • Jails serve as rule sets that dictate the conditions under which an IP address should face a ban which defined by monitoring log files
  • Predefined jail configurations can be found in /etc/fail2ban/jail.conf within Fail2ban

Filters:

  • Filters are instrumental in scrutinizing service logs using regex patterns to identify potentially malicious activities, like intrusion attempts.
  • These filters are typically stored in /etc/fail2ban/filter.d/

Actions:

  • Actions encompass a range of responses, from IP address bans to notifications and the execution of custom scripts
  • Commands outlining ban or unban procedures for IP addresses are typically housed in /etc/fail2ban/action.d/

GitHub Sample Repository 🐳

Enjoy you practice 🌟

3 min read
Jan 29, 2025
By Samnang Rosady
Share

Leave a comment

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

Related posts

Aug 15, 2025 • 1 min read
Redis Commander

redis commander: redis monitoring tool

May 08, 2025 • 3 min read
Jinja: The Templating Wizard That Saves Devs From Keyboard Trauma

Jinja: template engine

May 02, 2025 • 2 min read
A Guide to Setting Up Local HTTPS Portals with Docker

Mimicking production environments with HTTPS setups ensures more accur...