title | titleSuffix | description | author | manager | ms.reviewer | ms.service | ms.topic | ms.date | ms.author | ms.subservice |
---|---|---|---|---|---|---|---|---|---|---|
Tutorial to configure Azure Active Directory B2C with Cloudflare Web Application Firewall |
Azure AD B2C |
Tutorial to configure Azure Active Directory B2C with Cloudflare Web application firewall and protect applications from malicious attacks |
gargi-sinha |
martinco |
kengaderdus |
active-directory |
how-to |
01/26/2024 |
gasinh |
B2C |
In this tutorial, you can learn how to configure the Cloudflare Web Application Firewall (WAF) solution for Azure Active Directory B2C (Azure AD B2C) tenant with custom domain. Use Cloudflare WAF to help protect organizations from malicious attacks that can exploit vulnerabilities such as SQL Injection, and cross-site scripting (XSS).
To get started, you'll need:
- An Azure subscription
- If you don't have one, you can get an Azure free account
- An Azure AD B2C tenant linked to your Azure subscription
- A Cloudflare account
Cloudflare WAF integration includes the following components:
- Azure AD B2C tenant – The authorization server that verifies user credentials using the custom policies defined in the tenant. It's known as the identity provider
- Azure Front Door – Enables custom domains for Azure B2C tenant. Traffic from Cloudflare WAF is routed to Azure Front Door before arriving at Azure AD B2C tenant.
- Cloudflare – The web application firewall that manages traffic sent to the authorization server
For custom domains in Azure AD B2C, use the custom domain feature in Azure Front Door. Learn how to enable Azure AD B2C custom domains.
After a custom domain for Azure AD B2C is configured using Azure Front Door, test the custom domain before proceeding.
On cloudflare.com, you can create an account. To enable WAF, on Application Services, select Pro, which is required.
-
To enable WAF for a domain, in the DNS console for the CNAME entry, turn on the proxy setting from the DNS console for the CNAME entry as shown.
-
Under the DNS pane, toggle the Proxy status option to Proxied. It turns orange.
The settings appear in the following image.
Go to your Cloudflare settings, and use the Cloudflare content to configure the WAF and learn about other security tools.
In the top pane of the console, use the firewall option to add, update, or remove firewall rules. For example, the following firewall setting enables CAPTCHA for incoming requests to contosobank.co.uk domain before the request goes to Azure Front Door.
Learn more: Cloudflare Firewall Rules
Note
Cloudflare has functionality to customize block pages. See, Configuring Custom Pages (Error and Challenge).