Cloud Scrubbing Integrations
Auto-divert traffic to upstream scrubbing providers when attacks are detected
Overview
Cloud scrubbing integrations connect Flowtriq to upstream DDoS mitigation providers. When an attack is detected, Flowtriq calls the provider's API to activate traffic scrubbing. When the attack resolves, scrubbing is automatically deactivated and direct routing resumes.
This is different from firewall rules (which run firewall commands on your server). Cloud scrubbing diverts traffic at the network level before it reaches your infrastructure.
Supported Providers
| Provider | Mechanism | Cost | Best For |
|---|---|---|---|
| Cloudflare Magic Transit | BGP prefix advertisement via API | On-demand pricing (pay only during attacks) | Any infrastructure with /24+ IP space |
| OVH DDoS Protection | Permanent mitigation mode toggle via API | Free (included with all OVH dedicated servers) | Game servers and apps hosted on OVH/SoYouStart |
| Hetzner Firewall | Hardware firewall activation via Robot API | Free (included with all Hetzner dedicated servers) | Apps hosted on Hetzner dedicated servers |
Setup: Cloudflare Magic Transit
Prerequisites
- A Cloudflare account with Magic Transit enabled
- At least one IP prefix (/24 or larger) configured in Cloudflare
- An API token with Account:IP Prefixes:Edit and Account:Magic Transit:Edit scopes
Configuration Steps
- Go to Dashboard → Integrations
- Select Cloudflare Magic Transit (Scrubbing) from the type dropdown
- Enter your API Token, Account ID, and Prefix ID
- Enable Auto-divert to automatically announce the prefix when attacks are detected
- Click Add Integration
- Use the Test button to verify credentials and prefix access
Finding Your Prefix ID
After adding the integration, click Test - the response will show how many prefixes are on your account. To get specific prefix IDs, use the Cloudflare API:
curl -X GET "https://api.cloudflare.com/client/v4/accounts/{account_id}/addressing/prefixes" \
-H "Authorization: Bearer {api_token}" \
-H "Content-Type: application/json"
How It Works
- Flowtriq detects an attack on one of your nodes
- Flowtriq calls
PATCH /accounts/{id}/addressing/prefixes/{prefix_id}/bgp/statuseswith{"advertised": true} - Cloudflare begins advertising your prefix via BGP (convergence takes 30-90 seconds)
- Traffic is routed through Cloudflare's scrubbing network
- When the incident resolves, Flowtriq withdraws the prefix (
{"advertised": false}) - Direct routing resumes
Setup: OVH DDoS Protection
Prerequisites
- An OVH, SoYouStart, or Kimsufi dedicated server
- OVH API credentials (Application Key, Application Secret, Consumer Key)
Getting API Credentials
- Go to api.ovh.com/createToken
- Set the validity period (unlimited recommended)
- Add these access rules:
GET /ip/*POST /ip/*/mitigationDELETE /ip/*/mitigation/*GET /ip/*/mitigation/*
- Save the Application Key, Application Secret, and Consumer Key
Configuration Steps
- Go to Dashboard → Integrations
- Select OVH DDoS Protection (Scrubbing)
- Enter your Application Key, Application Secret, Consumer Key
- Select your API endpoint (EU, CA, or US)
- Enter the IP address to protect
- Enable Auto-mitigate for automatic activation
How It Works
OVH already has built-in DDoS detection, but it operates on a higher threshold and slower detection cycle. Flowtriq detects attacks faster and can force-enable OVH's "permanent mitigation" mode via API, which applies stricter filtering to your IP.
- On attack:
POST /ip/{ip}/mitigationwith{"ipOnMitigation": "{ip}"} - On resolution:
DELETE /ip/{ip}/mitigation/{ip}(restores auto mode)
Setup: Hetzner Firewall
Prerequisites
- A Hetzner dedicated server with firewall configured in the Robot panel
- Robot API credentials (separate from Hetzner Cloud API)
Getting Robot API Credentials
- Log in to robot.your-server.de/preferences
- Under Webservice access, create a new login
- Save the username (format:
#ws+xxxxx) and password
Important: Configure Firewall Rules First
Flowtriq activates/deactivates the Hetzner firewall - it does not create rules. You must configure your firewall rules in the Hetzner Robot panel before enabling this integration. When Flowtriq detects an attack, it sets status=active; when the attack resolves, it sets status=disabled.
Configuration Steps
- Configure firewall rules in the Hetzner Robot panel (Firewall tab for your server)
- Go to Dashboard → Integrations
- Select Hetzner Firewall (Scrubbing)
- Enter your Robot login, password, and server IP
- Enable Auto-activate firewall
Manual Controls
Each scrubbing integration has manual control buttons in the integrations list:
- Test - Verify API credentials and connectivity
- Activate - Manually start scrubbing (announce prefix / enable mitigation / activate firewall)
- Withdraw - Manually stop scrubbing (withdraw prefix / disable mitigation / deactivate firewall)
Auto-Withdraw Safety
When an incident resolves, Flowtriq checks if there are other active incidents for the same workspace before withdrawing. If multiple attacks are in progress, scrubbing stays active until all incidents resolve. This prevents flapping where scrubbing is withdrawn during a brief lull in a multi-wave attack.
Combining with Firewall Rules
Cloud scrubbing and firewall rules serve different purposes and work well together:
| Feature | Firewall Rules | Cloud Scrubbing |
|---|---|---|
| Where it acts | On your server (via agent) | Upstream (via provider API) |
| Response time | < 1 second | 1-90 seconds (depends on provider) |
| Handles volumetric floods | Limited (link can still saturate) | Yes (traffic diverted before reaching you) |
| Handles application-layer | Yes (iptables, nftables, etc.) | Depends on provider |
Recommended setup: Use firewall rules for immediate local protection (iptables rate limiting, protocol drops), BGP mitigation for network-level FlowSpec/RTBH at your border routers, and cloud scrubbing for upstream volumetric protection. All three trigger automatically on the same incident.