|
1 | 1 | --- |
2 | 2 | order: 2 |
| 3 | +hidden: true |
3 | 4 | --- |
4 | 5 |
|
5 | 6 | # Policies |
@@ -172,6 +173,109 @@ When a DNS query matches with a DNS policy, Gateway follows this order of operat |
172 | 173 |
|
173 | 174 | <Aside> |
174 | 175 |
|
| 176 | +This feature is only available for Gateway and Teams paid plans. For more information, see the Cloudflare for Teams [pricing page](https://www.cloudflare.com/teams-pricing/). |
| 177 | + |
| 178 | +</Aside> |
| 179 | + |
| 180 | +You can decide to add a policy to filter HTTP traffic on the L7 firewall. Gateway will intercept all HTTP and HTTPS traffic and apply the rules you have configured in your policy to either block, allow, or override specific elements such as websites, IP addresses, and file types. |
| 181 | + |
| 182 | +You can build an HTTP policy by configuring the following elements: |
| 183 | + |
| 184 | +* **Actions** |
| 185 | +* **Expressions** |
| 186 | +* **Selectors** |
| 187 | +* **Operators** |
| 188 | + |
| 189 | +#### Actions |
| 190 | + |
| 191 | +Just like actions on destinations in DNS policies, actions in HTTP policies allow you to choose what to do with a given set of elements (domains, IP addresses, file types, and so on). You can assign one action per policy. |
| 192 | + |
| 193 | +These are the action types you can choose from: |
| 194 | + |
| 195 | +* **Allow** |
| 196 | +* **Block** |
| 197 | +* **Bypass** |
| 198 | + |
| 199 | +*Bypass* lets administrators bypass certain elements from inspection. Administrators who wish to bypass a site must match against the host in order to prevent HTTP inspection from occuring on both encrypted and plaintext traffic. The bypass action is only available when matching against the host criteria. |
| 200 | + |
| 201 | +#### Selectors |
| 202 | +Gateway matches HTTP traffic against the following selectors, or criteria: |
| 203 | +* **Host** |
| 204 | +* **URL** |
| 205 | +* **URL Query** |
| 206 | +* **URL Path** |
| 207 | +* **URL Path and Query** |
| 208 | +* **HTTP Method** |
| 209 | +* **HTTP Response** |
| 210 | +* **Uploaded and Downloaded File Extension** |
| 211 | +* **Uploaded and Downloaded Mime Type** |
| 212 | +* **Content categories** |
| 213 | + |
| 214 | +List of file extensions Gateway can match against: |
| 215 | + |
| 216 | +<TableWrap> |
| 217 | + |
| 218 | +| Image | Executable | Audio | Documents | Data | Compressed | System | Video | |
| 219 | +|------|------|-------|------|--------|--------|--------|-----| |
| 220 | +| avif | apk | m4a | doc | avro | 7z | bak | avi | |
| 221 | +| bmp | bat | mid | docx | csv | arj | cab | flv | |
| 222 | +| gif | bin | mp3 | odp | dat | bz2 | cpl | h264 | |
| 223 | +| ico | cgi | mpa | ods | dmg | deb | cur | m4v | |
| 224 | +| jpeg | com | wav | odt | iso | gz | emu | mkv | |
| 225 | +| png | dll | wma | pdf | json | lz | ini | mov | |
| 226 | +| psd | exe | ppt | | log | lz4 | scr | mp4 | |
| 227 | +| svg | hta | pptx | | mdb | lzh | sys | mpeg | |
| 228 | +| tif | jar | rtf | | nzb | lzma | tmp | wmv | |
| 229 | +| webp | moo | txt | | orc | pak |
| 230 | +| | pif | xls | | parquet | rar |
| 231 | +| | pl | xlsx | | rc | rpm |
| 232 | +| | prg | | | sav | sz |
| 233 | +| | | | | wasm | xz | | |
| 234 | +| | | | | sql lite | z |
| 235 | +| | | | | tar | zip |
| 236 | +| | | | | toml | zlib | |
| 237 | +| | | | | torrent | zst | |
| 238 | +| | | | | xml | | |
| 239 | +| | | | | yaml | | |
| 240 | + |
| 241 | +</TableWrap> |
| 242 | + |
| 243 | +#### Operators |
| 244 | +Operators are the way Gateway matches traffic to a selector. Matching happens as follows: |
| 245 | + |
| 246 | +| Operator | Meaning |
| 247 | +|:---------------------:|:---------------------------:| |
| 248 | +| is | exact match, equals | |
| 249 | +| is not | all except exact match | |
| 250 | +| in | in any of defined entries | |
| 251 | +| not in | not in defined entries | |
| 252 | +| matches regex | regex evaluates to true | |
| 253 | +| does not match regex | all except when regex evals to true | |
| 254 | + |
| 255 | +#### Expressions |
| 256 | +Expressions are sets of conditions with which you can combine [selectors](#selectors) and [operators](#operators). By configuring one or more expressions, you can define the scope of your HTTP policy. |
| 257 | + |
| 258 | +#### Example scenarios |
| 259 | + |
| 260 | +| Action | Selector | Operator | |
| 261 | +| ------ | ---- | -------- | |
| 262 | +| Block | Content categories | in: `Gaming` | |
| 263 | + |
| 264 | +**Result**: this configuration blocks any traffic to domains categorized as `Gaming`. |
| 265 | + |
| 266 | +#### FAQ |
| 267 | + |
| 268 | +* **How can I bypass the L7 firewall for a website?** |
| 269 | + |
| 270 | +Cloudflare Gateway uses the hostname in the HTTP CONNECT header to identify the destination of the request. Administrators who wish to bypass a site must match against the host in order to prevent HTTP inspection from occurring on both encrypted and plaintext traffic. The **bypass** action is only available when matching against the **host** criteria. |
| 271 | +Bypassing the L7 firewall results in no HTTP traffic inspection and logging is disabled for that HTTP session. |
| 272 | + |
| 273 | +* **In what order are rules evaluated?** |
| 274 | + |
| 275 | +The L7 firewall evaluates rules starting with the rule containing the lowest precedence (e.g., rule number one). Rules with a higher value precedence are evaluated after those with a lower value. |
| 276 | + |
| 277 | +<Aside> |
| 278 | + |
175 | 279 | This feature is only available on the **Teams Enterprise plan**. For more information, see the Cloudflare for Teams [pricing page](https://www.cloudflare.com/teams-pricing/). |
176 | 280 |
|
177 | 281 | </Aside> |
|
0 commit comments