Web application firewalls (WAFs) are important pieces of software that stand between the application and the outside Internet. By doing so, they shield it from hackers and other malicious entities trying to break the application and access user data.
Just like any typical category of software out there: There are proprietary SaaS software providing their service for a certain paid subscription per month, and there are free open source software that one can self-host without any additional strings attached.
SafeLine is one of these open source web application firewalls that can protect web applications from various types of attacks. And in today’s article, we’ll go on a tour through SafeLine to see how it can help businesses and app developers protect their systems.
SafeLine Features

So first of all, what makes this SafeLine software special anyway compared to its other open source alternatives in the market?
One can mention:
- It works as a nginx reverse proxy that can stand between any web application and the rest of the Internet.
- Ability to defend against web attacks such as XSS, SQL injections, CRLF injections, XXE and many more.
- Ability to defend against DoS (Denial of Service) attacks via a rate-limiting mechanism that monitors all incoming IP addresses requests.
- Built-in CAPTCHA challenge to be requested from visitors at will.
- Encryption support for JS and HTML code dynamically for visiting users.
- Beautiful control panel with real time statistics.
Firewall Effectiveness
By its own tests, SafeLine developers say that it can score up to a 99% accuracy in detecting malicious attacks on web applications, compared to a lower rate for its other competitors in the market:

Installation
Setting up SafeLine as a firewall is a straightforward process with little complication.
System Requirements
The official documentation of the software recommends 1GB of RAM and 1 CPU core minimum for running the software, but of course, it will depend on your application and the user traffic it receives.
SafeLine is written in Go and tries to have the lowest RAM and CPU consumption possible, but you can try to optimize for performance later on after installation.
Installation Method
The software ships as a Docker image that you can directly get and launch using the automated installation script:
bash -c "$(curl -fsSLk https://waf.chaitin.com/release/latest/manager.sh)" -- --en
Once done, you will see software running on https://<YOUR_IP_ADDRESS>:9443/ on your server. Open that address using your favorite web browser so that you can access the control panel:

Run the following command to get a username and password combination for your SafeLine instance:
docker exec safeline-mgt resetadmin
And then you will be able to login without problems!
Refer to the manual installation section in the docs if you would like to customize your installation further.
SafeLine Tour
Let’s go in a tour inside SafeLine to discover some of its features.
Dashboard
Once you enter the firewall control panel, and if you have a web application already in place, you will be greeted with an informative dashboard detailing every bit about the current status:

If you go down further, you will see more and more:

These statistics include:
- The current requests, visitors and blocked IPs numbers during the last period (24 hours, 7 days or 30 days).
- The country of most requests or most blocked ones, being beautifully displayed as a moving globe as well (you can toggle 2D or 3D view if you want).
- Queries per second your firewall is currently serving.
- Other interesting metrics about your visiting users.
A “hidden” feature that you may not have caught your eyes attention is “data dashboards”:

If you click that button then you will be able to launch an interactive dashboard showing what’s happening inside your firewall in real time:

And this is how it looks like:

It can help you understand how some flooding attacks are happening on your server – if they ever happen – and who is committing them.
It can also help you debug your web application and test it live.
Or maybe even to impress your grandma when she’s visiting home.
Adding Web Applications
The “applications” tab from the control panel is where you can add your web applications to make them under SafeLine’s protection.
Simply add a new application and choose the address and port it operates under on your server, and SafeLine will start shielding it:

Once added, you will see it in your list of applications:

Click on the “details” button near any of your applications to access its enabled security measures.
From this window, you can choose to enable or disable any protection mechanism in SafeLine WAF for your web application:

You can head to the advanced view as well if you would to toggle these options more deeply than before:

These options include SSL certificate settings, Gzip compression, headers policy, IP analysis source and much more.
You can either choose to toggle these options independently for each application as we just seen earlier, or using the global options view for ALL of your web applications that are currently being protected under SafeLine WAF:

It’s a pretty neat feature for a lot of use cases.
Security Attacks Prevention
You can navigate to the “Attacks” tab to view logs of current attack events on your server:

If you haven’t done so already, you can define “rules” for blocking any type of data from getting to your server according to your own needs. Just go to “settings” in order to add a new rule or view existing ones:

These options are possible for rules:

Once added, your WAF will start protecting your defined application end points according to the rules you have entered.
The “Semantic analysis” tab allows you to view all the supported attacks defense mechanisms in SafeLine as well as the applied policy for each type of attacks:

That’s pretty much all you need to protect your web application from a security point of view.
Anti-flooding
SafeLine also includes an anti-flooding firewall that can limit access rates according to your desires:

From its settings, you can set up any limit you want:

This allows you to make sure that no one can easily take down your web applications using common DoS (denial of service) attacks.
Alerts
A small nifty feature in SafeLine settings exists where you can set up alerts for unusual activities on your server, such as a high rate of attacks. You can link either Discord or Telegram bots to get instant notifications of these events:

Conclusion
Overall, SafeLine is so full of interesting features and defense mechanisms that can protect your web application from the dominant majority of attackers and malicious hackers. It offers a simple yet intuitive user interface for all of its components with real time capabilities, ensuring you can always know what’s happening in every part of your web application.
SafeLine WAF is available as a standalone open source version that you can configure and install, and advanced versions that you can subscribe into for $10 and $100 per month with additional features. Apparently, this is how they can support themselves and provide development costs for their team.
SafeLine is licensed under the GPLv3 license, and you can access additional information about it from its documentation portal.