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
利用可能なセレクタ
トラフィック
- アプリケーション
- コンテンツカテゴリ
- 宛先大陸IPジオロケーション
- 宛先国IPジオロケーション
- 宛先IP
- DLPプロファイル
- ドメイン
- ダウンロードファイルタイプ
- ダウンロードMIMEタイプ
- ホスト
- HTTPメソッド
- HTTPレスポンス
- プロキシエンドポイント
- セキュリティリスク
- 送信元大陸IPジオロケーション
- 送信元国IPジオロケーション
- 送信元内部IP
- 送信元IP
- アップロードファイルタイプ
- アップロードMIMEタイプ
- URL
- URLパス
- URLパスとクエリ
- URLクエリ
- 仮想ネットワーク
アイデンティティ
デバイスポスチャ
許可アクションは、セレクタおよび値フィールド内で指定した宛先に到達するためのアウトバウンドトラフィックを許可します。たとえば、次の構成は、教育コンテンツカテゴリに属すると分類されるすべてのウェブサイトへのトラフィックを許可します。
| セレクタ | オペレーター | 値 | アクション |
|---|---|---|---|
| コンテンツカテゴリ | in | Education | 許可 |
信頼されていない証明書アクションは、不正なリクエストをどのように処理するかを決定します。
| オプション | アクション |
|---|---|
| エラー | ゲートウェイエラーページを表示します。アクションが構成されていない場合のデフォルトの動作に一致します。 |
| ブロック | ゼロトラストで設定されたブロックページを表示します。 |
| 通過 | 不正な接続警告をバイパスし、シームレスに上流に接続します。この機能を使用するには、カスタムルート証明書を展開してください。バイパスされるステータスに関する詳細は、トラブルシューティングFAQを参照してください。 |
API値: block
利用可能なセレクタ
トラフィック
- アプリケーション
- コンテンツカテゴリ
- 宛先大陸IPジオロケーション
- 宛先国IPジオロケーション
- 宛先IP
- DLPプロファイル
- ドメイン
- ダウンロードファイルタイプ
- ダウンロードMIMEタイプ
- ホスト
- HTTPメソッド
- HTTPレスポンス
- プロキシエンドポイント
- セキュリティリスク
- 送信元大陸IPジオロケーション
- 送信元国IPジオロケーション
- 送信元内部IP
- 送信元IP
- アップロードファイルタイプ
- アップロードMIMEタイプ
- URL
- URLパス
- URLパスとクエリ
- URLクエリ
- 仮想ネットワーク
アイデンティティ
デバイスポスチャ
ブロックアクションは、セレクタおよび値フィールド内で指定した宛先へのアウトバウンドトラフィックをブロックします。たとえば、次の構成は、ユーザーがGoogle Driveに任意のファイルタイプをアップロードできないようにブロックします。
| セレクタ | オペレーター | 値 | 論理 | アクション |
|---|---|---|---|---|
| アプリケーション | in | Google Drive | And | ブロック |
| アップロードMIMEタイプ | matches regex | .* |
Feature availability
| WARP modes | Zero Trust plans ↗ |
|---|---|
| Enterprise |
| System | Availability | Minimum WARP version |
|---|---|---|
| Windows | ✅ | 2024.1.159.0 |
| macOS | ✅ | 2024.1.160.0 |
| Linux | ❌ | |
| iOS | ✅ | 1.3 |
| Android | ✅ | 1.4 |
| ChromeOS | ✅ | 1.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
利用可能なセレクタ
トラフィック
- アプリケーション
- コンテンツカテゴリ
- ドメイン
- ホスト
- HTTPメソッド
- セキュリティリスク
- 送信元大陸IPジオロケーション
- 送信元国IPジオロケーション
- URL
- URLパス
- URLパスとクエリ
- URLクエリ
アイデンティティ
デバイスポスチャ
孤立アクションは、マッチしたトラフィックをユーザーにCloudflareブラウザ孤立を介して提供します。このアクションの詳細については、孤立ポリシーを参照してください。
API値: noisolate
利用可能なセレクタ
トラフィック
- アプリケーション
- コンテンツカテゴリ
- ドメイン
- ホスト
- HTTPメソッド
- セキュリティリスク
- 送信元大陸IPジオロケーション
- 送信元国IPジオロケーション
- URL
- URLパス
- URLパスとクエリ
- URLクエリ
アイデンティティ
デバイスポスチャ
孤立しないアクションは、マッチしたトラフィックに対してブラウザの孤立をオフにします。このアクションの詳細については、孤立ポリシーを参照してください。
API値: off
利用可能なセレクタ
トラフィック
- アプリケーション
- コンテンツカテゴリ
- 宛先大陸IPジオロケーション
- 宛先国IPジオロケーション
- 宛先IP
- ドメイン
- ホスト
- プロキシエンドポイント
- セキュリティリスク
- 送信元大陸IPジオロケーション
- 送信元国IPジオロケーション
- 送信元内部IP
- 送信元IP
- 仮想ネットワーク
アイデンティティ
デバイスポスチャ
検査しないは、特定の要素を検査からバイパスさせることができます。ゲートウェイがHTTPSトラフィックを復号化および検査しないようにするには、ポリシーがTLSヘッダー内のサーバー名インジケーター(SNI)に対して一致する必要があります。ブラウザで「検査しない」サイトにアクセスすると、ブラウザに「接続がプライベートではありません」という警告が表示されることがありますが、接続するために進むことができます。「検査しない」ポリシーが必要なアプリケーションに関する詳細は、TLS復号化の制限を参照してください。
すべての「検査しない」ルールは、復号化が行われるべきかどうかを判断するために、最初に評価されます。詳細については、施行の順序を参照してください。
API値: noscan
利用可能なセレクタ
トラフィック
- アプリケーション
- コンテンツカテゴリ
- 宛先大陸IPジオロケーション
- 宛先国IPジオロケーション
- 宛先IP
- ドメイン
- ホスト
- HTTPメソッド
- プロキシエンドポイント
- セキュリティリスク
- 送信元大陸IPジオロケーション
- 送信元国IPジオロケーション
- 送信元内部IP
- 送信元IP
- URL
- URLパス
- URLパスとクエリ
- URLクエリ
- 仮想ネットワーク
アイデンティティ
デバイスポスチャ
管理者がアップロードおよび/またはダウンロードの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 name | API example | Evaluation phase |
|---|---|---|
| Application | any(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 name | API example |
|---|---|
| Destination Continent IP Geolocation | http.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 name | API example |
|---|---|
| Destination Country IP Geolocation | http.dst_ip.geo.country == “RU” |
| UI名 | API例 |
|---|---|
| 宛先IP | http.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 name | API example |
|---|---|
| Passed Device Posture Checks | any(device_posture.checks.failed[*] in {"1308749e-fcfb-4ebc-b051-fe022b632644"}), any(device_posture.checks.passed[*] in {"1308749e-fcfb-4ebc-b051-fe022b632644"})" |
このセレクタを使用して、ドメインとすべてのサブドメインに対して一致させます — たとえば、example.comとwww.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"}) |
これらのセレクタは、リクエスト(アップロード用)またはレスポンス(ダウンロード用)にContent-Typeヘッダーが存在することに依存します。
| UI名 | API例 |
|---|---|
| ダウンロードMimeタイプ | http.download.mime == "image/png\" |
| UI名 | API例 |
|---|---|
| アップロードMimeタイプ | http.upload.mime == "image/png\" |
HTTPトラフィックをスキャンして、社会保障番号やその他のPIIの存在を確認します。このセレクタをポリシーで使用する前に、DLPプロファイルを構成する必要があります。詳細については、DLPプロファイルのドキュメントを参照してください。
このセレクタを使用して、指定されたホスト名のみを一致させます — たとえば、test.example.comをブロックしたいが、example.comやwww.test.example.comはブロックしたくない場合です。
| UI名 | API例 |
|---|---|
| ホスト | http.request.host == "test.example.com" |
| UI名 | API例 |
|---|---|
| HTTPメソッド | http.request.method == "GET" |
| UI名 | API例 |
|---|---|
| URL | http.response.status_code == "200" |
The proxy server where your browser forwards HTTP traffic.
| UI name | API example |
|---|---|
| Proxy Endpoint | proxy.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:
| Continent | Code |
|---|---|
| Africa | AF |
| Antarctica | AN |
| Asia | AS |
| Europe | EU |
| North America | NA |
| Oceania | OC |
| South America | SA |
| Tor network | T1 |
| UI name | API example | Evaluation phase |
|---|---|---|
| Source Continent IP Geolocation | http.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 name | API example | Evaluation phase |
|---|---|---|
| Source Country IP Geolocation | http.src_ip.geo.country == “RU” | Before DNS resolution |
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 name | API example |
|---|---|
| Source Internal IP | http.src.internal_src_ip == “192.168.86.0/27” |
| UI名 | API例 |
|---|---|
| ソースIP | http.src.ip == "10.0.0.0/8" |
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例 |
|---|---|
| URL | not(any(http.request.uri.content_category[*] in {1})) |
| UI名 | API例 |
|---|---|
| URLパス | http.request.uri.path == \"/foo/bar\" |
| UI名 | API例 |
|---|---|
| URLパスとクエリ | http.request.uri.path_and_query == \"/foo/bar?ab%242=%2A342\" |
| 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 name | API example |
|---|---|
| Virtual Network | http.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.
| Operator | Meaning |
|---|---|
| is | equals the defined value |
| is not | does not equal the defined value |
| in | matches at least one of the defined values |
| not in | does not match any of the defined values |
| in list | in a pre-defined list of values |
| not in list | not in a pre-defined list of values |
| matches regex | regex evaluates to true |
| does not match regex | regex evaluates to false |
| greater than | exceeds the defined number |
| greater than or equal to | exceeds or equals the defined number |
| less than | below the defined number |
| less than or equal to | below 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.
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:
| Selector | Operator | Value | Action |
|---|---|---|---|
| Host | matches regex | .\*whispersystems.org|.\*signal.org | Block |
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.
| Operator | Meaning |
|---|---|
| And | match all of the conditions in the expression |
| Or | match 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.