Fortinet black logo

Administration Guide

Filtering based on YouTube channel

Filtering based on YouTube channel

Video filtering can be configured to filter specific YouTube channels. When a video matches a YouTube channel, the video will take the corresponding action of allow, monitor, or block. Video filtering is only supported in proxy-based inspection mode, and deep inspection must be enabled in the firewall policy.

By default, when the FortiGuard category-based filter and YouTube channel override are used together, a video will be blocked if it matches either category or YouTube channel and the action is set to block.

Identifying the YouTube channel ID

The following table lists how to identify the YouTube channel ID based on different YouTube video URLs formats:

Video URL

Channel ID

www.youtube.com/channel/<channel-id>

<channel-id> indicates the ID for the channel.

www.youtube.com/user/<user-id>

Open the page source and locate:

<meta itemprop="channelId" content="<channel-id>">

<channel-id> indicates the channel ID for the user page.

www.youtube.com/watch?v=<string>

Open the page source and locate:

<meta itemprop="channelId" content="<channel-id>">

<channel-id> indicates the channel ID for the video.

In a YouTube channel filter profile, the default action is set to monitor when there is no match. Logging is also disabled by default.

config videofilter youtube-channel-filter
    edit <id>
        set default-action {block | monitor | allow}
        set log {enable | disable}
    next
end

Example

In the following example, the Fortinet YouTube channel ID (UCJHo4AuVomwMRzgkA5DQEOA) is blocked, and the video filter is applied to a policy.

To configure a video filter based on a YouTube channel in the GUI:
  1. Go to Security Profiles > Video Filter and click Create New.
  2. In the Channel override list section, click Create New. The New Channel Override Entry pane opens.
    1. Enter the Channel ID (UCJHo4AuVomwMRzgkA5DQEOA) and for Action, select Block.

    2. Click OK.
  3. Click OK.
  4. Create the firewall policy:
    1. Go to Policy & Objects > Firewall Policy and click Create New.
    2. For Inspection Mode, select Proxy-based.
    3. Enable Video Filter and select the profile you created.
    4. For SSL Inspection, select deep-inspection.

    5. Configure the other settings as needed and click OK.
To configure a video filter based on a YouTube channel in the CLI:
  1. Create the channel filter:
    config videofilter youtube-channel-filter
        edit 1
            set name "channel_filter"
            set default-action monitor
            set log enable
            config entries
                edit 1
                    set action block
                    set channel-id "UCJHo4AuVomwMRzgkA5DQEOA"
                next
            end
        next
    end
  2. Create the video filter profile:
    config videofilter profile
        edit "channel_filter"
            set youtube-channel-filter 1
        next 
    end
  3. Create the firewall policy:
    config firewall policy
        edit 1
            set name "video-filter"
            set srcintf "port2"
            set dstintf "port1"
            set srcaddr "all"
            set dstaddr "all"
            set action accept
            set schedule "always"
            set service "ALL"
            set utm-status enable
            set inspection-mode proxy
            set ssl-ssh-profile "deep-inspection"
            set videofilter-profile "channel_filter"
            set nat disable
        next
    end 

Filtering based on YouTube channel

Video filtering can be configured to filter specific YouTube channels. When a video matches a YouTube channel, the video will take the corresponding action of allow, monitor, or block. Video filtering is only supported in proxy-based inspection mode, and deep inspection must be enabled in the firewall policy.

By default, when the FortiGuard category-based filter and YouTube channel override are used together, a video will be blocked if it matches either category or YouTube channel and the action is set to block.

Identifying the YouTube channel ID

The following table lists how to identify the YouTube channel ID based on different YouTube video URLs formats:

Video URL

Channel ID

www.youtube.com/channel/<channel-id>

<channel-id> indicates the ID for the channel.

www.youtube.com/user/<user-id>

Open the page source and locate:

<meta itemprop="channelId" content="<channel-id>">

<channel-id> indicates the channel ID for the user page.

www.youtube.com/watch?v=<string>

Open the page source and locate:

<meta itemprop="channelId" content="<channel-id>">

<channel-id> indicates the channel ID for the video.

In a YouTube channel filter profile, the default action is set to monitor when there is no match. Logging is also disabled by default.

config videofilter youtube-channel-filter
    edit <id>
        set default-action {block | monitor | allow}
        set log {enable | disable}
    next
end

Example

In the following example, the Fortinet YouTube channel ID (UCJHo4AuVomwMRzgkA5DQEOA) is blocked, and the video filter is applied to a policy.

To configure a video filter based on a YouTube channel in the GUI:
  1. Go to Security Profiles > Video Filter and click Create New.
  2. In the Channel override list section, click Create New. The New Channel Override Entry pane opens.
    1. Enter the Channel ID (UCJHo4AuVomwMRzgkA5DQEOA) and for Action, select Block.

    2. Click OK.
  3. Click OK.
  4. Create the firewall policy:
    1. Go to Policy & Objects > Firewall Policy and click Create New.
    2. For Inspection Mode, select Proxy-based.
    3. Enable Video Filter and select the profile you created.
    4. For SSL Inspection, select deep-inspection.

    5. Configure the other settings as needed and click OK.
To configure a video filter based on a YouTube channel in the CLI:
  1. Create the channel filter:
    config videofilter youtube-channel-filter
        edit 1
            set name "channel_filter"
            set default-action monitor
            set log enable
            config entries
                edit 1
                    set action block
                    set channel-id "UCJHo4AuVomwMRzgkA5DQEOA"
                next
            end
        next
    end
  2. Create the video filter profile:
    config videofilter profile
        edit "channel_filter"
            set youtube-channel-filter 1
        next 
    end
  3. Create the firewall policy:
    config firewall policy
        edit 1
            set name "video-filter"
            set srcintf "port2"
            set dstintf "port1"
            set srcaddr "all"
            set dstaddr "all"
            set action accept
            set schedule "always"
            set service "ALL"
            set utm-status enable
            set inspection-mode proxy
            set ssl-ssh-profile "deep-inspection"
            set videofilter-profile "channel_filter"
            set nat disable
        next
    end