Setup
import { APIRequest, Tabs, TabItem, DashButton } from "~/components";
In order to enable automatic mitigation of random prefix attacks:
-
Set up DNS Firewall.
-
Enable attack mitigation on your DNS Firewall cluster.
-
In the Cloudflare dashboard, go to the DNS Firewall Clusters page.
-
Select the cluster you want to update, then select Edit.
-
Turn on Attack mitigation and choose whether Cloudflare should only mitigate attacks when the upstream is unhealthy.
-
Select Save.
Send a
PATCHrequest to update your DNS Firewall cluster:<APIRequest path="/accounts/{account_id}/dns_firewall/{dns_firewall_id}" method="PATCH" json={{ "attack_mitigation": { "enabled": true, "only_when_upstream_unhealthy": true, } }} />
-
Once you turn on attack mitigation, Cloudflare returns a REFUSED response to queries that are part of a random prefix attack.
:::note
If you do not specify otherwise, Cloudflare automatically sets the only_when_upstream_unhealthy parameter to true, which means that Cloudflare will only mitigate attacks when we detect that the upstream is unresponsive (possibly as a result of an attack).
:::
谢谢你的反馈!