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

I want to Block all websites and allow only some

General pfSense Questions
4
16
5.2k
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.
  • K
    KOM
    last edited by Mar 16, 2018, 1:34 PM

    What are you doing to force your users to use the proxy?  I assume you're blocking 80/443tcp on LAN?

    1 Reply Last reply Reply Quote 0
    • A
      albtech
      last edited by Mar 16, 2018, 2:04 PM

      Actually I dont have blocked ports 80/443. But if I do this the LAN side will still have access to internet right ?

      1 Reply Last reply Reply Quote 0
      • A
        albtech
        last edited by Mar 19, 2018, 9:56 AM

        I have blocked traffic for ports TCP 80/443 and it all fine with blocking all webistes but the problem now is that the whiteliste dont work.
        I have add a Whitelist at Target Categories and configured as Whitelist at Common ACL and all other categories DENY.
        Default access is Allow.
        Also at Squid Proxy Server > ACL I have configured some websites as Whitelist.
        Can you help how to solve this issue?

        1 Reply Last reply Reply Quote 0
        • G
          Gertjan
          last edited by Mar 19, 2018, 10:20 AM

          @albtech:

          ….  Can you help how to block all webistes and prevent users from searching from search engines?

          All search engins ?
          As stated, block all connections who have a destination with port 80 or 443 in it.
          If not doing so, maintaining a "black" list will all  "search engines" is close to impossible.

          @albtech:

          Actually I dont have blocked ports 80/443. But if I do this the LAN side will still have access to internet right ?

          Closing 80/443 doesn't shut down you internet connection. Just all connections with a destination using port 80 and 443. These are the two that web servers - and web browsers use .
          mail, dns, frp, ssh, vpn, etc etc etc etc will still work.

          edit : have a look at what OpenDNS can do for you.

          No "help me" PM's please. Use the forum, the community will thank you.
          Edit : and where are the logs ??

          1 Reply Last reply Reply Quote 0
          • A
            albtech
            last edited by Mar 19, 2018, 10:40 AM

            We use opendns and want to pass to Pfsense but the problem now is that the whitelist is not working

            Closing 80/443 doesn't shut down you internet connection. Just all connections with a destination using port 80 and 443. These are the two that web servers - and web browsers use .
            mail, dns, frp, ssh, vpn, etc etc etc etc will still work.

            I know that other services will still work I only want to restrict them using the websites that the company dont allow.

            I have blocked traffic for ports TCP 80/443 and it all fine with blocking all webistes but the problem now is that the whiteliste dont work.
            I have add a Whitelist at Target Categories and configured as Whitelist at Common ACL and all other categories DENY.
            Default access is Allow.
            Also at Squid Proxy Server > ACL I have configured some websites as Whitelist.
            Can you help how to solve this issue?

            1 Reply Last reply Reply Quote 0
            • K
              KOM
              last edited by Mar 19, 2018, 1:27 PM

              Post screens of your config.  Remember that with squidguard, you must go back to the General settings tab and click Save then Apply for changes on any other tab to take effect.

              By the way, there is a dedicated forum for squid & squidguard, the Cache/Proxy forum.

              1 Reply Last reply Reply Quote 0
              • A
                albtech
                last edited by Mar 19, 2018, 2:19 PM

                Attached I have send the conf for Squid proxy and Squid Guard. I have used as BlackList http://www.shallalist.de/Downloads/shallalist.tar.gz

                After every change I click the Apply button  :)

                1.png
                1.png_thumb
                2.png
                2.png_thumb
                3.png
                3.png_thumb
                4.png
                4.png_thumb
                sg-1.png
                sg-1.png_thumb
                sg-2.png
                sg-2.png_thumb

                1 Reply Last reply Reply Quote 0
                • K
                  KOM
                  last edited by Mar 19, 2018, 2:27 PM

                  You need to set rotation on your squid logs or they will fill up your drive eventually.  You also might want to edit the X-Forward headers to delete, disable VIA mode and suppress squid version.

                  Next, show screens for squidguard: Common ACL and Target Categories.

                  1 Reply Last reply Reply Quote 0
                  • A
                    albtech
                    last edited by Mar 19, 2018, 4:32 PM

                    Next, show screens for squidguard: Common ACL and Target Categories.

                    ![common acl-1.png](/public/imported_attachments/1/common acl-1.png)
                    ![common acl-1.png_thumb](/public/imported_attachments/1/common acl-1.png_thumb)
                    ![common acl-2.png](/public/imported_attachments/1/common acl-2.png)
                    ![common acl-2.png_thumb](/public/imported_attachments/1/common acl-2.png_thumb)
                    ![common acl-3.png](/public/imported_attachments/1/common acl-3.png)
                    ![common acl-3.png_thumb](/public/imported_attachments/1/common acl-3.png_thumb)
                    ![Target Cat-1.png](/public/imported_attachments/1/Target Cat-1.png)
                    ![Target Cat-1.png_thumb](/public/imported_attachments/1/Target Cat-1.png_thumb)
                    ![Target Cat-2.png](/public/imported_attachments/1/Target Cat-2.png)
                    ![Target Cat-2.png_thumb](/public/imported_attachments/1/Target Cat-2.png_thumb)

                    1 Reply Last reply Reply Quote 0
                    • K
                      KOM
                      last edited by Mar 19, 2018, 4:41 PM

                      What happens if you change the Whitelist selector from Whitelist to Allow in the Target Rules List?

                      1 Reply Last reply Reply Quote 0
                      • A
                        albtech
                        last edited by Mar 19, 2018, 4:49 PM

                        Its the same thing even when use allow

                        1 Reply Last reply Reply Quote 0
                        • K
                          KOM
                          last edited by Mar 19, 2018, 5:30 PM

                          And each time you're going back to the General settings tab, clicking Save then Apply?

                          It's been awhile since I've setup a whitelist but it was working for me.  Make sure that it's order is first.

                          1 Reply Last reply Reply Quote 0
                          • A
                            albtech
                            last edited by Mar 21, 2018, 9:37 AM

                            I have done all as you said but it still dont work (after every change I click Apply at general settings) the webistes added to whitelist stay always loading and at the end shows that the site take too long to respond. I don't know what to do we are very confused at this point

                            1 Reply Last reply Reply Quote 0
                            • ?
                              Guest
                              last edited by Mar 21, 2018, 8:16 PM Mar 21, 2018, 8:11 PM

                              I have successfully done this entirely with aliases and pfsense rules only, on specific LAN interfaces. It is a very time consuming task to do this effectively by just using "Firewall Rules".

                              To be successful, you must be running Wireshark on a workstation on the LAN. Set the filter in Wireshark to DNS only, and resolve names while you browse the target website.  Observe ALL the coincident domains and Content Distribution Service providers ( CDN networks) needed to deliver the target website (Akamai, Fastly, ….)

                              Smaller independent sites are relatively easy to isolate. Anything hosted on AWS is virtually impossible isolate.

                              In some cases the best solution is to derive IP lists in pfblockerng using the ASN lookup feature to create "Aliase permit" list rules which  you can refer to from the firewall configuration screens. For example Facebook has its own ASN so its very easy to filter it either by blocks or permits. (ASN = Autonomous System Number)

                              Anyway that is the concept methodology in broad terms, to achieve your objective by just using "Firewall Rules". It's as much as I can help you with

                              Good luck !!

                              1 Reply Last reply Reply Quote 0
                              • A
                                albtech
                                last edited by Mar 23, 2018, 3:21 PM

                                UPDATE
                                I have created a CA and activate HTTPS/SSL Interception with this configuration :
                                SSL/MITM Mode –------------- Splice All
                                SSL Intercept Interface(s)----------- LAN
                                SSL Proxy Port----------3129
                                SSL Proxy Compatibility Mode ----------- Modern
                                DHParams Key Size-------------2048
                                CA------------- CA Filter (the cetificate that I have created)

                                other fields are default

                                At this point everything is ok the blacklist is blocked and the whitelist works but after some minutes some of whitelist goes black for example gmail.com. I have add it as gmail.com / mail.google.com in both Target Categories as whitelist and at Squid Proxy as whitelist at ACL.

                                • I have export the certificate and installed on Windows computer.
                                1 Reply Last reply Reply Quote 0
                                11 out of 16
                                • First post
                                  11/16
                                  Last post
                                Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.