CodeNewbie Community 🌱

Sharon428931
Sharon428931

Posted on

Configuring and Testing SafeLine WAF with DVWA

SafeLine WAF is an open-source Web Application Firewall designed to protect your applications from common web threats.

In this guide, we’ll walk through configuring SafeLine to protect DVWA (Damn Vulnerable Web Application), enabling HTTPS, and verifying that the firewall rules work as expected.


Configuring SafeLine WAF

Adding DVWA to the Application Tab

  1. In the SafeLine dashboard, navigate to the Application tab.
  2. Add a new application with the following settings:
    • Domain: www.dvwa.local
    • Port: 443
    • Reverse Proxy: http://10.0.0.147:8080
  3. Enable:
    • HTTP Flood: Protects against DoS attacks by rate limiting requests.
    • Auth: Enforces username/password authentication.
  4. Use the 7-day PRO license trial to unlock all features.

At this point, all incoming requests to www.dvwa.local will go through the SafeLine firewall and be forwarded to port 8080 on the DVWA server.


Creating and Importing an SSL Certificate

To secure DVWA over HTTPS, generate a self-signed SSL certificate:

openssl genrsa -out private.key 4096
openssl req -new -key private.key -out private.csr
openssl x509 -req -days 365 -in private.csr -signkey private.key -out private.crt
Enter fullscreen mode Exit fullscreen mode

Once generated, import the certificate into SafeLine via the dashboard.


Testing the Configuration from Kali Browser

  1. From a browser in Kali Linux, access:
   http://dvwa.local
Enter fullscreen mode Exit fullscreen mode

You should be redirected to:

   https://dvwa.local
Enter fullscreen mode Exit fullscreen mode
  1. Confirm that DVWA is accessible over HTTPS and that SafeLine is enforcing the configured rules.


Conclusion

With SafeLine WAF now protecting DVWA:

  • All requests are filtered through the firewall before reaching the application.
  • DoS protection and authentication are enabled.
  • HTTPS is enforced with a self-signed SSL certificate.

This setup is ideal for testing WAF rules, experimenting with penetration testing techniques, or building secure lab environments.


Join the SafeLine Community

If you continue to experience issues, feel free to contact SafeLine support for further assistance.

Top comments (0)