ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Securing FreePBX from attacks

    IT Discussion
    freepbx 14 freepbx security network security
    10
    67
    7.8k
    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.
    • EddieJenningsE
      EddieJennings
      last edited by

      I was going to add this to my thread about FreePBX CPU load, as this might be related, but then I'm reminded of the times I'm admonished by Jared for not making new threads. 😛

      I decided to look at my full Asterisk Log File (from the GUI) and expand it to 100,000 lines. All of the results are variants of this:

      [2017-08-30 17:41:15] NOTICE[18406] res_pjsip/pjsip_distributor.c: Request 'REGISTER' from '"530" <sip:[email protected]>' failed for '62.210.167.181:5068' (callid: 790905902) - No matching endpoint found

      [2017-08-30 17:41:15] NOTICE[18406] res_pjsip/pjsip_distributor.c: Request 'REGISTER' from '"530" <sip:[email protected]>' failed for '62.210.167.181:5068' (callid: 790905902) - Failed to authenticate

      Clearly this isn't legit traffic, as none of my test end points are on a network that would have addresses allocated by RIPE. Despite, following the wizard when I installed, I notice that the pjsip isn't enabled within the Responsive Firewall. I've since enabled it.
      0_1504115931956_a02a6052-843c-4c73-a467-e5b380dff83e-image.png

      I'm curious to know what you folks do to protect your FreePBX systems from traffic such as this.

      wirestyle22W 1 Reply Last reply Reply Quote 1
      • wirestyle22W
        wirestyle22 @EddieJennings
        last edited by

        @eddiejennings Did you setup fail2ban?

        EddieJenningsE 1 Reply Last reply Reply Quote 1
        • EddieJenningsE
          EddieJennings @wirestyle22
          last edited by

          @wirestyle22 Not explicitly. I assumed that was setup when you say "yes" to the Responsive Firewall setup within the FreePBX installer.

          wirestyle22W 1 Reply Last reply Reply Quote 0
          • wirestyle22W
            wirestyle22 @EddieJennings
            last edited by wirestyle22

            @eddiejennings said in Securing FreePBX from attacks:

            @wirestyle22 Not explicitly. I assumed that was setup when you say "yes" to the Responsive Firewall setup within the FreePBX installer.

            Ask @JaredBusch. It may just protect you from people attempting to directly login to the server itself. Unsure.

            EddieJenningsE 1 Reply Last reply Reply Quote 0
            • EddieJenningsE
              EddieJennings @wirestyle22
              last edited by

              @wirestyle22 said in Securing FreePBX from attacks:

              @eddiejennings said in Securing FreePBX from attacks:

              @wirestyle22 Not explicitly. I assumed that was setup when you say "yes" to the Responsive Firewall setup within the FreePBX installer.

              Ask Jared. It may just protect you from people attempting to directly login to the server itself. Unsure.

              Yeah. The goal of this thread is to see what others do in general to protect their FreePBX systems. And there are logs available for Fail2Ban, so I assume it is running.

              1 Reply Last reply Reply Quote 0
              • JaredBuschJ
                JaredBusch
                last edited by

                Your fail2ban is running. This is the responsive firewall doing its job.

                It takes multiple attempts in order to block. Most bot designers know this and don't attack many times.

                wirestyle22W EddieJenningsE 2 Replies Last reply Reply Quote 2
                • wirestyle22W
                  wirestyle22 @JaredBusch
                  last edited by

                  @jaredbusch said in Securing FreePBX from attacks:

                  Your fail2ban is running. This is the responsive firewall doing its job.

                  It takes multiple attempts in order to block. Most bot designers know this and don't attack many times.

                  How many and over what amount of time?

                  1 Reply Last reply Reply Quote 0
                  • EddieJenningsE
                    EddieJennings @JaredBusch
                    last edited by

                    @jaredbusch said in Securing FreePBX from attacks:

                    Your fail2ban is running. This is the responsive firewall doing its job.

                    It takes multiple attempts in order to block. Most bot designers know this and don't attack many times.

                    By default pjsip was disabled (above pic was after I enabled). Was anything really gained by enabling it? I imagine the answer is "yes."

                    In day-to-day administration, do you usually ignore this and let Fail2Ban do its thing, or do you start adding these hosts to the Blacklist with the Firewall > Services setting?

                    AdamFA 1 Reply Last reply Reply Quote 0
                    • AdamFA
                      AdamF @EddieJennings
                      last edited by

                      @eddiejennings said in Securing FreePBX from attacks:

                      @jaredbusch said in Securing FreePBX from attacks:

                      Your fail2ban is running. This is the responsive firewall doing its job.

                      It takes multiple attempts in order to block. Most bot designers know this and don't attack many times.

                      By default pjsip was disabled (above pic was after I enabled). Was anything really gained by enabling it? I imagine the answer is "yes."

                      In day-to-day administration, do you usually ignore this and let Fail2Ban do its thing, or do you start adding these hosts to the Blacklist with the Firewall > Services setting?

                      You will die tired adding IPs to blacklists. Just let the responsive firewall and Fail2Ban do its thing.

                      EddieJenningsE 1 Reply Last reply Reply Quote 3
                      • EddieJenningsE
                        EddieJennings @AdamF
                        last edited by

                        @fuznutz04 said in Securing FreePBX from attacks:

                        @eddiejennings said in Securing FreePBX from attacks:

                        @jaredbusch said in Securing FreePBX from attacks:

                        Your fail2ban is running. This is the responsive firewall doing its job.

                        It takes multiple attempts in order to block. Most bot designers know this and don't attack many times.

                        By default pjsip was disabled (above pic was after I enabled). Was anything really gained by enabling it? I imagine the answer is "yes."

                        In day-to-day administration, do you usually ignore this and let Fail2Ban do its thing, or do you start adding these hosts to the Blacklist with the Firewall > Services setting?

                        You will die tired adding IPs to blacklists. Just let the responsive firewall and Fail2Ban do its thing.

                        Heh. That's what I figured. I ask, for I'm curious as to what the expected administrative behavior is.

                        AdamFA 1 Reply Last reply Reply Quote 0
                        • AdamFA
                          AdamF @EddieJennings
                          last edited by

                          @eddiejennings said in Securing FreePBX from attacks:

                          @fuznutz04 said in Securing FreePBX from attacks:

                          @eddiejennings said in Securing FreePBX from attacks:

                          @jaredbusch said in Securing FreePBX from attacks:

                          Your fail2ban is running. This is the responsive firewall doing its job.

                          It takes multiple attempts in order to block. Most bot designers know this and don't attack many times.

                          By default pjsip was disabled (above pic was after I enabled). Was anything really gained by enabling it? I imagine the answer is "yes."

                          In day-to-day administration, do you usually ignore this and let Fail2Ban do its thing, or do you start adding these hosts to the Blacklist with the Firewall > Services setting?

                          You will die tired adding IPs to blacklists. Just let the responsive firewall and Fail2Ban do its thing.

                          Heh. That's what I figured. I ask, for I'm curious as to what the expected administrative behavior is.

                          For me, I do nothing in regards to the responsive firewall. It adds and removes as it needs to. If I have an IP get banned by the responsive firewall, I remove it. (This will sometimes happen, even when legitimate extensions attempt to connect) In that case, if it is a known IP, you could add them to the trusted networks.

                          In regards to Fail2Ban, I put my local IP in, so I am never accidentally banned, and then set the max tries REALLY low, and set the ban time to REALLY high. It does a decent job overall. If you have remote users using softphones, this is the only way I know of to really secure the PBX.

                          1 Reply Last reply Reply Quote 0
                          • anthonyhA
                            anthonyh
                            last edited by

                            The only external presence our FreePBX deployment has is to our SIP trunk provider. So we do the obvious and set up the firewall policy so that only our trunk provider is allowed inbound to the PBX and only over the necessary ports.

                            I have been considering opening up SIP/RTP to the public as there have been instances where setting up remote phones would be beneficial, but not knowing how to mitigate potential attacks has stopped me. However, we did purchase some Yealink! phones that seem to support OpenVPN...I've been considering building an OpenVPN server for us to use in the event we need to set up a remote phone.

                            EddieJenningsE 1 Reply Last reply Reply Quote 1
                            • EddieJenningsE
                              EddieJennings @anthonyh
                              last edited by EddieJennings

                              @anthonyh The all of our users will be remote to the FreePBX system as it'll be hosted on Vultr; however, just allowing traffic from my office isn't an option, as the majority of the users will be outside of the office.

                              anthonyhA 1 Reply Last reply Reply Quote 0
                              • anthonyhA
                                anthonyh @EddieJennings
                                last edited by

                                @eddiejennings I should have added that my post wouldn't be very helpful. 😄

                                It sounds like what you need is a way to perform something like Fail2Ban on SIP authentication.

                                JaredBuschJ 1 Reply Last reply Reply Quote 0
                                • anthonyhA
                                  anthonyh
                                  last edited by

                                  Perhaps you've already seen this?

                                  https://www.voip-info.org/wiki/view/Fail2Ban+(with+iptables)+And+Asterisk

                                  1 Reply Last reply Reply Quote 0
                                  • JaredBuschJ
                                    JaredBusch @anthonyh
                                    last edited by

                                    @anthonyh said in Securing FreePBX from attacks:

                                    @eddiejennings I should have added that my post wouldn't be very helpful. 😄

                                    It sounds like what you need is a way to perform something like Fail2Ban on SIP authentication.

                                    FreePBX already does this.

                                    anthonyhA 1 Reply Last reply Reply Quote 3
                                    • JaredBuschJ
                                      JaredBusch
                                      last edited by JaredBusch

                                      From my email this morning

                                      0_1504190155943_IMG_6943.PNG

                                      1 Reply Last reply Reply Quote 0
                                      • anthonyhA
                                        anthonyh @JaredBusch
                                        last edited by

                                        @jaredbusch Hmm. If that's the case, what's the issue here? lol

                                        wirestyle22W 1 Reply Last reply Reply Quote 0
                                        • wirestyle22W
                                          wirestyle22 @anthonyh
                                          last edited by

                                          @anthonyh said in Securing FreePBX from attacks:

                                          @jaredbusch Hmm. If that's the case, what's the issue here? lol

                                          That is his point. There is no issue.

                                          1 Reply Last reply Reply Quote 0
                                          • EddieJenningsE
                                            EddieJennings
                                            last edited by

                                            Yeah. The "issue" is me seeing the malicious traffic, and starting a discussion about what's considered best practice for securing a FreePBX server.

                                            DashrenderD anthonyhA 2 Replies Last reply Reply Quote 2
                                            • 1
                                            • 2
                                            • 3
                                            • 4
                                            • 1 / 4
                                            • First post
                                              Last post