File tree Expand file tree Collapse file tree 1 file changed +37
-0
lines changed
products/magic-transit/src/content/magic-firewall Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change 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+ ```
You can’t perform that action at this time.
0 commit comments