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

Squidguard: Forcing Youtube's Safety On option

Scheduled Pinned Locked Moved pfSense Packages
7 Posts 3 Posters 4.0k 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.
  • A
    abasel
    last edited by Jan 3, 2012, 10:23 AM

    Is there a way to enforce the Safety On option for youtube?

    1 Reply Last reply Reply Quote 0
    • A
      abasel
      last edited by Jan 3, 2012, 10:46 AM

      I bog I found online said that I'd need to so the following but I have no idea how

      You need to open the headerregexplist file and add these two lines:

      "cookie:(.)PREF=[^&]?;"->"Cookie:$1"
      "cookie:(.*)$"->"Cookie:$1; PREF=f2=8000000;"

      1 Reply Last reply Reply Quote 0
      • B
        bilbo
        last edited by Oct 28, 2012, 10:28 PM

        I'd like to bump this please, I am really interested to to add this to existing safesearch in squidguard but have no idea how?

        1 Reply Last reply Reply Quote 0
        • N
          Nachtfalke
          last edited by Oct 29, 2012, 8:37 AM

          Hi,

          I don't know how to do that but the code which does that is in this file:
          https://github.com/bsdperimeter/pfsense-packages/blob/master/config/squidGuard/squidguard.inc
          Line 1240

          1 Reply Last reply Reply Quote 0
          • B
            bilbo
            last edited by Oct 29, 2012, 9:47 AM

            Thanks for the reply, I wouldn't know how to change the code either but there is an option to specify rewrites manually the exiting ones from the code you linked to could be put in manually and a youtube one added also I just dont know how. Surely whoever wrote the package may know?

            if (!is_array($rewrite_item)) $rewrite_item = array();    # Google    $rewrite_item[] = array(F_TARGETURL => '(google../search?.q=.)', F_REPLACETO => '\1&safe=active', F_MODE => 'i');    $rewrite_item[] = array(F_TARGETURL => '(google../images.q=.)',  F_REPLACETO => '\1&safe=active', F_MODE => 'i');    $rewrite_item[] = array(F_TARGETURL => '(google../groups.q=.)',  F_REPLACETO => '\1&safe=active', F_MODE => 'i');    $rewrite_item[] = array(F_TARGETURL => '(google../news.q=.)',    F_REPLACETO => '\1&safe=active', F_MODE => 'i');    # Yandex    $rewrite_item[] = array(F_TARGETURL => '(yandex../yandsearch?.text=.)', F_REPLACETO => '\1&fyandex=1', F_MODE => 'i');    # Yahoo    $rewrite_item[] = array(F_TARGETURL => '(search.yahoo../search.p=.)', F_REPLACETO => '\1&vm=r&v=1', F_MODE => 'i');    # MSN Live search, Bing    $rewrite_item[] = array(F_TARGETURL => '(search.live../.q=.)',  F_REPLACETO => '\1&adlt=strict', F_MODE => 'i');    $rewrite_item[] = array(F_TARGETURL => '(search.msn../.q=.)',   F_REPLACETO => '\1&adlt=strict', F_MODE => 'i');    $rewrite_item[] = array(F_TARGETURL => '(.bing..*/.q=.)',        F_REPLACETO => '\1&adlt=strict', F_MODE => 'i');    return $rewrite_item;}

            1 Reply Last reply Reply Quote 0
            • N
              Nachtfalke
              last edited by Oct 29, 2012, 10:42 AM

              SquidGuard offers the option to add rewrites by GUI.
              There is a "rewrite" tab on this package. Perhaps you can add something there ?

              1 Reply Last reply Reply Quote 0
              • B
                bilbo
                last edited by Oct 29, 2012, 10:44 AM

                Yes, thats what I am wondering about, what rules would need to be entered.

                This is the safequid rule, maybe it could be adapted somehow?

                <profile><enabled>true</enabled>

                <profile_tracing>true</profile_tracing>

                <host>youtube.com</host>

                <portrange></portrange>
                           <urlcommand></urlcommand>

                <requestheader></requestheader>
                           <responseheader></responseheader>
                           <month active="false"></month>
                            <day active="false">1,31</day>
                           <weekday active="false"></weekday>
                            <hour active="false">0,23</hour>
                            <minute active="false">0,59</minute>
                            <matchmode>absolutetime</matchmode>
                            <addprofiles>UNSAFE_YOUTUBE</addprofiles></profile>
                        <profile><enabled>true</enabled>

                <profile_tracing>true</profile_tracing>
                            <profiles>UNSAFE_YOUTUBE</profiles>

                <portrange></portrange>
                           <urlcommand></urlcommand>

                <requestheader>Cookie:.*PREF=.*f2=8000000</requestheader>
                           <responseheader></responseheader>
                           <month active="false"></month>
                            <day active="false">1,31</day>
                           <weekday active="false"></weekday>
                            <hour active="false">0,23</hour>
                            <minute active="false">0,59</minute>
                            <matchmode>absolutetime</matchmode>
                            <addprofiles>SAFE_YOUTUBE</addprofiles>
                            <removeprofiles>UNSAFE_YOUTUBE</removeprofiles></profile>

                <rewrite><enabled>true</enabled>
                        <rewrite><enabled>true</enabled>

                <profiles>UNSAFE_YOUTUBE</profiles>

                <pattern>Cookie: ([^\r\n]*)</pattern>
                            <replace>Cookie:$1; PREF=f2=8000000;\r\n</replace>
                            <which>client</which></rewrite></rewrite>

                1 Reply Last reply 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