Skip to content

Commit 2bf519e

Browse files
[MNN] New rule types (#21448)
* 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]>
1 parent b65f718 commit 2bf519e

File tree

9 files changed

+237
-121
lines changed

9 files changed

+237
-121
lines changed

public/__redirects

+3
Original file line numberDiff line numberDiff line change
@@ -794,6 +794,9 @@
794794
# magic-network-monitoring
795795
/magic-network-monitoring/routers/ /magic-network-monitoring/routers/supported-routers/ 301
796796
/magic-network-monitoring/tutorials/ /magic-network-monitoring/tutorials/graphql-analytics/ 301
797+
/magic-network-monitoring/rules/recommended-rule-configuration/ /magic-network-monitoring/rules/static-threshold/ 301
798+
/magic-network-monitoring/rules/sflow-ddos-alerts/ /rules/configure-rule-notifications/ 301
799+
/magic-network-monitoring/notifications/ /rules/rule-notifications/ 301
797800

798801
# magic-transit
799802
/magic-transit/magic-firewall/ /magic-firewall/ 301

src/content/docs/magic-network-monitoring/index.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ Magic Transit On Demand customers can use Magic Network Monitoring to enable DDo
5252

5353
</Feature>
5454

55-
<Feature header="Notifications" href="/magic-network-monitoring/notifications/">
55+
<Feature header="Rule notitications" href="/magic-network-monitoring/rules/rule-notifications/">
5656

5757
Set up notifications to learn about an attack.
5858

src/content/docs/magic-network-monitoring/notifications.mdx

-18
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
---
2+
title: Dynamic threshold rule
3+
pcx_content_type: how-to
4+
sidebar:
5+
order: 2
6+
badge:
7+
text: Beta
8+
---
9+
10+
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:
38+
39+
```txt
40+
Z = (X - μ) / σ
41+
```
42+
43+
- `X` = Current traffic value.
44+
- `μ` = Mean traffic value over the long window.
45+
- `σ` = Standard deviation over the long window.

src/content/docs/magic-network-monitoring/rules/index.mdx

+40-47
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,26 @@
22
title: Rules
33
pcx_content_type: how-to
44
sidebar:
5-
label: Manage rules
5+
label: Overview
66
order: 4
77

88
---
99

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.
1125

1226
:::caution[Invalid account settings error when trying to create a rule]
1327
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
1933
Refer to [Account name](/fundamentals/setup/account/customize-account/account-name/) to learn how to change your account name.
2034
:::
2135

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:
2637

2738
1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/login), and select your account.
2839
2. Go to **Analytics & Logs** > **Magic Monitoring**.
2940
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.
3142
5. Select **Create a new rule** when you are finished.
3243

33-
## Edit or delete rules
44+
## Edit rules in the dashboard
3445

3546
1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/login), and select your account.
3647
2. Go to **Analytics & Logs** > **Magic Monitoring**.
3748
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.
4051
6. Select **Save** when you are finished.
4152

42-
## Rule Auto-Advertisement
53+
## Delete rules in the dashboard
4354

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.
4560

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
4762

48-
## Rule fields
63+
### Rule Auto-Advertisement
4964

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.
5866

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**.
6068

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
6270

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.
6472

65-
### Example
73+
### Rule IP prefixes example
6674

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/).
6876

69-
```bash
77+
```json
7078
"rules":[
7179
"name": "Too many packets",
7280
"prefixes": ["192.168.0.0/24", "172.118.0.0/24"],
7381
"packet_threshold": 10000,
7482
"automatic_advertisement": true,
7583
"duration": "1m0s",
84+
"type": "threshold"
7685
]
7786
```
7887

7988
For more granular thresholds, create a more focused rule as shown below.
8089

81-
```bash
90+
```json
8291
"rules":[
8392
"name": "Too many packets",
8493
"prefixes": ["172.118.0.0/24"],
8594
"packet_threshold": 1000,
8695
"automatic_advertisement": true,
8796
"duration": "1m0s",
97+
"type": "threshold"
8898
]
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.
99+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
---
2+
title: Configure rule notifications
3+
pcx_content_type: how-to
4+
sidebar:
5+
order: 4
6+
---
7+
8+
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:
13+
14+
- [Configure Cloudflare notifications](/notifications/get-started/)
15+
- [Configure PagerDuty](/notifications/get-started/configure-pagerduty/)
16+
- [Configure webhooks](/notifications/get-started/configure-webhooks/)
17+
- [Test a notification](/notifications/get-started/#test-a-notification)
18+
- [Notification History](/notifications/notification-history/)
19+
20+
## Magic Network Monitoring notification configuration fields
21+
22+
| Field | Description |
23+
| :---- | :---- |
24+
| **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.
73+
6. Select **Save**.

0 commit comments

Comments
 (0)