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

    [solved] squidguard safesearch / rewrite dosent work

    Scheduled Pinned Locked Moved Cache/Proxy
    8 Posts 4 Posters 6.6k 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.
    • G
      gad_d
      last edited by

      Hi,
      I'm trying pfsense for several days now and find it impossible to have safe-search enforced
      I'm using squidguard

      Tried using the blacklist "safesearch" of http://www.shallalist.de/Downloads/shallalist.tar.gz

      rew safesearch {
      s@(google../search?.q=.)@&safe=active@i
      s@(google..
      /images.q=.)@&safe=active@i
      s@(google../groups.q=.)@&safe=active@i
      s@(google..
      /news.q=.)@&safe=active@i
      s@(yandex../yandsearch?.text=.)@&fyandex=1@i
      s@(search.yahoo..
      /search.p=.)@&vm=r&v=1@i
      s@(search.live../.q=.)@&adlt=strict@i
      s@(search.msn..
      /.q=.)@&adlt=strict@i
      s@(.bing..*/.q=.)@&adlt=strict@i
      log block.log
      }

      And tried configuring rewrite rules by my self according to what i found in various forums

      rew My-List {
      s@(.*youtube.com/.v=.)@&&safety_mode=true@i
      s@(.google../.q=.)@&&safe=strict%26@i
      s@(.duckduckgo.com.)@&&kp=1@i
      s@(.*bing.com/.q=.)@&&adlt=strict%26@i
      }

      only duckduckgo was enforced, the rest didnot

      any suggestions ?

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

        As far as the Google Safe Search, you will need to create a DNS entry in your DNS Forwarder to force a safesearch.

        But youtube, bing, yahoo, and several others have changed how they do content filter, and use a local cookie (not sure how it would be possible to enforce a safe search, ever now)… The other problem is, with most websites being HTTPS, unless you are using a MITM attack to force HTTPS through SQUID, the SquidGuard settings will never apply.

        TBH, I would set Bing, Yahoo, and pretty much all other search engines, to use the forced google safe search... Might upset your users, but, not much you can do anymore.
        https://support.google.com/websearch/answer/186669?hl=en

        1 Reply Last reply Reply Quote 0
        • G
          gad_d
          last edited by

          thanks for the suggestion, i actually used the DNS option and its working both for Google and Youtube

          the rewriter method seem to work partially in a weird way - i see it in firefox only - when i search something, then browse to another page and then coming back to the search page (using back button) i see that the URL is containing the rewrite strings and if i refresh the page it switch to safesearch mode…

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

            How did you get youtube to work properly with the safesearch?  That is something I have been wanting to do, but, haven't had luck with as far as I can tell… How does one even test that it works?  (Still learning a good bit along with everyone else)

            1 Reply Last reply Reply Quote 0
            • cwagzC
              cwagz
              last edited by

              I had to set the "URI Whitespace Characters Handling" in Squid Settings to "chop" in order to get the Safesearch rewrite feature to function properly.

              Chad

              Netgate 6100 MAX

              1 Reply Last reply Reply Quote 0
              • G
                gad_d
                last edited by

                @cwagz:

                I had to set the "URI Whitespace Characters Handling" in Squid Settings to "chop" in order to get the Safesearch rewrite feature to function properly.

                Chad

                Changing URI setting seem to solve it - Thanks a lot ! :)

                This is the list I have the works for me

                rew My-List {
                s@(.youtube.com.)@&&safety_mode=true@i
                s@(.google../.q=.)@&&safe=active@i
                s@(.duckduckgo.com.)@&&kp=1@i
                s@(.bing.com.)@&&adlt=strict@i
                s@(.search.yahoo.com.)@&&vm=r@i
                s@(.yandex.com/.)@&&fyandex=1@i
                }

                As for Youtube safesearch, i have similar DNS ocnfiguration (see attachments)

                safesearch.PNG
                safesearch.PNG_thumb
                google-dnsforwarder.PNG
                google-dnsforwarder.PNG_thumb
                google-dnsforwarder-edit.PNG
                google-dnsforwarder-edit.PNG_thumb

                1 Reply Last reply Reply Quote 0
                • G
                  gad_d
                  last edited by

                  @C0RR0SIVE:

                  How did you get youtube to work properly with the safesearch?  That is something I have been wanting to do, but, haven't had luck with as far as I can tell… How does one even test that it works?  (Still learning a good bit along with everyone else)

                  see my last post on how to setup dns safesearch for youtube
                  and as for how to check it … i tried searching "sex" and compared the results. its not perfect, but will settle  for what they offer

                  4 1 Reply Last reply Reply Quote 0
                  • 4
                    4o4rh @gad_d
                    last edited by

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