You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Each saved endpoint will have an endpoint ID visible in its details page in Endpoint Management in the form of a UUID. The references below (`aaaaaaaa`, `bbbbbbbb`, and `cccccccc`) are the first eight characters of the endpoint ID.
Cloudflare recommends creating sequence rules using WAF custom rules. Refer to the [sequence custom rules documentation](/api-shield/security/sequence-mitigation/custom-rules/) for more information.
Copy file name to clipboardExpand all lines: src/content/docs/bots/additional-configurations/sequence-rules.mdx
+41-29Lines changed: 41 additions & 29 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,9 +16,25 @@ Sequence rules is currently in private beta. If you would like to be included in
16
16
- Your account must have the Fraud Detection subscription.
17
17
- Each zone must configure the endpoints to track via Endpoint Management.
18
18
19
+
You can [create a sequence custom rule via the Cloudflare dashboard](#create-a-sequence-custom-rule-via-the-cloudflare-dashboard) or [using the API](#manage-sequence-rules-via-the-api).
20
+
21
+
---
22
+
23
+
## Availability
24
+
25
+
<Renderfile="sequence-rules-availability" />
26
+
27
+
---
28
+
29
+
## Build a sequence custom rule via the Cloudflare dashboard
1.[Create an API token](/fundamentals/api/get-started/create-token/) if you do not already have one. The API token must include the _Zone_ > _Fraud Detection_ > _Edit_ permission.
@@ -48,18 +64,38 @@ When you enable sequence rules, Cloudflare will start setting cookies for all re
48
64
49
65
Once you have enabled sequence rules, the rules fields will be populated and you can now use the new fields in your rules.
50
66
67
+
### Disable sequence rules
68
+
69
+
Disabling sequence rules will stop the rules fields from being populated. If you still have rules deployed which depend on these fields, those rules may not behave as intended. Remove or disable any rules that rely on sequence fields before disabling sequence rules.
70
+
71
+
To disable sequence rules:
72
+
73
+
<Steps>
74
+
1.[Create an API token](/fundamentals/api/get-started/create-token/) if you do not already have one. The API token must include the _Zone_ > _Fraud Detection_ > _Edit_ permission.
75
+
2.[Get the zone ID](/fundamentals/account/find-account-and-zone-ids/) for the zone(s) where you want to enable sequence rules.
76
+
3.[Add the endpoints](/api-shield/management-and-monitoring/) that you want to track in your sequence rules using API Shield's Endpoint Management and make note of the short ID.
77
+
4. Disable the sequence cookie using your API token, zone ID, and by setting `enabled` to `false` on the following API call.
78
+
</Steps>
79
+
80
+
:::note
81
+
The short ID will not be visible until your account team has enabled this feature for you.
82
+
:::
83
+
84
+
```bash title="API call"
85
+
curl --request PUT https://api.cloudflare.com/client/v4/zones/{zone_id}/fraud_detection/sequence_cookies \
86
+
--header "Authorization: Bearer <API_TOKEN>" \
87
+
--data '{"enabled": false}'
88
+
```
89
+
51
90
---
52
91
92
+
53
93
## Rules fields
54
94
55
95
Sequence rules introduces three new fields to Cloudflare Rules. All of these fields reference operations by their short ID. Accounts that have the Fraud Detection subscription can refer to the short ID by viewing the endpoint details via **API Shield** > **Endpoint Management** in the Cloudflare dashboard. Accounts without Fraud Detection do not have access to this field.
56
96
57
97
Cloudflare only stores up to the 10 most recent operations in a sequence for up to one hour. If there are more than 10 operations in the sequence, older operations will be dropped and will not be included in the following fields. Similarly, if an operation happened more than one hour ago, it will also not be included in the following fields.
58
98
59
-
## Availability
60
-
61
-
<Renderfile="sequence-rules-availability" />
62
-
63
99
### Example rules
64
100
65
101
The customer must request endpoint A before endpoint B.
@@ -86,30 +122,6 @@ cf.sequence.current_op eq "bbbbbbbb" and
86
122
not cf.sequence.msec_since_op["aaaaaaaa"] ge 1000
87
123
```
88
124
89
-
---
90
-
91
-
## Disable sequence rules via the API
92
-
93
-
Disabling sequence rules will stop the rules fields from being populated. If you still have rules deployed which depend on these fields, those rules may not behave as intended. Remove or disable any rules that rely on sequence fields before disabling sequence rules.
94
-
95
-
To disable sequence rules:
96
-
97
-
<Steps>
98
-
1.[Create an API token](/fundamentals/api/get-started/create-token/) if you do not already have one. The API token must include the _Zone_ > _Fraud Detection_ > _Edit_ permission.
99
-
2.[Get the zone ID](/fundamentals/account/find-account-and-zone-ids/) for the zone(s) where you want to enable sequence rules.
100
-
3.[Add the endpoints](/api-shield/management-and-monitoring/) that you want to track in your sequence rules using API Shield's Endpoint Management and make note of the short ID.
101
-
4. Disable the sequence cookie using your API token, zone ID, and by setting `enabled` to `false` on the following API call.
102
-
</Steps>
103
-
104
-
:::note
105
-
The short ID will not be visible until your account team has enabled this feature for you.
106
-
:::
107
-
108
-
```bash title="API call"
109
-
curl --request PUT https://api.cloudflare.com/client/v4/zones/{zone_id}/fraud_detection/sequence_cookies \
1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/), and select your account and domain.
12
+
2. Go to **Security** > **WAF** > **Custom rules**.
13
+
3. To create a new empty rule, select **Create rule**.
14
+
4. Enter a descriptive name for the rule in **Rule name**.
15
+
5. Under **When incoming requests match**, use the **Field** drop-down list and select:
16
+
- Current Operation
17
+
- Previous Operations
18
+
- Elapsed time
19
+
6. Under **Value**, build a sequence by selecting a hostname for the sequence.
20
+
7. Select the checkbox for each endpoint in the order that you want them to appear in the sequence.
21
+
8. Set the time to complete.
22
+
9. Select **Save**.
23
+
10. Under **Then take action**, select the rule action in the **Choose action** dropdown. For example, selecting *Block* tells Cloudflare to refuse requests that match the conditions you specified.
24
+
11. (Optional) If you selected the *Block* action, you can configure a custom response.
25
+
12. Under **Place at**, select the order of when the rule will fire.
26
+
13. To save and deploy your rule, select **Deploy**. If you are not ready to deploy your rule, select **Save as Draft**.
27
+
</Steps>
28
+
</TabItem>
29
+
<TabItemlabel="New dashboard"icon="rocket">
30
+
<Steps>
31
+
1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/), and select your account and domain.
32
+
2. Go to **Security** > **Security rules**.
33
+
3. To create a new empty rule, select **Create rule** > **Custom rules**.
34
+
4. Enter a descriptive name for the rule in **Rule name**.
35
+
5. Under **When incoming requests match**, use the **Field** drop-down list to filter by **Sequences** and select from:
36
+
- Current Operation
37
+
- Previous Operations
38
+
- Elapsed time
39
+
6. Under **Value**, select the edit icon to use Builder and build a sequence on the side panel.
40
+
7. Under **Select a hostname for this sequence**, choose all or a specific hostname from the dropdown list. Optionally, you can use the search bar to search for a specific hostname.
41
+
8. From the **Methods** dropdown list, choose all methods or a specific request method.
42
+
8. Select the checkbox for each endpoint in the order that you want them to appear in the sequence.
43
+
8. Set the time to complete.
44
+
9. Select **Save**.
45
+
10. Under **Then take action**, select the rule action in the **Choose action** dropdown. For example, selecting *Block* tells Cloudflare to refuse requests that match the conditions you specified.
46
+
11. (Optional) If you selected the *Block* action, you can configure a custom response.
47
+
12. Under **Place at**, select the order of when the rule will fire.
48
+
13. To save and deploy your rule, select **Deploy**. If you are not ready to deploy your rule, select **Save as Draft**.
49
+
</Steps>
50
+
:::note
51
+
The fields in the custom rule are populated as a grouped sequence based on the values that you entered on Builder.
0 commit comments