コンテンツにスキップ

HTTPポリシー

HTTPポリシーは、すべてのHTTPおよびHTTPSリクエストを傍受し、特定の要素(ウェブサイト、IPアドレス、ファイルタイプなど)をブロック、許可、または上書きすることを可能にします。HTTPポリシーは、ポート80および443を介して送信されるすべてのTCP(およびオプションでUDP)トラフィックに対してレイヤー7で動作します。

HTTPポリシーは、アクションとポリシーの範囲を決定する論理式で構成されます。式を構築するには、セレクタオペレーターを選択し、フィールドに値または値の範囲を入力する必要があります。AndおよびOrの論理演算子を使用して、複数の条件を評価できます。

If a condition in an expression joins a query attribute (such as Source IP) and a response attribute (such as Resolved IP), then the condition will be evaluated when the response is received.

アクション

HTTPポリシーのアクションでは、特定の要素(ドメイン、IPアドレス、ファイルタイプなど)に対して何をするかを選択できます。ポリシーごとに1つのアクションを割り当てることができます。

許可

API値: allow

利用可能なセレクタ

トラフィック

アイデンティティ

デバイスポスチャ

許可アクションは、セレクタおよびフィールド内で指定した宛先に到達するためのアウトバウンドトラフィックを許可します。たとえば、次の構成は、教育コンテンツカテゴリに属すると分類されるすべてのウェブサイトへのトラフィックを許可します。

セレクタオペレーターアクション
コンテンツカテゴリinEducation許可

信頼されていない証明書

信頼されていない証明書アクションは、不正なリクエストをどのように処理するかを決定します。

オプションアクション
エラーゲートウェイエラーページを表示します。アクションが構成されていない場合のデフォルトの動作に一致します。
ブロックゼロトラストで設定されたブロックページを表示します。
通過不正な接続警告をバイパスし、シームレスに上流に接続します。この機能を使用するには、カスタムルート証明書を展開してください。バイパスされるステータスに関する詳細は、トラブルシューティングFAQを参照してください。

ブロック

API値: block

利用可能なセレクタ

トラフィック

アイデンティティ

デバイスポスチャ

ブロックアクションは、セレクタおよびフィールド内で指定した宛先へのアウトバウンドトラフィックをブロックします。たとえば、次の構成は、ユーザーがGoogle Driveに任意のファイルタイプをアップロードできないようにブロックします。

セレクタオペレーター論理アクション
アプリケーションinGoogle DriveAndブロック
アップロードMIMEタイプmatches regex.*

WARPクライアントブロック通知 Early Access

Feature availability

WARP modesZero Trust plans
  • Gateway with WARP
  • Secure Web Gateway without DNS filtering
Enterprise
SystemAvailabilityMinimum WARP version
Windows2024.1.159.0
macOS2024.1.160.0
Linux
iOS1.3
Android1.4
ChromeOS1.4

Turn on Display block notification for WARP client to display notifications for Gateway block events. Blocked users will receive an operating system notification from the WARP client with a custom message you set. If you do not set a custom message, the WARP client will display a default message. Custom messages must be 100 characters or less.

Upon selecting the notification, WARP will direct your users to a block page. Optionally, you can direct users to a custom URL, such as an internal support form.

To turn on client notifications on macOS devices running DisplayLink software, you may have to allow system notifications when mirroring your display. For more information, refer to the macOS documentation.

孤立

API値: isolate

利用可能なセレクタ

トラフィック

アイデンティティ

デバイスポスチャ

孤立アクションは、マッチしたトラフィックをユーザーにCloudflareブラウザ孤立を介して提供します。このアクションの詳細については、孤立ポリシーを参照してください。

孤立しない

API値: noisolate

利用可能なセレクタ

トラフィック

アイデンティティ

デバイスポスチャ

孤立しないアクションは、マッチしたトラフィックに対してブラウザの孤立をオフにします。このアクションの詳細については、孤立ポリシーを参照してください。

検査しない

API値: off

利用可能なセレクタ

トラフィック

アイデンティティ

デバイスポスチャ

検査しないは、特定の要素を検査からバイパスさせることができます。ゲートウェイがHTTPSトラフィックを復号化および検査しないようにするには、ポリシーがTLSヘッダー内のサーバー名インジケーター(SNI)に対して一致する必要があります。ブラウザで「検査しない」サイトにアクセスすると、ブラウザに「接続がプライベートではありません」という警告が表示されることがありますが、接続するために進むことができます。「検査しない」ポリシーが必要なアプリケーションに関する詳細は、TLS復号化の制限を参照してください。

