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
* added new content
* refined text
* refined text
* deleted old pages
* added static threshold
* refined text
* refined text
* refined text
* added dynamic threshold
* refined text
* refined url
* refined title
* refined url
* refined text
* refined text
* added sflow rule
* corrected url
* refined text
* refined text
* refined text
* added ul
* added rule notifications
* refined text
* refined text
* refined text
* refined links
* refined text
* refined url
* refined text
* deleted old notification page
* added redirects
* corrected link
* refined text
* Apply suggestions from code review
Co-authored-by: Kate Tungusova <[email protected]>
* refined text
---------
Co-authored-by: Kate Tungusova <[email protected]>
A dynamic threshold rule (beta) will analyze a network's traffic patterns over time and automatically adjust the rule's DDoS threshold, in terms of bits or packets, based on traffic history. The total traffic across all IP prefixes and IP addresses in the rule is compared to the current value of the dynamic threshold. If the total traffic exceeds the dynamic threshold, then an alert is sent.
11
+
12
+
Dynamic thresholds are calculated using a statistical measure called [Z-score](https://en.wikipedia.org/wiki/Standard_score) (also referred to as standard score). Review [How the dynamic rule threshold is calculated](#how-the-dynamic-rule-threshold-is-calculated) to learn more.
13
+
14
+
Customers that send NetFlow and/or sFlow data to Cloudflare can configure dynamic threshold rules.
15
+
16
+
A dynamic threshold rule can only be configured via [Cloudflare's Magic Network Monitoring Rules API](/api/resources/magic_network_monitoring/subresources/rules/). Today, customers are unable to configure dynamic threshold rules in the Cloudflare dashboard.
17
+
18
+
## Rule configuration fields
19
+
20
+
| Field | Description |
21
+
| :---- | :---- |
22
+
|**Rule name**| Must be unique and cannot contain spaces. Supports characters `A-Z`, `a-z`, `0-9`, underscore (`_`), dash (`-`), period (`.`), and tilde (`~`). Maximum of 256 characters. |
23
+
|**Rule type**| zscore |
24
+
|**Target**| Can be defined in either bits per second or packets per second. |
25
+
|**Sensitivity**| Z-Score sensitivity has three values: low, medium, and high. |
26
+
|**Auto-advertisement**| If you are a [Magic Transit On Demand](/magic-transit/on-demand) customer, you can enable this feature to automatically enable Magic Transit if the rule's dynamic threshold is triggered. To learn more and see an example, view the [Auto-Advertisement section](/magic-network-monitoring/rules/rule-notifications/#rule-auto-advertisement-notifications). |
27
+
|**Rule IP prefix**| The IP prefix associated with the rule for monitoring traffic volume. Must be a CIDR range such as `160.168.0.1/24`. The maximum is 5,000 unique CIDR entries. To learn more and review an example, refer to the [Rule IP prefixes](/magic-network-monitoring/rules/#rule-ip-prefixes). |
28
+
29
+
## API documentation
30
+
31
+
to review an example API configuration call using CURL and the expected output for a successful response, go to [Magic Network Monitoring](/api/resources/magic_network_monitoring/) in [developers.cloudflare.com/api/](/api/) and expand the [Rules](/api/resources/magic_network_monitoring/subresources/rules/) section.
32
+
33
+
## How the dynamic rule threshold is calculated
34
+
35
+
Dynamic thresholds for this rule type are calculated using a statistical measure called Z-Score. The dynamic threshold for this rule will automatically adjust based on your traffic history as this rule uses statistical analysis to detect traffic anomalies. Z-Score is calculated by comparing short-term traffic patterns (five-minute time window) against long-term baselines (four-hour time window) .
36
+
37
+
Z-Score is calculated by using the following formula:
Copy file name to clipboardExpand all lines: src/content/docs/magic-network-monitoring/rules/index.mdx
+40-47
Original file line number
Diff line number
Diff line change
@@ -2,12 +2,26 @@
2
2
title: Rules
3
3
pcx_content_type: how-to
4
4
sidebar:
5
-
label: Manage rules
5
+
label: Overview
6
6
order: 4
7
7
8
8
---
9
9
10
-
Magic Network Monitoring rules will allow you to monitor the traffic volume destined for IP addresses or IP prefixes on your network. You can also receive alerts if the volume of traffic arriving at specific destinations exceeds a defined threshold.
10
+
Magic Network Monitoring rules allow you to monitor your network traffic for DDoS attacks on specific IP addresses or IP prefixes within your network. If the network traffic that is monitored by a rule exceeds the rule's threshold or contains a DDoS attack fingerprint, then you will receive an alert.
11
+
12
+
## Rule types
13
+
14
+
There are three different types of rules that can be configured within Magic Network Monitoring. You can refer to the linked documentation page for each rule type to learn more.
15
+
16
+
| Rule Type | Rule Description | Rule Availability |
17
+
| :---- | :---- | :---- |
18
+
|[Dynamic threshold](/magic-network-monitoring/rules/dynamic-threshold/) (recommended) | A dynamic threshold rule will analyze a network's traffic patterns over time and automatically adjust the rule's DDoS threshold, in terms of bits or packets, based on traffic history. | API configuration only |
19
+
|[Static threshold](/magic-network-monitoring/rules/static-threshold/)| A static threshold rule allows you to define a constant numeric threshold, in terms of bits or packets, for DDoS traffic monitoring. | API configuration and dashboard configuration |
20
+
|[sFlow DDoS attack](/magic-network-monitoring/rules/s-flow-ddos-attack/)| Magic Network Monitoring customers that send sFlow data to Cloudflare can receive alerts when a specific type of distributed denial-of-service (DDoS) attack is detected within their network traffic. | API configuration only. Only applicable to sFlow data sets |
21
+
22
+
## Create rules in the dashboard
23
+
24
+
You can only configure static traffic threshold rules in the Cloudflare dashboard.
11
25
12
26
:::caution[Invalid account settings error when trying to create a rule]
13
27
If you get the following error when trying to create a rule:
@@ -19,88 +33,67 @@ Make sure the name for your Cloudflare account does not contain unsupported char
19
33
Refer to [Account name](/fundamentals/setup/account/customize-account/account-name/) to learn how to change your account name.
20
34
:::
21
35
22
-
23
-
## Create rules
24
-
25
-
Refer to [Recommended rule configuration](/magic-network-monitoring/rules/recommended-rule-configuration/) for more details on the settings we recommend to create appropriate Magic Network Monitoring rules.
36
+
To create a new rule:
26
37
27
38
1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/login), and select your account.
28
39
2. Go to **Analytics & Logs** > **Magic Monitoring**.
29
40
3. Select **Configure Magic Network Monitoring** > **Add new rule**.
30
-
4. Create your rule according to your needs. Refer to [Rule fields](#rule-fields)for more information on what each field does.
41
+
4. Create a new static traffic threshold rule according to your needs. Refer to the documentation on [static threshold](/magic-network-monitoring/rules/static-threshold/) rules for more information on each field in the static threshold rule's configuration.
31
42
5. Select **Create a new rule** when you are finished.
32
43
33
-
## Edit or delete rules
44
+
## Edit rules in the dashboard
34
45
35
46
1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/login), and select your account.
36
47
2. Go to **Analytics & Logs** > **Magic Monitoring**.
37
48
3. Select **Configure Magic Network Monitoring**.
38
-
4. Find the rule you want to edit, and select **Edit**. Optionally, you can also select **Delete** to delete a rule.
39
-
5. Edit the appropriate fields. Refer to [Rule fields](#rule-fields) for more information on what each field does.
49
+
4. Find the static threshold rule you want to edit, and select **Edit**.
50
+
5. Edit the appropriate fields. Refer to [Rule configuration fields](/magic-network-monitoring/rules/static-threshold/#rule-configuration-fields) for more information on what each field does.
40
51
6. Select **Save** when you are finished.
41
52
42
-
## Rule Auto-Advertisement
53
+
## Delete rules in the dashboard
43
54
44
-
If you are an Enterprise customer using [Magic Transit On Demand](/magic-transit/on-demand), enable **Auto-Advertisement** if you want to automatically activate Magic Transit when a certain threshold is exceeded.
55
+
1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/login), and select your account.
56
+
2. Go to **Analytics & Logs** > **Magic Monitoring**.
57
+
3. Select **Configure Magic Network Monitoring**.
58
+
4. Find the static threshold rule you want to delete, and select **Delete**.
59
+
5. Select **I understand that deleting a rule is permanent**, and select **Delete** again.
45
60
46
-
Follow the previous steps to [create](#create-rules) or [edit](#edit-or-delete-rules) a rule. Then, make sure you enable **Auto-Advertisement**.
61
+
## Common settings that apply to all rule types
47
62
48
-
## Rule fields
63
+
###Rule Auto-Advertisement
49
64
50
-
| Field | Description |
51
-
| ----------------------- | ----------- |
52
-
|**Rule name**| Must be unique and cannot contain spaces. Supports characters `A-Z`, `a-z`, `0-9`, underscore (`_`), dash (`-`), period (`.`), and tilde (`~`). Max 256 characters. |
53
-
|**Rule threshold type**| Can be defined in either bits per second or packets per second. |
54
-
|**Rule threshold**| The number of bits per second or packets per second for the rule alert. When this value is exceeded for the rule duration, an alert notification is sent. Minimum of `1` and no maximum. |
55
-
|**Rule duration**| The amount of time in minutes the rule threshold must exceed to send an alert notification. Choose from the following values: `1`, `5`, `10`, `15`, `20`, `30`, `45`, or `60` minutes. |
56
-
|**Auto-advertisement**| If you are a [Magic Transit On Demand](/magic-transit/on-demand) customer, you can enable this feature to automatically enable Magic Transit if the rule alert is triggered.|
57
-
|**Rule IP prefix**| The IP prefix associated with the rule for monitoring traffic volume. Must be a CIDR range such as `160.168.0.1/24`. Max is 5,000 unique CIDR entries. |
65
+
If you are an Enterprise customer using [Magic Transit On Demand](/magic-transit/on-demand), you can enable **Auto-Advertisement** for any dynamic threshold, static threshold, and sFlow DDoS attack rule. The Auto-Advertisement feature will automatically activate Magic Transit when a static or dynamic rule threshold is exceeded or a DDoS attack fingerprint is identified in sFlow traffic logs.
58
66
59
-
## Enable per-prefix thresholds with the API
67
+
Follow the previous steps to [create](#create-rules-in-the-dashboard) or [edit](#edit-rules-in-the-dashboard) a rule. Then, enable **Auto-Advertisement**.
60
68
61
-
You can also use the [Magic Network Monitoring API](/api/resources/magic_network_monitoring/subresources/rules/methods/list/) to configure custom thresholds for specific prefixes.
69
+
### Rule IP prefixes
62
70
63
-
The system uses the concept of rules, and each rule consists of a group of prefixes. All prefixes inside a rule are evaluated as a whole, and you should set up a rule if you want the prefixes' aggregated traffic to trigger an alert or advertisement. For thresholds on singular prefixes or IPs, you can create an individual rule with one prefix and the desired threshold.
71
+
Each rule must include a group of IP prefixes in its definition. All IP prefixes inside a rule are evaluated as a whole, and you should set up a rule with multiple IP prefixes when you want the IP prefixes' aggregated traffic to trigger an alert or advertisement. For thresholds on singular IP prefixes or IP addresses, you can create an individual rule with one prefix and the desired rule parameters.
64
72
65
-
### Example
73
+
### Rule IP prefixes example
66
74
67
-
For a rule with two prefix CIDRs and a `packet_threshold` of `10000` as shown below, the rule will be flagged if the joint packet traffic of `192.168.0.0/24` and `172.118.0.0/24` is greater than `10000`. This also means that Cloudflare attempts to auto advertise both CIDRs in case the flag is turned on.
75
+
For a rule with two prefix CIDRs and a `packet_threshold` of `10000` as shown below, the rule will be flagged if the joint packet traffic of `192.168.0.0/24` and `172.118.0.0/24` is greater than `10000`. This also means that Cloudflare attempts to auto advertise both CIDRs if the rule has the auto advertisement flag enabled. Customers can also [configure Rule IP prefixes at scale via Cloudflare's API](https://developers.cloudflare.com/api/resources/magic_network_monitoring/subresources/rules/).
68
76
69
-
```bash
77
+
```json
70
78
"rules":[
71
79
"name": "Too many packets",
72
80
"prefixes": ["192.168.0.0/24", "172.118.0.0/24"],
73
81
"packet_threshold": 10000,
74
82
"automatic_advertisement": true,
75
83
"duration": "1m0s",
84
+
"type": "threshold"
76
85
]
77
86
```
78
87
79
88
For more granular thresholds, create a more focused rule as shown below.
80
89
81
-
```bash
90
+
```json
82
91
"rules":[
83
92
"name": "Too many packets",
84
93
"prefixes": ["172.118.0.0/24"],
85
94
"packet_threshold": 1000,
86
95
"automatic_advertisement": true,
87
96
"duration": "1m0s",
97
+
"type": "threshold"
88
98
]
89
-
```
90
-
91
-
Refer to the [Magic Network Monitoring API documentation](/api/resources/magic_network_monitoring/subresources/rules/methods/list/) for more information.
92
-
93
-
## Notifications
94
-
95
-
Webhook, PagerDuty, and email notifications are sent following an auto-advertisement attempt for all prefixes inside the flagged rule.
96
-
97
-
You will receive the status of the advertisement for each prefix with the following available statuses:
98
-
99
-
-**Advertised**: The prefix was successfully advertised.
100
-
-**Already Advertised**: The prefix was advertised prior to the auto advertisement attempt.
101
-
-**Delayed**: The prefix cannot currently be advertised but will attempt advertisement. After the prefix can be advertised, a new notification is sent with the updated status.
102
-
-**Locked**: The prefix is locked and cannot be advertised.
103
-
-**Could not Advertise**: Cloudflare was unable to advertise the prefix. This status can occur for multiple reasons, but usually occurs when you are not allowed to advertise a prefix.
104
-
-**Error**: A general error occurred during prefix advertisement.
105
-
106
-
Refer to [Notifications](/magic-network-monitoring/notifications/) to learn how to create one.
After configuring one or multiple rule types in Magic Network Monitoring, customers can also choose to receive notifications via email, webhook, or PagerDuty when a rule is triggered.
9
+
10
+
Customers can configure multiple rule types and alerts together to create layers of DDoS protection based on their network environment and their security needs.
11
+
12
+
You can read [Cloudflare's Notifications documentation](/notifications/) for more information on our notification platform including:
|**Notification name**| The name of the Magic Network Monitoring notification (MNM) for the rule type that was selected. |
25
+
|**Description (optional)**| The description of the MNM notification. |
26
+
|**Webhooks**| The webhook(s) that will receive the MNM notification. |
27
+
|**Notification email**| The email(s) that will receive the MNM notification. |
28
+
29
+
## Rule Auto-Advertisement notifications
30
+
31
+
Webhook, PagerDuty, and email notifications are sent following an auto-advertisement attempt for all prefixes inside the flagged rule.
32
+
33
+
You will receive the status of the advertisement for each prefix with the following available statuses:
34
+
35
+
-**Advertised**: The prefix was successfully advertised.
36
+
-**Already Advertised**: The prefix was advertised prior to the auto advertisement attempt.
37
+
-**Delayed**: The prefix cannot currently be advertised but will attempt advertisement. After the prefix can be advertised, a new notification is sent with the updated status.
38
+
-**Locked**: The prefix is locked and cannot be advertised.
39
+
-**Could not Advertise**: Cloudflare was unable to advertise the prefix. This status can occur for multiple reasons, but usually occurs when you are not allowed to advertise a prefix.
40
+
-**Error**: A general error occurred during prefix advertisement.
41
+
42
+
## Configure static threshold notifications
43
+
44
+
To configure static threshold notifications:
45
+
46
+
1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/login), and select your account.
47
+
2. Go to **Notifications** > **Add**.
48
+
3. Select **Magic Transit** from the product dropdown menu.
49
+
4. Find the **Magic Network Monitoring: Volumetric Attack** alert, and select **Select**.
50
+
5. Fill in the notification configuration details.
51
+
6. Select **Save**.
52
+
53
+
## Configure dynamic threshold notifications
54
+
55
+
To configure dynamic threshold notifications:
56
+
57
+
1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/login), and select your account.
58
+
2. Go to **Notifications** > **Add**.
59
+
3. Select **Magic Transit** from the product dropdown menu.
60
+
4. Find the **Magic Network Monitoring: Volumetric Attack** alert, and select **Select**.
61
+
5. Fill in the notification configuration details.
62
+
6. Select **Save**.
63
+
64
+
## Configure sFlow DDoS attack notifications
65
+
66
+
To configure sFlow DDoS attack notifications:
67
+
68
+
1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/login), and select your account.
69
+
2. Go to **Notifications** > **Add**.
70
+
3. Select **Magic Transit** from the product dropdown menu.
71
+
4. Find the **Magic Network Monitoring: DDoS Attack** alert, and select **Select**.
72
+
5. Fill in the notification configuration details.
0 commit comments