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

Is pfBlockerNG able to block all outbound traffic except whitelistet sites?

Scheduled Pinned Locked Moved pfBlockerNG
23 Posts 9 Posters 5.1k 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.
  • R
    RolandW
    last edited by Jan 29, 2020, 8:25 PM

    I would like to block all outbound traffic except for a few whitelisted destinations (e.g. Windows updates) for security reasons. Whitelisting must be on domain name basis, not on IP-number basis, so that I cannot use IP rules for that.
    Even though pfBlockerNG was not made for that purpose (but for blacklisting malware/adware sites), I suspect that it might be able to do, what I need.

    So my questions:
    Is pfBlockerNG able to block all outbound traffic with the exception of a few whitelisted domain names?
    Will it be possible to install pfBlockerNG on an Netgate SG1100 or do I need a more powerful machine?

    N 1 Reply Last reply Jan 30, 2020, 10:24 PM Reply Quote 0
    • N
      NollipfSense @RolandW
      last edited by NollipfSense Jan 30, 2020, 10:26 PM Jan 30, 2020, 10:24 PM

      @RolandW Remember, a quick search would reveal the answer, since each week at least one person asked and received; also, the firewall already blocks all except what you allow...

      pfSense+ 23.09 Lenovo Thinkcentre M93P SFF Quadcore i7 dual Raid-ZFS 128GB-SSD 32GB-RAM PCI-Intel i350-t4 NIC, -Intel QAT 8950.
      pfSense+ 23.09 VM-Proxmox, Dell Precision Xeon-W2155 Nvme 500GB-ZFS 128GB-RAM PCIe-Intel i350-t4, Intel QAT-8950, P-cloud.

      1 Reply Last reply Reply Quote 1
      • R
        RolandW
        last edited by Jan 31, 2020, 9:06 AM

        Dear NollipfSense,

        thanks for the answer!
        unfortunately I was not able to find the answer to my questions even after performing an extended search, that's why I asked here.

        Your write, that the firewall blocks all except what I allow. By default, it's the other way round: outbound traffic is allowed unless denied. I know, that I can change that easily by creating a rule in pfSense. The point is, that whitelisting on pfSense level is possible only for IP-adresses. When whitelisting to allow Windows updates for example, I have to whitelist domain names ("windowsupdate.microsoft.com"), that are represented by hundreds of IP adresses. So whitelisting in pfSense itself is not helpful.

        That's why I thought, I could perform whitelisting on pfBlockerNG level, that has an option for whitelisting domain names.

        However, the question is, how pfSense and pfBlockerNG interact:

        1. does whitelisting in pfBlockerNG affect only those sites, that are blocked in pfBlockerNG?

        or

        1. can I allow outbound traffic to sites by whitelisting them in pfBlockerNG, even if outbound traffic is generally denied on pfSense level?

        or

        1. is it possible to deny all outbound traffic in pfBlockerNG and whitelist the domains needed?

        For a experienced user of pfSense and pfBlocker NG it might sound supid what I'm asking, however I was not able to find an answer to my question regarding the "interaction" of pfSense and pfBlockerNG. I would be very grateful, if you could give me a hint by answering my three questions ;-)

        1 Reply Last reply Reply Quote 0
        • J
          JeGr LAYER 8 Moderator
          last edited by Jan 31, 2020, 11:39 AM

          @RolandW said in Is pfBlockerNG able to block all outbound traffic except whitelistet sites?:

          does whitelisting in pfBlockerNG affect only those sites, that are blocked in pfBlockerNG?

          Actually that depends on what whitelisting you are talking about as pfBlocker has two things it can block. DNS Blacklists and via IP Feeds/Lists. DNS Blacklisting interacts with Unbound (the default DNS Resolver) whereas IP Feeds can auto-create rules (or aliases to be used in rules).

          So it depends what exactly you are asking.

          Don't forget to upvote ๐Ÿ‘ those who kindly offered their time and brainpower to help you!

          If you're interested, I'm available to discuss details of German-speaking paid support (for companies) if needed.

          1 Reply Last reply Reply Quote 0
          • R
            RolandW
            last edited by Jan 31, 2020, 2:12 PM

            Dear JeGr,
            what I want to do is basically simple: block all outbound traffic except for a few whitelisted domains.

            It's probably not possible to block all traffic using DNS blacklists with wildcards, neither it seems feasible to create IP feeds (that, as I understand, become aliases in pfSense rules), that block everything (1.1.1.1/0 ???), because they would probably be too long. Therefore, if whitelisting in pfBlockerNG is only meant for making exceptions to DNS blacklists, I probably cannot use pfBlockerNG for what I want to do.

            Have you got another idea what I could do?

            Roland

            N 1 Reply Last reply May 12, 2020, 5:04 PM Reply Quote 0
            • X
              xalex1977
              last edited by May 11, 2020, 9:25 PM

              hi,
              I'm interested too ....
              I should only allow these domains:
              *.larksuite.com
              *.ibytedtos.com
              *.byteoversea.com
              *.larksuitecdn.com
              and deny all the internet;
              even setting up a proxy squid, Larke software needs to have direct access to these domains without going through the proxy;
              how do i configure pfBlockerNG?
              client PCs use a windows active directory server as dns,
              how can I do it?
              thanks

              1 Reply Last reply Reply Quote 0
              • N
                NollipfSense @RolandW
                last edited by NollipfSense May 12, 2020, 5:05 PM May 12, 2020, 5:04 PM

                @RolandW It seems that you have the answer ... you claimed in your first post that you had a few IPs ... the correct action is to create aliases with the FEW IP addresses and then create LAN firewall rule to allow those and block all else. You really don't need pfBlockerNG.

                pfSense+ 23.09 Lenovo Thinkcentre M93P SFF Quadcore i7 dual Raid-ZFS 128GB-SSD 32GB-RAM PCI-Intel i350-t4 NIC, -Intel QAT 8950.
                pfSense+ 23.09 VM-Proxmox, Dell Precision Xeon-W2155 Nvme 500GB-ZFS 128GB-RAM PCIe-Intel i350-t4, Intel QAT-8950, P-cloud.

                X 1 Reply Last reply May 21, 2020, 9:47 PM Reply Quote 0
                • X
                  xalex1977 @NollipfSense
                  last edited by May 21, 2020, 9:47 PM

                  @NollipfSense said in Is pfBlockerNG able to block all outbound traffic except whitelistet sites?:

                  @RolandW It seems that you have the answer ... you claimed in your first post that you had a few IPs ... the correct action is to create aliases with the FEW IP addresses and then create LAN firewall rule to allow those and block all else. You really don't need pfBlockerNG.

                  I should only allow these domains:
                  *.larksuite.com
                  *.ibytedtos.com
                  *.byteoversea.com
                  *.larksuitecdn.com
                  and deny all the internet;
                  how do i configure pfBlockerNG DNSBL?

                  Thanks

                  N 1 Reply Last reply May 22, 2020, 3:40 AM Reply Quote 0
                  • N
                    NollipfSense @xalex1977
                    last edited by NollipfSense May 22, 2020, 3:50 AM May 22, 2020, 3:40 AM

                    @xalex1977 See the post above yours! You don't need pfBlockerNG ... here is a starting idea (see image below), then create a firewall rule to allow/pass any protocol from LAN net to destination (my connection Alias) then add another firewall rule below the first blocking all other connections. Help yourself from this info.

                    Screen Shot 2020-05-21 at 10.28.50 PM.png

                    Screen Shot 2020-05-21 at 10.48.27 PM.png

                    pfSense+ 23.09 Lenovo Thinkcentre M93P SFF Quadcore i7 dual Raid-ZFS 128GB-SSD 32GB-RAM PCI-Intel i350-t4 NIC, -Intel QAT 8950.
                    pfSense+ 23.09 VM-Proxmox, Dell Precision Xeon-W2155 Nvme 500GB-ZFS 128GB-RAM PCIe-Intel i350-t4, Intel QAT-8950, P-cloud.

                    X 1 Reply Last reply May 22, 2020, 7:43 AM Reply Quote 1
                    • X
                      xalex1977 @NollipfSense
                      last edited by May 22, 2020, 7:43 AM

                      @NollipfSense but with these aliases can not unlock all subdomains or with the latest versions also work for subdomains? ๐Ÿ™„

                      N 1 Reply Last reply May 22, 2020, 1:11 PM Reply Quote 0
                      • N
                        NollipfSense @xalex1977
                        last edited by May 22, 2020, 1:11 PM

                        @xalex1977 said in Is pfBlockerNG able to block all outbound traffic except whitelistet sites?:

                        @NollipfSense but with these aliases can not unlock all subdomains or with the latest versions also work for subdomains? ๐Ÿ™„

                        You won't need pfBlockerNG and not sure why you think it would not work for any subdomains ... remember, you could add up to 3,000 domains or subdomains to the alias my connection; so, stop rolling your eyes

                        pfSense+ 23.09 Lenovo Thinkcentre M93P SFF Quadcore i7 dual Raid-ZFS 128GB-SSD 32GB-RAM PCI-Intel i350-t4 NIC, -Intel QAT 8950.
                        pfSense+ 23.09 VM-Proxmox, Dell Precision Xeon-W2155 Nvme 500GB-ZFS 128GB-RAM PCIe-Intel i350-t4, Intel QAT-8950, P-cloud.

                        X J 2 Replies Last reply May 22, 2020, 2:01 PM Reply Quote 0
                        • X
                          xalex1977 @NollipfSense
                          last edited by May 22, 2020, 2:01 PM

                          @NollipfSense unfortunately from the software specifications I don't know the names of the subdomains and I think they change constantly, thanks for the help

                          N 1 Reply Last reply May 22, 2020, 2:09 PM Reply Quote 0
                          • N
                            NollipfSense @xalex1977
                            last edited by May 22, 2020, 2:09 PM

                            @xalex1977 You should start your own thread.

                            pfSense+ 23.09 Lenovo Thinkcentre M93P SFF Quadcore i7 dual Raid-ZFS 128GB-SSD 32GB-RAM PCI-Intel i350-t4 NIC, -Intel QAT 8950.
                            pfSense+ 23.09 VM-Proxmox, Dell Precision Xeon-W2155 Nvme 500GB-ZFS 128GB-RAM PCIe-Intel i350-t4, Intel QAT-8950, P-cloud.

                            1 Reply Last reply Reply Quote 0
                            • J
                              jhaeu90 @NollipfSense
                              last edited by jhaeu90 May 18, 2022, 10:17 AM May 18, 2022, 10:16 AM

                              @nollipfsense

                              You won't need pfBlockerNG and not sure why you think it would not work for any subdomains ... remember, you could add up to 3,000 domains or subdomains to the alias my connection; so, stop rolling your eyes

                              I have to bring this up again because I'm in a similar position:

                              I want to block all outbound traffic on 443 except a few whitelisted domains (teamviewer, windowsupdate).
                              I tried it with your approach of definining an alias with URLs but I'm always running into the problem that I can't whitelist every subdomain.
                              For example Windows update: there is a huge amount of subdomains that I would have to whitelist for Windows update to work... xxx.microsoftupdate.com

                              Can I use pfblocker for this and blacklist all except a whitelist with domains (including subdomains)? For example, allow access on 443 to *.microsoft.com . To my knowledge, this isn't possible with firewall rules only.

                              R N 2 Replies Last reply May 18, 2022, 7:17 PM Reply Quote 0
                              • R
                                RolandW @jhaeu90
                                last edited by May 18, 2022, 7:17 PM

                                @jhaeu90
                                I meanwhile figured out, how to do that: you need squid and squidguard. All http and https traffic (ports 80 & 443) then goes through squid/squidguard, the rest goes through the firewall.

                                In squid enable "Transparent http Proxy" & "SSL filtering", "splice all" intercept interface "LAN".

                                In squidguard create a "target category", in the "Domain List" put in all domains, that should be allowed. Then, under "common ACL" open the "Target rules list", set your newly created list to allow, and for "default access (all)" -> deny. Thats it!

                                To allow Windows updates I figured out by trial and error that you need to allow a lot of domains (not only windowsupdate.com)

                                J 1 Reply Last reply May 20, 2022, 11:39 AM Reply Quote 1
                                • N
                                  NollipfSense @jhaeu90
                                  last edited by May 18, 2022, 8:58 PM

                                  @jhaeu90 It might be easier to use firewall alias for all the sites you want to route via 443 and create a firewall .

                                  pfSense+ 23.09 Lenovo Thinkcentre M93P SFF Quadcore i7 dual Raid-ZFS 128GB-SSD 32GB-RAM PCI-Intel i350-t4 NIC, -Intel QAT 8950.
                                  pfSense+ 23.09 VM-Proxmox, Dell Precision Xeon-W2155 Nvme 500GB-ZFS 128GB-RAM PCIe-Intel i350-t4, Intel QAT-8950, P-cloud.

                                  1 Reply Last reply Reply Quote 0
                                  • J
                                    jhaeu90 @RolandW
                                    last edited by May 20, 2022, 11:39 AM

                                    @rolandw
                                    Thank you, this solved it for me.

                                    1 Reply Last reply Reply Quote 0
                                    • G greenlight referenced this topic on Nov 20, 2023, 12:32 PM
                                    • A abanet referenced this topic on Nov 24, 2023, 7:21 AM
                                    • C
                                      CZvacko
                                      last edited by Nov 29, 2023, 6:54 AM

                                      If Squid/LightSquid/SquidGuard becomes deprecated, I need some alternative to block everything except whitelist. Same solution as @RolandW wanted, i.e. whitelist domains using WILDCARDS like *microsoft.com to include subdomains.
                                      Firewall rules can't be used for that, eventually @RolandW used squid and squidguard, but that's no longer an option.
                                      So can this be done using pfBlockerNG? I have searched the forum for this but haven't found it.

                                      S keyserK 2 Replies Last reply Nov 29, 2023, 7:18 AM Reply Quote 0
                                      • S
                                        SteveITS Galactic Empire @CZvacko
                                        last edited by Nov 29, 2023, 7:18 AM

                                        @CZvacko itโ€™s been many years but long ago we had a client on a restricted Windows Server network (not pfSense). IIRC in Windows DNS Server we forwarded selected sites (so, domain override) to public DNS, and disabled using root servers which is a checkbox on Windows. So nothing else resolved. Maybe similar will work on pfSense?

                                        Pre-2.7.2/23.09: Only install packages for your version, or risk breaking it. Select your branch in System/Update/Update Settings.
                                        When upgrading, allow 10-15 minutes to restart, or more depending on packages and device speed.
                                        Upvote ๐Ÿ‘ helpful posts!

                                        1 Reply Last reply Reply Quote 0
                                        • keyserK
                                          keyser Rebel Alliance @CZvacko
                                          last edited by Nov 29, 2023, 7:31 AM

                                          @CZvacko I donโ€™t think you can achieve exactly that with pfBlockerNG.

                                          PfBlockerNG has a IP block feature that can be used both as a blocking and whitelisting option and that would be great to use - except you have no easy way to create the โ€œpositiveโ€ list with IP addresses of every subdomain.

                                          PfBlockerNG also has a DNS Blacklist option with a wildcard subdomain blocking - which is exactly what you want if it could be turned around as whitelisting feature. But I as far as I can figure there is no way to do that because what it really does is make the DNS server resolve all those names as a local or 0.0.0.0 address rather than actually resolve them.

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

                                          A 1 Reply Last reply Dec 1, 2023, 3:04 PM Reply Quote 0
                                          • First post
                                            Last post
                                          Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.
                                            This community forum collects and processes your personal information.
                                            consent.not_received