すべての「検査しない」ルールは、復号化が行われるべきかどうかを判断するために、最初に評価されます。詳細については、施行の順序を参照してください。

スキャンしない

API値: noscan

利用可能なセレクタ

トラフィック

アイデンティティ

デバイスポスチャ

管理者がアップロードおよび/またはダウンロードのAVスキャンを有効にすると、ゲートウェイはすべてのサポートされているファイルをスキャンします。管理者は、HTTPルールを利用してスキャンを選択的に無効にすることができます。たとえば、example.comにアップロードまたはダウンロードされるファイルのAVスキャンを防ぐために、管理者は次のルールを構成します。

セレクタオペレーターアクション
ホスト名matches regex.*example.comスキャンしない

「スキャンしない」ルールが一致すると、ファイルサイズやファイルタイプがサポートされているかどうかに関係なく、何もスキャンされません。

セレクタ

ゲートウェイは、次のセレクタまたは基準に対してHTTPトラフィックを一致させます。

アプリケーション

You can apply HTTP policies to a growing list of popular web applications. Refer to Application and app types for more information.

UI nameAPI exampleEvaluation phase
Applicationany(app.ids[*] in {505})Before DNS resolution

コンテンツカテゴリ

UI名API例
コンテンツカテゴリnot(any(http.request.uri.content_category[*] in {1}))

詳細については、コンテンツカテゴリのリストを参照してください。

宛先大陸

The continent where the request is destined. Geolocation is determined from the target IP address. To specify a continent, enter its two-letter code into the Value field:

  • AF – Africa
  • AN – Antarctica
  • AS – Asia
  • EU – Europe
  • NA – North America
  • OC – Oceania
  • SA – South America
  • T1 – Tor network
UI nameAPI example
Destination Continent IP Geolocationhttp.dst_ip.geo.continent == “EU”

宛先国

The country that the request is destined for. Geolocation is determined from the target IP address. To specify a country, enter its ISO 3166-1 Alpha 2 code in the Value field.

UI nameAPI example
Destination Country IP Geolocationhttp.dst_ip.geo.country == “RU”

宛先IP

UI名API例
宛先IPhttp.dst.ip == "10.0.0.0/8"

デバイスポスチャ

With the Device Posture selector, admins can use signals from end-user devices to secure access to their internal and external resources. For example, a security admin can choose to limit all access to internal applications based on whether specific software is installed on a device and/or if the device or software are configured in a particular way.

For more information on device posture checks, refer to Device posture.

UI nameAPI example
Passed Device Posture Checksany(device_posture.checks.failed[*] in {"1308749e-fcfb-4ebc-b051-fe022b632644"}), any(device_posture.checks.passed[*] in {"1308749e-fcfb-4ebc-b051-fe022b632644"})"

ドメイン

このセレクタを使用して、ドメインとすべてのサブドメインに対して一致させます — たとえば、example.comwww.example.comのようなサブドメインをブロックしたい場合です。

UI名API例
ドメインany(http.request.domains[*] == "example.com")

ダウンロードおよびアップロードファイルタイプ

これらのセレクタは、HTTPボディ内のファイルシグネチャをスキャンします。実行可能ファイル、アーカイブおよび圧縮ファイル、Microsoft 365/Officeドキュメント、Adobeファイルなど、ファイルカテゴリまたは特定のファイルタイプから選択できます。

UI名API例
ダウンロードファイルタイプany(http.download.file.types[*] in {"docx" "7z"})
UI名API例
アップロードファイルタイプany(http.upload.file.types[*] in {"compressed"})

ダウンロードおよびアップロードMimeタイプ

これらのセレクタは、リクエスト(アップロード用)またはレスポンス(ダウンロード用)にContent-Typeヘッダーが存在することに依存します。

UI名API例
ダウンロードMimeタイプhttp.download.mime == "image/png\"
UI名API例
アップロードMimeタイプhttp.upload.mime == "image/png\"

DLPプロファイル

HTTPトラフィックをスキャンして、社会保障番号やその他のPIIの存在を確認します。このセレクタをポリシーで使用する前に、DLPプロファイルを構成する必要があります。詳細については、DLPプロファイルのドキュメントを参照してください。

ホスト

このセレクタを使用して、指定されたホスト名のみを一致させます — たとえば、test.example.comをブロックしたいが、example.comwww.test.example.comはブロックしたくない場合です。

UI名API例
ホストhttp.request.host == "test.example.com"

HTTPメソッド

UI名API例
HTTPメソッドhttp.request.method == "GET"

HTTPレスポンス

UI名API例
URLhttp.response.status_code == "200"

プロキシエンドポイント

The proxy server where your browser forwards HTTP traffic.

