Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    How to add username/password for fort forwadring in pfsense

    Scheduled Pinned Locked Moved NAT
    26 Posts 9 Posters 2.8k Views
    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.
    • DerelictD
      Derelict LAYER 8 Netgate
      last edited by

      That would just be running another web server application in front.

      What OP wants is a VPN.

      Chattanooga, Tennessee, USA
      A comprehensive network diagram is worth 10,000 words and 15 conference calls.
      DO NOT set a source address/port in a port forward or firewall rule unless you KNOW you need it!
      Do Not Chat For Help! NO_WAN_EGRESS(TM)

      1 Reply Last reply Reply Quote 0
      • keyserK
        keyser Rebel Alliance
        last edited by

        In my experience the feature OP is asking for is a really good and very usable idea. Remember that the world is full of old insecure enterprise software that no one knows how to maintain.

        I have used the Authentication feature in Microsofts long dead TMG Firewall for that feature for many years. It allowed you to setup a reverse https proxy where you had to complete form based user authentication to the proxy before the backend site was fetched/accessed.

        Unfortunately TMG is dead now, and we started to use VPN because I at the time could not find a solution for HAproxy on pfSense.
        VPN is Very cumbersome and annoying to say the least - so I would love if we could get the suggested HAproxy solution to work :-) I’m not able to test right now as it will be a couple of weeks before I’m back @ pfSsense maintenance

        Pretty good idea in my opinion.

        Love the no fuss of using the official appliances :-)

        C 1 Reply Last reply Reply Quote 0
        • C
          Crunk_Bass @keyser
          last edited by Crunk_Bass

          @keyser I got this HAProxy authentication thing working at home.
          The only thing that is different is I am using http for communication between proxy and server on the internal network.
          Just play with it for a few hours. It is not that complicated.
          If you get stuck maybe I can help you with your configuration.

          keyserK 1 Reply Last reply Reply Quote 0
          • keyserK
            keyser Rebel Alliance @Crunk_Bass
            last edited by

            @Crunk_Bass Thank you so much for that confirmation. I’ll give it a go when I get back. If I can make it work, I think it merrits a little tutorial writeup so others can take advantage of the feature.

            Love the no fuss of using the official appliances :-)

            1 Reply Last reply Reply Quote 0
            • keyserK
              keyser Rebel Alliance
              last edited by

              Even though I’m not home right now, the feedback from @Crunk_Bass has provided enough info to confirm that HAproxy now does support user authentication, and it is fairly simple to setup. I found this guide which I think will easily be adopted to pfSense:

              https://blog.taragana.com/guide-haproxy-http-basic-authentication-for-specific-sites-ssl-termination-15813

              Really cool HAproxy has this feature now. I don’t think it was the case about 8 years ago when I was looking for a TMG replacement - at least I was unable to google my way to the solution if it did exist.

              Excellent discovery :-)

              Love the no fuss of using the official appliances :-)

              T 1 Reply Last reply Reply Quote 0
              • johnpozJ
                johnpoz LAYER 8 Global Moderator
                last edited by

                @keyser said in How to add username/password for fort forwadring in pfsense:

                VPN is Very cumbersome and annoying to say the least

                Huh?? The corp world, every user every single day uses vpn... We have 1 customer that has 300+ users vpn'd in every single day.. That is just slow day - if its a snow day or something and more users working at home there are 500+ users vpn'd in.. To access corp resources.

                To say its cumbersome is just nonsense plain and simple... Its a click, and auth.. Can it be annoying when you have to put in your pin number to your ticks card in twice in less than 10 seconds sure ;) But this is how security works..

                Now they don't have 300+ users coming in via pfsense vpn... But you could ;)

                While such a thing is possible with haproxy, its not by any means the best solution to secure access to your apps.

                An intelligent man is sometimes forced to be drunk to spend time with his fools
                If you get confused: Listen to the Music Play
                Please don't Chat/PM me for help, unless mod related
                SG-4860 24.11 | Lab VMs 2.8, 24.11

                keyserK 1 Reply Last reply Reply Quote 0
                • keyserK
                  keyser Rebel Alliance @johnpoz
                  last edited by

                  @johnpoz I’m not arguing that VPN is not widely used or not the best solution. I’m just arguing that in lots af scenarios it’s a hazzle and annoying.
                  Most users don’t understand what VPN does to their networking connection/stack, some don’t get how and when to use i properly. We have lots of users without fixed devices, so they can only use it intermittenly.
                  On top of that there’s the whole distribution/installation/management of VPN clients on different clients... just sayin 😉

                  For webservices access a HTTPS authenticating Proxy has similar security as a VPN client. If you need the two factor auth, you can require a client certificate in HAproxy as well (that does open up the can of management and trouble again though :-) )

                  Love the no fuss of using the official appliances :-)

                  1 Reply Last reply Reply Quote 0
                  • T
                    tinju @keyser
                    last edited by

                    @keyser said in How to add username/password for fort forwadring in pfsense:

                    Even though I’m not home right now, the feedback from @Crunk_Bass has provided enough info to confirm that HAproxy now does support user authentication, and it is fairly simple to setup. I found this guide which I think will easily be adopted to pfSense:

                    https://blog.taragana.com/guide-haproxy-http-basic-authentication-for-specific-sites-ssl-termination-15813

                    Really cool HAproxy has this feature now. I don’t think it was the case about 8 years ago when I was looking for a TMG replacement - at least I was unable to google my way to the solution if it did exist.

                    Excellent discovery :-)

                    Interesting that the question in this topic came to my mind yesterday. However there is Kemp and the ESP feature that is actually the same as you described with TMG. There is also a free version just check the limitations.
                    The reason why one would like the authentication done by Pfsense and not at the service is that the service behind Pfsense is not known by bots. Thus you will not have 5000 css attempts a day on your WordPress site. And no webshell installed now and then. VPN is different. You mostly need software to access it. Its better in many cases but if you would like to give a Link and a Password to a friend. VPN is not the best match.
                    I try to setup this and let you know. There is already haproxy, LetsEncrypt and some backend servers for my domain. A password for some backend servers would be awesome. 😎👍

                    1 Reply Last reply Reply Quote 0
                    • C
                      caigeliu
                      last edited by

                      Thanks for all posts. I have tried HAProxy in pfSense, but it make our OpenVPN unable to access the same webpages in LAN. I stopped trying HAProxy, I don't know what I am wrong (I have read many online instructions.).

                      I don't know how to enable nginx in pfsense. Because there is no nginx in package manager of pfSense, but nginx is in pfsense.

                      I setup a separate host with nginx inside our LAN, and use port forwarding from outside via pfSense to the nginx after authentication, then forward to our service in LAN. It works.

                      It is good if we can combine the nginx host into pfSense.

                      1 Reply Last reply Reply Quote 0
                      • johnpozJ
                        johnpoz LAYER 8 Global Moderator
                        last edited by johnpoz

                        huh? I use ha proxy and share the port... Are you trying to use 443 with openvpn and on haproxy? If so then you have to tell openvpn to share port.

                        But yeah if your going to require a auth on the port your trying to do openvpn on - you could have issues for sure.

                        An intelligent man is sometimes forced to be drunk to spend time with his fools
                        If you get confused: Listen to the Music Play
                        Please don't Chat/PM me for help, unless mod related
                        SG-4860 24.11 | Lab VMs 2.8, 24.11

                        1 Reply Last reply Reply Quote 0
                        • DerelictD
                          Derelict LAYER 8 Netgate
                          last edited by

                          I port forward to HAproxy listening on a Localhost VIP and use split DNS to access inside HAproxy sites from inside/VPNs. (Outside connections get forwarded to the Localhost VIP, inside connections connect straight to the localhost VIP)

                          Chattanooga, Tennessee, USA
                          A comprehensive network diagram is worth 10,000 words and 15 conference calls.
                          DO NOT set a source address/port in a port forward or firewall rule unless you KNOW you need it!
                          Do Not Chat For Help! NO_WAN_EGRESS(TM)

                          1 Reply Last reply Reply Quote 0
                          • P
                            pwood999
                            last edited by

                            I also think VPN is the way to go (OpenVPN would be my choice), especially if you already have VPN for other staff. Simply configure overrides to restrict your development LAN from general users, and then create Clients for Win, Mac & Linux. Basic users can simply install the clients, wheres more knowledgeable peeps can use the raw config files or package.

                            I have done exactly this for various customer lab setups that required different access groups for various servers.

                            1 Reply Last reply Reply Quote 0
                            • First post
                              Last post
                            Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.