developer-resource
developer-resource copied to clipboard
CF Clearance
Description
Since we use Cloudflare, it protects our website (SSR server) with WAF. However, our API still remains unprotected. We can leverage Cloudflare Clearance to achieve that.
- Users visit matters.town;
- Users solve the challenge and set the
cf_clearancecookie; - Add WAF rules to protect API: allow traffic only with
cf_clearancecookie;
Refs
- https://developers.cloudflare.com/waf/tools/challenge-passage/
- https://developers.cloudflare.com/fundamentals/reference/policies-compliances/cloudflare-cookies/#additional-cookies-used-by-the-challenge-platform
- https://developers.cloudflare.com/turnstile/concepts/pre-clearance-support/
- https://blog.cloudflare.com/integrating-turnstile-with-the-cloudflare-waf-to-challenge-fetch-requests