UI nameAPI example
Proxy Endpointproxy.endpoint == "3ele0ss56t.proxy.cloudflare-gateway.com"

セキュリティリスク

UI名API例
セキュリティリスクany(http.request.uri.category[*] in {1})

詳細については、セキュリティカテゴリのリストを参照してください。

ソース大陸

リクエストを行っているユーザーの大陸。

Geolocation is determined from the device’s public IP address (typically assigned by the user’s ISP). To specify a continent, enter its two-letter code into the Value field:

ContinentCode
AfricaAF
AntarcticaAN
AsiaAS
EuropeEU
North AmericaNA
OceaniaOC
South AmericaSA
Tor networkT1
UI nameAPI exampleEvaluation phase
Source Continent IP Geolocationhttp.src_ip.geo.continent == “North America”Before DNS resolution

ソース国

リクエストを行っているユーザーの国。

Geolocation is determined from the device’s public IP address (typically assigned by the user’s ISP). To specify a country, enter its ISO 3166-1 Alpha-2 code in the Value field.

UI nameAPI exampleEvaluation phase
Source Country IP Geolocationhttp.src_ip.geo.country == “RU”Before DNS resolution

ソース内部IP

Use this selector to apply HTTP policies to a private IP address, assigned by a user’s local network, that requests arrive to Gateway from. This selector will only apply to users connected through a Magic GRE or IPSec tunnel.

UI nameAPI example
Source Internal IPhttp.src.internal_src_ip == “192.168.86.0/27”

ソースIP

UI名API例
ソースIPhttp.src.ip == "10.0.0.0/8"

URL

Gateway ignores trailing forward slashes (/) in URLs. For example, https://example.com and https://example.com/ will count as the same URL and may return a duplicate error.

UI名API例
URLnot(any(http.request.uri.content_category[*] in {1}))

URLパス

UI名API例
URLパスhttp.request.uri.path == \"/foo/bar\"

URLパスとクエリ

UI名API例
URLパスとクエリhttp.request.uri.path_and_query == \"/foo/bar?ab%242=%2A342\"

URLクエリ

UI名API例
URLクエリnot(http.request.uri in $%s)

ユーザー

Identity-based selectors include:

  • SAML Attributes
  • User Email
  • User Group Emails
  • User Group IDs
  • User Group Names
  • User Name

To use identity-based selectors, enable Gateway with WARP in the Zero Trust WARP client and enroll your user in your organization. For more information, refer to Identity-based policies.

仮想ネットワーク

Use this selector to match all traffic routed through a specific Tunnel Virtual Network via the WARP client.

UI nameAPI example
Virtual Networkhttp.conn.vnet_id == “957fc748-591a-e96s-a15d-1j90204a7923”

比較演算子

Comparison operators are the way Gateway matches traffic to a selector. When you choose a Selector in the dashboard policy builder, the Operator dropdown menu will display the available options for that selector.

OperatorMeaning
isequals the defined value
is notdoes not equal the defined value
inmatches at least one of the defined values
not indoes not match any of the defined values
in listin a pre-defined list of values
not in listnot in a pre-defined list of values
matches regexregex evaluates to true
does not match regexregex evaluates to false
greater thanexceeds the defined number
greater than or equal toexceeds or equals the defined number
less thanbelow the defined number
less than or equal tobelow or equals the defined number

In the Value field, you can input a single value when using an equality comparison operator (such as is) or multiple values when using a containment comparison operator (such as in). Additionally, you can use regular expressions (or regex) to specify a range of values for supported selectors.

Regular expressions

Gateway uses Rust to evaluate regular expressions. The Rust implementation is slightly different than regex libraries used elsewhere. For more information, refer to our guide for Wildcards. To evaluate if your regex matches, you can use Rustexp.

If you want to match multiple values, you can use the pipe symbol (|) as an OR operator. In Gateway, you do not need to use an escape character (\) before the pipe symbol. For example, the following policy blocks requests to two hostnames if either appears in a request header:

SelectorOperatorValueAction
Hostmatches regex.\*whispersystems.org|.\*signal.orgBlock

In addition to regular expressions, you can use logical operators to match multiple values.

論理演算子

To evaluate multiple conditions in an expression, select the And logical operator. These expressions can be compared further with the Or logical operator.

OperatorMeaning
Andmatch all of the conditions in the expression
Ormatch any of the conditions in the expression

The Or operator will only work with conditions in the same expression group. For example, you cannot compare conditions in Traffic with conditions in **Identity** or **Device Posture**.

If a condition in an expression joins a request attribute (such as Source IP) and a response attribute (such as a DLP Profile), then the condition will be evaluated when the response is received.