90+ Cloudflare Interview Questions: DevOps Security (2027)
92 Cloudflare interview questions on SSL modes, WAF and rate limiting rules, DDoS, Zero Trust, Tunnel, Workers and Terraform, for DevOps security.
Cloudflare interview questions for DevOps and security roles cover how traffic flows through Cloudflare's reverse proxy, TLS modes, WAF and rate limiting rules, DDoS protection, bot controls, Zero Trust access, Tunnels, Workers, and managing all of it as code with Terraform. This guide has 92 numbered questions with direct answers, grouped by level, plus scenario questions.
This is the main Cloudflare question bank on our blog, focused on security and DevOps automation. The Cloudflare engineer interview questions go deeper on edge performance and platform engineering, and the scenario-based Cloudflare questions walk through incidents step by step.
Key takeaways
- Cloudflare is a reverse proxy: proxied DNS records send visitor traffic to Cloudflare's network first, which applies caching and security before reaching your origin.
- Use the Full (strict) SSL/TLS mode with a valid origin certificate; Flexible leaves the Cloudflare-to-origin leg unencrypted.
- WAF managed rulesets, custom rules and rate limiting rules use the same Rules language expressions, which interviewers often ask you to write.
- Cloudflare One (Zero Trust) covers Access, Gateway, the WARP client and Tunnels for reaching private apps without opening inbound ports.
- Manage zones, DNS and rules with the Cloudflare Terraform provider and scoped API tokens, not the global API key.
Cloudflare security and DevOps services at a glance
| Service | What it does | Typical interview topic |
|---|---|---|
| DNS and proxy | Authoritative DNS; proxied records route through Cloudflare | Proxied vs DNS-only, origin IP exposure |
| SSL/TLS | Edge certificates and origin encryption modes | Flexible vs Full vs Full (strict) |
| WAF | Managed rulesets, custom rules, rate limiting | Rule expressions, false positives |
| DDoS protection | Automatic L3/4 and L7 mitigation | Managed DDoS rulesets, sensitivity |
| Bot management and Turnstile | Detect and challenge automated traffic | Challenges vs blocks |
| Cloudflare One (Zero Trust) | Access, Gateway, WARP, Tunnel | Replacing VPNs, identity policies |
| Workers | Serverless code at the edge | Wrangler, deployment from CI |
| Terraform provider and API | Configuration as code | API tokens, state, drift |
Cloudflare interview questions for freshers
1. What is Cloudflare?
Cloudflare runs a global network that sits in front of websites, APIs and networks. It provides DNS, CDN caching, DDoS protection, a web application firewall, Zero Trust access, and developer services like Workers.
2. What does it mean that Cloudflare is a reverse proxy?
Visitors connect to Cloudflare instead of your server. Cloudflare terminates the connection, applies security and caching, and forwards allowed requests to your origin. Your origin's IP address stays hidden if configured correctly.
3. What is the difference between a proxied and a DNS-only record?
A proxied record (orange cloud) resolves to Cloudflare IPs, so traffic passes through Cloudflare's security and cache. A DNS-only record (grey cloud) returns your real IP and Cloudflare only answers DNS.
4. How do you onboard a domain to Cloudflare?
Add the site in the dashboard, review the imported DNS records, then change the nameservers at your registrar to the two Cloudflare nameservers assigned. This is a full setup. Some plans also support a partial (CNAME) setup.
5. What is an origin server?
The server that hosts your actual application, such as a load balancer, VM or bucket. Cloudflare fetches content from it when a request is not served from cache or blocked.
6. What does a CDN do?
A content delivery network caches static content in data centres close to users, which cuts latency and load on the origin. Cloudflare caches based on file extension by default, and cache rules let you change that.
7. What is a DDoS attack?
A distributed denial-of-service attack floods a target with traffic from many sources to make it unavailable. Attacks can target network layers 3 and 4 (packet floods) or layer 7 (HTTP request floods).
8. How does Cloudflare protect against DDoS?
Cloudflare's network absorbs volumetric traffic, and automatic DDoS managed rulesets detect and mitigate attacks at layers 3, 4 and 7. Cloudflare states its DDoS protection is unmetered on all plans.
9. What is a WAF?
A web application firewall inspects HTTP requests and blocks those that match attack patterns, such as SQL injection or cross-site scripting, before they reach the application.
10. What are Cloudflare's SSL/TLS encryption modes?
Off, Flexible, Full and Full (strict). Flexible encrypts only browser to Cloudflare. Full encrypts to the origin but accepts any certificate. Full (strict) requires a valid certificate on the origin, either publicly trusted or a Cloudflare Origin CA certificate.
11. Why is Flexible SSL risky?
Traffic between Cloudflare and your origin is plain HTTP, so it can be read or changed on that path. It can also cause redirect loops if the origin redirects HTTP to HTTPS. Use Full (strict).
12. What is Universal SSL?
A free edge certificate Cloudflare issues automatically for your domain and first-level subdomains, so visitors get HTTPS to Cloudflare without you buying a certificate.
13. What is a Cloudflare Origin CA certificate?
A free certificate issued by Cloudflare for installing on your origin. Cloudflare trusts it in Full (strict) mode, but browsers do not, so use it only behind the Cloudflare proxy.
14. What do "Always Use HTTPS" and HSTS do?
Always Use HTTPS redirects HTTP requests to HTTPS at the edge. HSTS tells browsers to use only HTTPS for your domain for a set time. Enable HSTS carefully because browsers cache it.
15. What is the minimum TLS version setting?
It sets the lowest TLS version Cloudflare accepts from visitors. Setting it to TLS 1.2 blocks clients that only support older, weaker versions.
16. What is "Under Attack" mode?
A setting that shows an interstitial challenge to visitors before they reach the site, used during layer 7 attacks. It adds friction for every visitor, so turn it off once the attack ends.
17. What is Bot Fight Mode?
A free setting that challenges requests matching known bot patterns. Paid plans offer Super Bot Fight Mode and Bot Management with bot scores and more control.
18. What is Cloudflare Turnstile?
A CAPTCHA alternative you add to forms. It verifies visitors with non-interactive challenges, and your server validates the token with Cloudflare's siteverify API.
19. What is DNSSEC and does Cloudflare support it?
DNSSEC signs DNS records so resolvers can verify answers have not been tampered with. Cloudflare supports one-click DNSSEC; you then add the DS record at your registrar.
20. What is CNAME flattening?
Cloudflare resolves a CNAME at the zone apex to its target's IP addresses and returns A or AAAA records, since a CNAME is not allowed at the apex by the DNS standard.
21. Which ports does Cloudflare proxy by default?
For HTTP: 80, 8080, 8880, 2052, 2082, 2086, 2095. For HTTPS: 443, 2053, 2083, 2087, 2096, 8443. Other ports need DNS-only records or Spectrum.
22. What is Cloudflare Workers?
A serverless platform that runs JavaScript, TypeScript, Python or WebAssembly code on Cloudflare's network, close to users, triggered by HTTP requests, cron schedules or queues.
23. What is Cloudflare Zero Trust?
Cloudflare One, Cloudflare's Zero Trust platform, checks identity and device posture on every request to internal apps and filters user internet traffic. Main parts are Access, Gateway, the WARP client and Tunnel.
24. What is Cloudflare Tunnel?
A connector called cloudflared runs near your service and makes outbound-only connections to Cloudflare. Traffic reaches your app through the tunnel, so you do not need inbound firewall rules or a public IP.
25. What are Cloudflare analytics and logs used for?
Analytics show traffic, cache ratio, threats and performance per zone. Security Events shows which rules acted on requests. Logpush (on eligible plans) ships detailed logs to storage or a SIEM.
Cloudflare interview questions for 2-5 years experience
26. What are WAF managed rulesets?
Prebuilt rule collections maintained by Cloudflare, such as the Cloudflare Managed Ruleset and the Cloudflare OWASP Core Ruleset. You deploy them on a zone and can override actions or disable individual rules.
27. How does the Cloudflare OWASP Core Ruleset score requests?
It is Cloudflare's implementation of the OWASP ModSecurity Core Rule Set. Each matching rule adds to a threat score, and the request is blocked or logged when the score passes the threshold you set, along with a paranoia level.
28. What are WAF custom rules?
Rules you write with the Rules language to block, challenge, log or skip requests based on fields like path, method, IP, country, headers or bot score.
29. Write a custom rule expression that blocks access to /admin except from one IP range.
(http.request.uri.path contains "/admin" and not ip.src in {203.0.113.0/24})
Set the action to Block. Test with the Log action first where your plan supports it.
30. What is a rate limiting rule?
A rule that counts requests matching an expression per characteristic, such as IP, over a period, and blocks or challenges when the count exceeds the threshold. A common use is protecting login and API endpoints.
31. What actions can WAF rules take?
Common actions are Block, Managed Challenge, JS Challenge, Interactive Challenge, Skip and Log (Log depends on plan). Managed Challenge lets Cloudflare pick the least intrusive challenge.
32. What is the Skip action used for?
It lets matching requests bypass selected security features or rules, for example skipping a managed rule that produces false positives for a trusted partner's IPs. Keep skip rules narrow.
33. How do you handle a WAF false positive?
Find the request in Security Events, note the rule ID, and add an exception (skip) scoped to the specific path or rule instead of disabling the whole ruleset. Then confirm the fix with a test request.
34. What are IP Access rules?
Simple rules that allow, block or challenge by IP, IP range, ASN or country at account or zone level. For complex logic, custom rules are more flexible.
35. What are lists in Cloudflare?
Reusable named lists of IPs, hostnames or ASNs that you reference in rule expressions, such as ip.src in $office_ips. Updating the list updates every rule that uses it.
36. How do you prevent attackers from bypassing Cloudflare and hitting the origin directly?
Allow inbound traffic only from Cloudflare's published IP ranges at the origin firewall, use Authenticated Origin Pulls (mTLS) so the origin accepts only Cloudflare's client certificate, or remove public exposure entirely with Cloudflare Tunnel.
37. What are Authenticated Origin Pulls?
Cloudflare presents a client certificate when connecting to your origin, and the origin is configured to require it. Requests that do not come through Cloudflare fail the mTLS check.
38. How can an origin IP leak?
Through DNS-only records on the same server, old DNS history, mail server records, the server's own outgoing connections, or error pages. After onboarding, consider rotating the origin IP and locking the firewall to Cloudflare ranges.
39. How do you get the real visitor IP at the origin?
Cloudflare adds the CF-Connecting-IP header (and X-Forwarded-For). Configure your web server to trust these headers only from Cloudflare IP ranges, for example with NGINX's real IP module.
40. What are DDoS managed rulesets and how do you tune them?
The HTTP DDoS attack protection and Network-layer DDoS attack protection managed rulesets run automatically. You can override sensitivity or action for specific rules if legitimate traffic is flagged.
41. What is Magic Transit?
A service that protects whole IP networks by announcing your prefixes through BGP from Cloudflare's network, filtering traffic and forwarding clean traffic to your data centre over tunnels.
42. What is Spectrum?
A Cloudflare product that proxies TCP and UDP applications on arbitrary ports, such as SSH, gaming or mail, extending DDoS protection beyond HTTP.
43. What is API Shield?
A set of API security features including schema validation against an OpenAPI spec, mTLS for client authentication, JWT validation, and API discovery to find endpoints you did not document.
44. What is Page Shield?
A client-side security feature that monitors JavaScript and connections loaded by your pages, alerting on new or malicious scripts that could skim data from visitors' browsers.
45. What are bot scores?
With Bot Management, Cloudflare assigns each request a score from 1 to 99, where low scores indicate likely automation. You can use cf.bot_management.score in custom rules, for example to challenge scores below 30 on login.
46. What are cache rules?
Rules that set caching behaviour for matching requests: eligible or bypass, edge and browser TTL, cache key settings. Cloudflare has been moving features from legacy Page Rules to dedicated rule types like cache rules.
47. How do you purge cached content?
From the dashboard or API: purge everything, or purge by URL, and on eligible plans by tag, host or prefix. In CI, call the purge API after a deployment using a scoped API token.
48. What is Cloudflare Access?
Access protects internal applications with identity-aware policies. Users authenticate with your identity provider (such as Okta, Azure AD or Google), and policies can also check device posture before allowing access.
49. How does Access replace a VPN?
Instead of giving network-level access, Access grants per-application access after checking identity and context on each request. Combined with Tunnel, apps never need to be exposed publicly.
50. What is Cloudflare Gateway?
A secure web gateway that filters DNS, HTTP and network traffic from users' devices or offices, blocking malware, phishing and policy-banned categories.
51. What is the WARP client used for in Zero Trust?
The Cloudflare One agent (WARP) runs on devices and sends traffic to Cloudflare so Gateway policies apply, reports device posture, and lets users reach private networks behind Tunnels.
52. How do you create a tunnel?
cloudflared tunnel login
cloudflared tunnel create app-tunnel
cloudflared tunnel route dns app-tunnel app.example.com
cloudflared tunnel run app-tunnel
Ingress rules in the config file map hostnames to local services. Tunnels can also be created and managed remotely from the Zero Trust dashboard with a token.
53. What is a Cloudflare API token and why prefer it over the global API key?
An API token has scoped permissions (for example DNS edit on one zone) and optional IP and expiry limits. The global API key has full account access. Use tokens in CI and Terraform.
54. How do you manage Cloudflare with Terraform?
Use the official cloudflare/cloudflare provider with an API token in an environment variable, and define zones, DNS records, rulesets and Zero Trust resources in code. Store state remotely and review plans in pull requests.
terraform {
required_providers {
cloudflare = {
source = "cloudflare/cloudflare"
}
}
}
provider "cloudflare" {} # reads CLOUDFLARE_API_TOKEN
Pin a provider version. Version 5 of the provider changed many resource schemas, so check the upgrade guide before moving from v4.
55. How do you import existing Cloudflare configuration into Terraform?
Use cf-terraforming, Cloudflare's tool that generates Terraform configuration and import commands from an existing account, then review and run the imports.
56. How do you deploy a Worker from CI?
Use Wrangler, Cloudflare's CLI, with a scoped API token and account ID as secrets, and run wrangler deploy in the pipeline. Cloudflare also provides a GitHub Action that wraps Wrangler.
57. What storage options do Workers have?
Workers KV (key-value, eventually consistent), Durable Objects (strongly consistent, stateful objects), R2 (S3-compatible object storage), D1 (SQLite-based database) and Queues.
58. How can a Worker add security headers?
Fetch the origin response, copy it, and set headers such as Strict-Transport-Security, Content-Security-Policy and X-Content-Type-Options before returning it. Response header transform rules can do the same without code.
59. What is Cloudflare Load Balancing?
A service that spreads traffic across origin pools with health monitors, steering policies (such as geo or latency based) and failover when an origin is unhealthy.
60. What is Logpush?
A service that pushes logs such as HTTP requests, firewall events and Zero Trust logs to destinations like S3, R2, Google Cloud Storage, Splunk or Datadog for retention and SIEM analysis.
61. How do you monitor Cloudflare security events?
Review Security Events and Security Analytics in the dashboard, set up notifications for DDoS attacks and origin errors, and push firewall logs to your SIEM through Logpush.
Senior Cloudflare interview questions
62. How would you design Cloudflare security for a public e-commerce site?
Proxy all web records, Full (strict) TLS with minimum TLS 1.2, origin locked to Cloudflare (Tunnel or mTLS plus firewall), managed WAF rulesets, rate limiting on login, search and checkout APIs, bot controls on login and cart, Page Shield for scripts, and logs to the SIEM. Review rules in Log mode before blocking.
63. How do you roll out new WAF rules without breaking production?
Deploy in log mode or with a narrow scope first, review matches in Security Events for a few days, fix false positives with targeted exceptions, then switch to block. Manage rules in Terraform so changes are reviewed and can be reverted.
64. How do you structure Cloudflare configuration as code for many zones?
Use Terraform modules for common baselines (TLS settings, WAF, rate limits), separate state per environment or zone group, account-level rulesets for shared rules, and CI that runs plan on pull requests and apply after approval.
65. How do you detect configuration drift?
Run terraform plan on a schedule and alert on changes, restrict dashboard edit rights, and review the Cloudflare audit log for manual changes.
66. How do you secure the Cloudflare account itself?
Enforce SSO and two-factor authentication, use role-based member permissions with least privilege, use scoped API tokens with expiry and IP limits, rotate tokens, and monitor the audit log.
67. How do you protect an API that mobile apps use?
Use API Shield schema validation, mTLS with client certificates on devices you control or JWT validation, rate limiting per token or IP, and bot controls tuned for app traffic. Log violations before enforcing.
68. How do you plan a migration from a VPN to Cloudflare Zero Trust?
Inventory apps, connect them with Tunnels, put Access policies in front tied to your IdP groups, roll out the WARP client with device posture checks, move users in phases, and turn off VPN access per app once usage drops to zero.
69. How does Cloudflare fit with an existing cloud WAF or load balancer?
Cloudflare usually sits in front as the first layer. The cloud load balancer stays as the origin. Avoid running the same rules twice in a way that blocks legitimate traffic, and restrict the cloud load balancer to accept only Cloudflare IPs.
70. How do you handle compliance needs for logs and data location?
Use Logpush to send logs to storage you control with your retention policy. For data locality, Cloudflare offers a Data Localization Suite on eligible plans. Confirm current capabilities with Cloudflare documentation and your contract.
71. How do you test Cloudflare changes before production?
Keep a staging zone or subdomain with the same Terraform modules, apply changes there first, run automated HTTP tests (expected status codes, headers, blocks), then promote the same code to production.
72. How do you control cost and noise from Cloudflare logs?
Push only the datasets and fields you need, filter Logpush jobs, set retention at the destination, and build SIEM alerts on aggregated security events rather than every request.
73. What would you put in a Cloudflare incident runbook?
How to check Cloudflare status and Security Events, enable Under Attack mode or a temporary challenge rule, bypass the proxy for a record in an emergency (and the risk of exposing the origin), purge cache, and who can approve each action.
74. When should you not proxy a record through Cloudflare?
Mail (MX targets), services on unsupported ports without Spectrum, and records that must return the real IP. Put such services on separate IPs from the proxied web origin so you do not leak it.
75. How do you explain the difference between Managed Challenge and Block to stakeholders?
Block always denies. Managed Challenge lets a real browser pass after a check, usually without user interaction, so it suits suspicious but possibly human traffic while Block suits clearly malicious traffic.
Scenario-based Cloudflare questions
76. Users see a 521 error.
521 means the origin refused the connection from Cloudflare. Check that the web server is running, that the origin firewall allows Cloudflare IP ranges, and that the server listens on the expected port.
77. Users see a 522 error.
522 is a connection timeout to the origin. Check origin load, network routes, firewalls dropping Cloudflare traffic, and the DNS record pointing to the correct IP.
78. Users see a 525 or 526 error after switching to Full (strict).
525 is an SSL handshake failure with the origin; 526 is an invalid origin certificate. Install a valid certificate (publicly trusted or Cloudflare Origin CA) covering the hostname, and check the origin's TLS configuration.
79. The site goes into a redirect loop after enabling HTTPS.
Usually Flexible mode combined with an origin that redirects HTTP to HTTPS. Switch to Full (strict) with an origin certificate, or stop the origin redirect.
80. A legitimate partner's API calls are being blocked.
Find their requests in Security Events, identify the rule, and add a skip rule scoped to their IPs or an authenticated header and the specific endpoint. Avoid allowlisting them from all security features.
81. A credential stuffing attack hits the login endpoint.
Add a rate limiting rule on the login path per IP, challenge low bot scores on that path if you have Bot Management, add Turnstile to the form, and monitor for distributed patterns that need lower thresholds.
82. Traffic reaches the origin even though DNS is proxied.
Attackers have found the origin IP. Lock the origin firewall to Cloudflare ranges or use Tunnel, enable Authenticated Origin Pulls, and consider changing the origin IP.
83. A Terraform apply wants to delete records you did not touch.
Someone changed DNS in the dashboard, or the state is out of date. Stop, compare with the dashboard, import or codify the manual changes, and restrict who can edit outside Terraform.
84. New deployments do not show up for users.
Content is still cached at the edge or in browsers. Purge the changed URLs or tags from the pipeline, use versioned asset file names, and check cache rules and browser TTL settings.
85. An internal app behind Access shows a login loop.
Check the IdP configuration and callback URL, cookie settings (such as SameSite for embedded apps), that the Access application domain matches the hostname, and browser blocking of third-party cookies.
86. A tunnel shows as down.
Check the cloudflared service and logs on the connector host, outbound connectivity to Cloudflare on the required ports, the tunnel token or credentials, and run more than one replica for availability.
87. A Worker started returning errors after a deploy.
Check the Worker logs with wrangler tail or the dashboard, roll back to the previous version, and review bindings and secrets the new version expects.
88. A layer 7 DDoS attack gets past default settings.
Review the HTTP DDoS managed ruleset events, raise sensitivity for the triggered rules, add rate limiting or challenge rules targeting the attack pattern (path, user agent, ASN), and use Under Attack mode briefly if needed.
89. Security asks for proof that only Cloudflare reaches the origin.
Show the origin firewall rules allowing only Cloudflare IP ranges or the Tunnel setup, Authenticated Origin Pulls configuration, and origin access logs showing no direct connections.
90. A WAF rule blocks a file upload that contains code samples.
Managed rules may flag payloads that look like injection. Add an exception for the specific managed rules on that upload endpoint, ideally only for authenticated users, rather than disabling the WAF.
91. Some countries must be blocked for legal reasons.
Create a custom rule with ip.src.country in {"XX" "YY"} and Block action, document the legal basis, and manage it in Terraform. Note that VPN users can bypass geo blocks.
92. An API token used in CI was leaked.
Revoke or roll the token immediately, check the audit log for actions it took, create a new token with minimum scope, IP restrictions and expiry, and store it in the CI secret store only.
How to prepare
Use a free Cloudflare account with a test domain: set up DNS, Full (strict) TLS with an Origin CA certificate, a custom WAF rule, a rate limit, a Tunnel to a local app with an Access policy, and manage it all in Terraform. Write down what you saw in Security Events.
The Cloudflare security and CDN questions cover beginner definitions. For related CDN platforms, see the Akamai interview questions, and for cloud security the scenario-based cloud security questions. The DevOps interview questions hub links every topic.
Our DevSecOps training covers WAF, secrets and pipeline security, in Kharadi, Pune and live online.
FAQ
What Cloudflare topics come up in DevOps security interviews?
Proxied DNS, SSL/TLS modes, WAF managed and custom rules, rate limiting, DDoS protection, bots, Zero Trust Access and Tunnel, Workers, and Terraform-based configuration with API tokens.
What is the difference between Full and Full (strict) SSL in Cloudflare?
Both encrypt traffic to the origin. Full accepts any origin certificate, including self-signed. Full (strict) requires a valid certificate, publicly trusted or Cloudflare Origin CA.
How do you stop attackers bypassing Cloudflare to reach the origin?
Allow only Cloudflare IP ranges at the origin firewall, require Authenticated Origin Pulls, or use Cloudflare Tunnel so the origin has no public inbound exposure.
What does a Cloudflare 522 error mean?
Cloudflare timed out connecting to the origin. Check origin health, firewalls dropping Cloudflare IPs and whether the DNS record points to the right server.
What is Cloudflare Tunnel used for?
It connects a service to Cloudflare through outbound-only connections from the cloudflared connector, so you can publish or protect apps without opening inbound ports.
Should I use the global API key with Terraform?
No. Use a scoped API token with only the permissions needed, optional IP limits and expiry, stored as a secret in your CI system.
How is this post different from the Cloudflare engineer questions?
This set focuses on security controls and DevOps automation. The engineer set goes deeper on edge performance and platform engineering, and the scenario set walks through incidents.
References
What's Your Reaction?
Like
0
Dislike
0
Love
0
Funny
0
Angry
0
Sad
0
Wow
0