Skip to content

Commit bffd695

Browse files
authored
[Magic Firewall] MFW-64: Add skip example (#447)
* [Magic Firewall] MFW-64: Add skip example * Update examples.md * tcp.port should be tcp.dstport * Minor fixes to request
1 parent a82ff5f commit bffd695

File tree

1 file changed

+37
-0
lines changed
  • products/magic-transit/src/content/magic-firewall

1 file changed

+37
-0
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
title: Examples
3+
order: 5
4+
---
5+
6+
# Examples
7+
8+
## Skip Action
9+
10+
The example below blocks all tcp ports, but allows one port (8080)
11+
by using the skip action.
12+
13+
```
14+
curl -X POST https://api.cloudflare.com/client/v4/accounts/${account_id}/rulesets \
15+
-H 'Content-Type: application/json' \
16+
-H 'X-Auth-Email: [email protected]' \
17+
-H 'X-Auth-Key: 00000000000' \
18+
--data '{
19+
"name": "Example ruleset",
20+
"kind": "root",
21+
"phase": "magic_transit",
22+
"description": "Example ruleset description",
23+
"rules": [
24+
{
25+
"action": "skip",
26+
"action_parameters": { "ruleset": "current" },
27+
"expression": "tcp.dstport in { 8080 } ",
28+
"description": "Allow port 8080"
29+
},
30+
{
31+
"action": "block",
32+
"expression": "tcp.dstport in { 1..65535 }",
33+
"description": "Block all tcp ports"
34+
}
35+
]
36+
}'
37+
```

0 commit comments

Comments
 (0)