This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Allowing specific YouTube videos through proxy

I know this has been discussed previously, but I was unable to get the recommendations from earlier posts to work on my system.

I am trying to allow just a small selection of youtube videos through the proxy server. All the videos have an ID in the URL, so I am trying to allow https://www.youtube.com/watch/?v=***YYYZZZ

The problem I think I am having is due to the HSTS (HTTP Strict Transport Security) requirements of youtube. When I keep the base URL of www.youtube.com out of my exceptions, I am getting taken to a certificate error screen. In IE (version 7 - it's an old system I working on), clicking continue takes me to an IE error page ("IE cannot display the webpage"), but Chrome tells me that it cannot be visited right now because it uses HSTS.

In my logs, I get lines like: 

2015:01:05-15:23:04 commerce httpproxy[16758]: id="0060" severity="info" sys="SecureWeb" sub="http" name="web request blocked, forbidden category detected" action="block" method="CONNECT" srcip="10.100.x.x" dstip="" user="" ad_domain="" statuscode="403" cached="0" profile="REF_HttProTablets (Tablets)" filteraction="REF_HttCffTablePcrFilte (Tablet PCR Filter Action)" size="3172" request="0xec04800" url="www.youtube.com/.../4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E)" exceptions="av,auth,content,ssl,certcheck,certdate,mime,cache,fileextension,size" category="147" reputation="neutral" categoryname="Streaming Media" reason="category"

2015:01:05-15:23:04 commerce httpproxy[16758]: id="0060" severity="info" sys="SecureWeb" sub="http" name="web request blocked, forbidden category detected" action="block" method="CONNECT" srcip="10.100.x.x" dstip="" user="" ad_domain="" statuscode="403" cached="0" profile="REF_HttProTablets (Tablets)" filteraction="REF_HttCffTablePcrFilte (Tablet PCR Filter Action)" size="3172" request="0xd251a000" url="www.youtube.com/.../4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E)" exceptions="av,auth,content,ssl,certcheck,certdate,mime,cache,fileextension,size" category="147" reputation="neutral" categoryname="Streaming Media" reason="category"

Of course, if I add www.youtube.com to my exception list, everything works fine, but that includes the videos I don't want to allow.

It looks like the instructions in previous posts are from before google went to HSTS. Has anyone gotten it working properly? What are you putting in the "Filtering Options -> Exceptions" screen, and what goes in the whitelist for the applicable profile?

I appreciate the help.

Thanks

Adam


This thread was automatically locked due to age.
  • Some key parts from your log:
    name="web request blocked, forbidden category detected" 
    action="block" statuscode="403" 
    url="https://www.youtube.com/"
    exceptions="av,auth,content,ssl,certcheck,certdate,mime,cache,fileextension,size"
    categoryname="Streaming Media" reason="category"


    You are being blocked due to the category - you have Streaming Media blocked.
    You are hitting the exception.  But your exception is not skipping the category checks.
    You need to except "URL Filter" to not have the categorization block you.

    There are three other issues I can see that you are facing:
    1) When you are blocked (as above) the UTM tries to display a block page using the UTM certificate authority within the connection that the browser thinks is to youtube.  This adds a layer of certificate complexity or confusion because what happens in a block is different than an allow.

    2) Your current exception skips SSL scanning.  If you skip SSL scanning you won't see "inside" the SSL connection, you won't be able to see and allow/block specific URLs.

    3) Before you get GET for https://youtube.com/somespecificvideo you must first do a https CONNECT to youtube.com.  That connect will be blocked due to category.  Possibly an exception for www.youtube.com/$ (use the regex $ to indicate line ending)

    It may be possible to do what you want in this way, but you would be forging a new path.

    If you signed up as a School with YouTube for Schools, you would then be limited (by Youtube) to only watching certain EDU video plus any specific video that you as a "teacher/admin" had allowed.  Perhaps this is a better option.
  • Michael - 

    Thank you for your explanation. I will have to look into the SSL scanning options. However, your previous point is that it is hitting the exception, but the exception is not skipping the category checks. If I except "URL Filter", won't that unblock ALL of youtube, and not just specific videos? Is option 3 the fix for that?

    Thanks

    Adam
  • I have no idea if this would work, however to do it via exceptions I would try:
    Exception 1:
    Skip URL Filter
    Destination Regex: ^http://www.youtube.com/?$

    Exception 2:
    Skip URL Filter
    Destination Regex: ^https://www.youtube.com/watchvideo=123

    Of course better written RegEx than that but you get the idea.  The first one should allow the CONNECT and maybe the initial html page load but nothing else since does not apply to any path within Youtube.  The second one allows access to a specific video.

    You might be able to do the same with using whitelist/blacklist.  For that you would want to allow streaming media, put a blacklist on https://www.youtube.com/watchvideo and a whitelist on https://www.youtube.com/watchvideo=123.  That would allow access to searching the entire site but only some videos to play.

    Still...  Youtube for Schools probably gets most of what you want.  Basically rather than trying to get the UTM to enforce only some videos, you use the built-in YouTube feature.
    https://www.youtube.com/schools
  • Thanks for that info Michael. The issue with the YouTube for schools is that we are on metered connections, so allowing people to watch TED talks, while it may be appropriate and safe material, would cause overage charges on our Verizon Wireless connections.
  • I have no idea if this would work, however to do it via exceptions I would try:
    Exception 1:
    Skip URL Filter
    Destination Regex: ^http://www.youtube.com/?$

    Exception 2:
    Skip URL Filter
    Destination Regex: ^https://www.youtube.com/watchvideo=123

    Of course better written RegEx than that but you get the idea.  The first one should allow the CONNECT and maybe the initial html page load but nothing else since does not apply to any path within Youtube.  The second one allows access to a specific video.

    You might be able to do the same with using whitelist/blacklist.  For that you would want to allow streaming media, put a blacklist on https://www.youtube.com/watchvideo and a whitelist on https://www.youtube.com/watchvideo=123.  That would allow access to searching the entire site but only some videos to play.

    Still...  Youtube for Schools probably gets most of what you want.  Basically rather than trying to get the UTM to enforce only some videos, you use the built-in YouTube feature.
    https://www.youtube.com/schools


    Regards exception 2:
    I think, blocking youtube as a whole, and then add that as exception, should work.
    regardless of SSL-scanning catching youtube, as the URL should still be visible(packet's gotta know where to go [;)] )

    ^https?://([A-Za-z0-9.-]*\.)?youtube\.com/watch?v=... 
    as regex. but instead of the ..., you have to use the exact video you want to allow,
    for example,
    https://www.youtube.com/watch?v=OPf0YbXqDm0

    will be:
    ^https?://([A-Za-z0-9.-]*\.)?youtube\.com/watch?v=OPf0YbXqDm0


    At least, that's what I understand.. I will test this in a second
    did not work for me, whole youtube was blocked
    I used the "websites"-tab in my profile.
  • Frank - 

    You may need a '\?' in the youtube watch URL... after the word 'watch' I think you need to escape that '?' for the regex. Does this make any difference on your test system?

    Thanks

    Adam
  • oh, yes.. thanks [:)] totally forgot that
    I will edit in a few minutes
    Edit:
    Somehow, I can block certain pages and allow the domain
    but the other way around, as asked.. I didn't find a way to do so