top of page
Christopher Lutat

How to Protect Exposed Web Applications in Your Homelab by Adding open-appsec WAF to Your Reverse Proxy

Zero-day attacks pose a significant threat to web applications, encompassing potential dangers that demand urgent attention. These attacks exploit vulnerabilities unknown to developers and security professionals, leaving your homelab susceptible to malicious activities.


Securing ingress traffic in a homelab with a reverse proxy is critical to prevent unauthorized access and safeguard sensitive data against the steady rise of unknown zero-day attacks as well as known web attacks like SQL injection, cross-site scripting (XSS), and other OWASP-TOP 10 attacks.


Personal Web Services often contain highly sensitive user data, for which an efficient protection is crucial. To name a few:


  • NAS Devices (Synology, QNAP)

  • Other Web Servers (WordPress, Discourse, Mattermost)

  • Backup Servers

  • Self-hosted Password Manager

  • Photo Library

  • Home Automation Platforms

  • and more


If those services get compromised, the impact can be extremely wide, ranging from exposure of personal data, loss of financial information, credential-loss or even an impact on the physical security of your home (smart door locks - anyone?).

A general security recommendation is to use a VPN for accessing your home network in a safe way, but unfortunately, often there are also good reasons to have at least some of your web-based services publicly reachable - some stuff is just meant to be shared with others.


For the purpose of exposing your web applications to the internet, on the network level,  it's considered best practice to have some reverse proxy deployed as the "entrance point" to your homelab, as this allows for routing traffic for different public DNS names to different backend services (e.g. your NAS device), although you usually only have a single public IP address at home (a static one, if you're lucky).


There are many popular free and open-source projects that can be deployed as a reverse proxy at home with low effort and are easy to manage. Three popular examples especially in homelab environments would be: 


  • NGINX: managed declaratively with nginx.conf file, available for Docker, Linux, Kubernetes (nginx.org).








  • NGINX Proxy Manager: this project adds an easy-to-use WebUI to manage NGINX locally, also includes Let's Encrypt support, UI-based log view, and more, deployed as a Docker container (Nginx Proxy Manager).








  • Docker SWAG  - Secure Web Application Gateway: configured declaratively, doesn't contain a WebUI by default, provides a quite easy and flexible way for deploying NGINX-based reverse-proxy alongside trusted certificate generation for your web services with Let's Encrypt, also includes fail2ban, deployed as Docker container (SWAG - LinuxServer.io).







How to protect the exposed web applications in your homelab against known and unknown web attacks by adding open-appsec WAF to your reverse proxy








open-appsec WAF provides automatic web application & API security using machine learning. It's an open-source project with a free community edition available, that provides integration with all of the above proxy solutions, and more. It's available for Linux, Docker and Kubernetes.


One of the key differentiators of open-appsec WAF against other WAF solutions is that the WAF engine does not require any signatures at all (or signature updates), as its technology is based from ground up on machine learning. This also allows open-appsec WAF to protect against unknown web attacks preemptively, unlike traditional WAF solutions which require an updated signature first to be developed and installed to prevent against new attack types once they become known, which takes time.


open-appsec WAF in the free community edition includes a variety of threat prevention capabilities, to name just a few:


  • WAF engine - machine learning-based threat prevention (no signatures required)

  • Snort rule support

  • Rate limiting

  • Integration with CrowdSec (Bouncer and also Intelligence Sharing) for community-based threat intelligence


There's a central management Web UI available at my.openappsec.io (included in the free community edition) that can be used as a comfortable alternative to managing open-appsec declaratively via configuration file (or CRDs in case of K8s), which is the second option and allows local management of open-appsec WAF.


Here are the specific deployment instructions for the open-appsec WAF integrations with each of the above proxy servers, which are perfectly suited and recommended for deployments in homelab environments:


NGINX Proxy (Linux, Docker, K8s) with open-appsec WAF: Getting Started | open-appsec (openappsec.io)


NGINX Proxy Manager (Docker) with open-appsec WAF:You can manage open-appsec WAF directly from the enhanced NGINX Proxy Manager WebUI. NGINX Proxy Manager Integration | open-appsec (openappsec.io)


Docker SWAG - Secure Web Application Gateway (Docker) with open-appsec WAF: Docker SWAG | open-appsec (openappsec.io)


You can find more details about the open-appsec project here:


If you are a software developer: Contributions are welcome!


 

open-appsec is an open-source project that builds on machine learning to provide pre-emptive web app & API threat protection against OWASP-Top-10 and zero-day attacks. It simplifies maintenance as there is no threat signature upkeep and exception handling, like common in many WAF solutions.


To learn more about how open-appsec works, see this White Paper and the in-depth Video Tutorial. You can also experiment with deployment in the free Playground.


Comments


Experiment with open-appsec for Linux, Kubernetes or Kong using a free virtual lab

bottom of page