Restrict YouTube content on your network or managed devices
Google provides an article entitled "Restrict YouTube content on your network or managed devices" athttps://support.google.com/youtube/answer/6214622
At this time, there are two options to restrict inappropriate content: DNS and HTTP header.
This is a FortiGate configuration example for adding the HTTP header to YouTube requests to implement safe-search for YouTube (FortiOS v5.4).
1. Configure web proxy profile to add header
1. Configure web proxy profile to add header
config web-proxy profile
edit Restrict
set header-via-request add
set header-via-response add
config headers
edit 1
set name "YouTube-Restrict" ----{The name can be any value
set content "Strict"
next
end
next
end
edit Restrict
set header-via-request add
set header-via-response add
config headers
edit 1
set name "YouTube-Restrict" ----{The name can be any value
set content "Strict"
next
end
next
end
2. Add a profile to the url-filter profile
config webfilter urlfilter
edit 1
set name "Youtube" ----{The name can be any value
config entries
edit 1
set url "www.youtube.com"
set action allow
set web-proxy-profile "Restrict"
next
edit 2
set url "m.youtube.com"
set action allow
set web-proxy-profile "Restrict"
next
edit 3
set url "youtubei.googleapis.com"
set action allow
set web-proxy-profile "Restrict"
next
edit 4
set url "youtube.googleapis.com"
set action allow
set web-proxy-profile "Restrict"
next
edit 5
set url "www.youtube-nocookie.com"
set action allow
set web-proxy-profile "Restrict"
next
end
next
end
edit 1
set name "Youtube" ----{The name can be any value
config entries
edit 1
set url "www.youtube.com"
set action allow
set web-proxy-profile "Restrict"
next
edit 2
set url "m.youtube.com"
set action allow
set web-proxy-profile "Restrict"
next
edit 3
set url "youtubei.googleapis.com"
set action allow
set web-proxy-profile "Restrict"
next
edit 4
set url "youtube.googleapis.com"
set action allow
set web-proxy-profile "Restrict"
next
edit 5
set url "www.youtube-nocookie.com"
set action allow
set web-proxy-profile "Restrict"
next
end
next
end
3. Add urlfilter profile to webfilter
config webfilter profile
edit "Youtube-Restrict" ----{The name can be any value
config web
set urlfilter-table 1
end
next
end
edit "Youtube-Restrict" ----{The name can be any value
config web
set urlfilter-table 1
end
next
end
4. Apply the above profile to the outgoing firewall policies
- Enable the web-filter and select the created web-filter
- Enable SSL Deep Inspection