Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


    Cloudron Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular

    Incorporate a WAF built into cloudron

    Feature Requests
    firewall
    4
    7
    396
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M
      Mastadamus last edited by girish

      It would be awesome to incorporate a application level WAF so we can get some WAF coverage if we are self hosted. Mod security can be integrated with the standard version of NGINX I believe. Here is a link to a setup guide for containerized nginx with modsecurity. Could we get something like this in cloudron? that would be a huge benefit for security out of the box. https://janikvonrotz.ch/2020/02/26/nginx-waf-with-modsecurity-and-owasp-crs/

      girish 1 Reply Last reply Reply Quote 6
      • girish
        girish Staff @Mastadamus last edited by

        @mastadamus Unfortunately, many WAF features are not in the opensource version of nginx but in nginx plus. See https://docs.nginx.com/nginx-waf/ .

        That said, it should totally possible to move to apache instead of nginx for the reverse proxy, with some effort.

        fbartels M 2 Replies Last reply Reply Quote 0
        • fbartels
          fbartels App Dev @girish last edited by

          @girish said in Incorporate a WAF built into cloudron:

          it should totally possible to move to apache instead of nginx for the reverse proxy, with some effort

          I'm not sure if moving from Nginx to Apache is a very "modern" decision. There has been a buzz on this forum about Crowdsec a few weeks ago, maybe this would another approach that is possible (although the downside seems to be that you lock people into a third party SaaS).

          In regards to reverse proxies. I recently spent quite some time working with apisix, which is basically nginx/openresty with an additional manage api in lua. It can get its route configuration either from etcd or a yaml file (other backends could afaik be implemented as plugins). And since its based on Nginx its quite fast.

          M 1 Reply Last reply Reply Quote 8
          • M
            Mastadamus @girish last edited by

            @girish modsecurity waf can be used with open source version of nginx. You are right in that nginx plus is more robust but mod security with regular nginx still offers a decent degree of protection
            Basic example

            1 Reply Last reply Reply Quote 2
            • M
              Mastadamus @fbartels last edited by

              @fbartels prob with crowdsec is that it can't intercept an attack. It acts after the fact, whereas a waf can filter.

              1 Reply Last reply Reply Quote 1
              • W
                wind.gmbh last edited by

                I do agree that a Web Application Firewall is a very important security feature that Cloudron should have.

                However:

                • Moving to Apache/ httpd is not a good idea. nginx is miles ahead when using it as a reverse proxy.
                • My experience with the OWASP ruleset is, that is produces a ton of false positives. The Comodo ruleset is a lot less time consuming to handle, as it rarely causes false positives.
                • @Mastadamus' solution is way too hacky, because it requires adding a PPA and compiling the module from source. This could severely impact stability.

                Looking for distributions with prebuilt nginx ModSecurity, I only found official packages for Arch Linux and FreeBSD.
                However, no packages available in Debian Sid, Fedora Rawhide and OpenSUSE Tumbleweed. Thus it may take some time for them to move to their respective stable downstream releases.

                Therefore I would propose to delay this issue until packages are moving into Ubuntu LTS/ other stable distributions. For Ubuntu, this will probably take some time, as Ubuntu 22.04 LTS is just around the corner.

                But maybe there will be some official Docker images for nginx that will contain ModSecurity a little earlier than that. As dockerizing nginx is probably a good idea anyways, the possible earlier availability of ModSecurity would increase the benefit of looking into that.

                girish 1 Reply Last reply Reply Quote 1
                • girish
                  girish Staff @wind.gmbh last edited by girish

                  @wind-gmbh FWIW, we don't use the upstream distro packages. We use the packages straight from nginx.org since they provide better security fixes - https://nginx.org/packages/ubuntu/pool/nginx/n/nginx/ . Looks like https://nginx.org/packages/ubuntu/pool/nginx/n/ is the pre-built modules they have.

                  1 Reply Last reply Reply Quote 1
                  • First post
                    Last post
                  Powered by NodeBB