Skip to content
Tutorials Center
My learning

Topics

Lesson 27 of 36 ยท Zero Trust

Cloudflare Zero Trust: Replace the VPN, Protect Every App

Understand Zero Trust and Cloudflare's products for it: Access, Tunnel, Gateway, WARP and Browser Isolation. Learn identity-based policies, a setup path and a runnable policy simulator.

Traditional company security is a castle and moat. Everything inside the office network or VPN is trusted; everything outside is not. That model breaks down when staff work from home, apps live in several clouds and one stolen VPN password gives an attacker the run of the internal network.

Zero Trust replaces "trust the network" with "trust nothing, verify every request". Each attempt to reach an application is checked against who the user is, how healthy their device is and what the application allows, no matter where the request comes from. Cloudflare's Zero Trust platform (also sold as Cloudflare One) provides the building blocks.

Zero Trust is a service on Cloudflare's network, not something this site can run. Setup steps are described as dashboard paths and commands, and runnable examples are stand-ins: policy simulators and checkers in plain JavaScript.

The building blocks

Cloudflare Zero Trust parts

Access Login gate for apps
Tunnel Private link to origin
Gateway Filter DNS and web
WARP Device client

Four pieces cover most needs.

1 / 2
  • Access puts a login page in front of any web app (or SSH, RDP and TCP services). Users sign in through an identity provider, and policies decide who gets in. It is a reverse proxy with identity: covered in the next lesson.
  • Cloudflare Tunnel (cloudflared) creates an outbound-only connection from your server to Cloudflare, so the app needs no public IP and no open inbound ports.
  • Gateway filters outbound traffic from users: DNS queries, HTTP traffic and network connections, blocking malware, phishing and unwanted categories.
  • WARP is the device client that sends a person's traffic through Gateway and reports device posture (OS version, disk encryption, a running security agent).
  • Browser Isolation, CASB (checks SaaS settings), DLP (spots sensitive data leaving), Email security and Magic WAN (site-to-site networking) extend it.

How a request flows

flowchart LR
  U["Employee<br/>browser or WARP"] --> A["Cloudflare Access<br/>identity + device checks"]
  A -->|allowed| T["Cloudflare Tunnel"]
  T --> APP["Internal app<br/>no public IP"]
  A -->|denied| X["Block page"]
  U --> G["Gateway<br/>DNS and web filtering"]
  G --> NET["Internet"]

Inbound access to apps goes through Access and Tunnel; outbound browsing goes through Gateway.

Identity first

Zero Trust needs a source of identity. Under Settings, Authentication you add login methods: a corporate IdP such as Okta, Microsoft Entra ID or Google Workspace through SAML or OIDC, GitHub, or a simple one-time PIN sent by email (good for pilots and contractors). Policies then refer to people by email, email domain, IdP group, country, device posture or a combination.

Policies: default deny

Every Access policy has an action and rules:

  • Allow: let matching users in.
  • Block: always deny matching users.
  • Bypass: skip Access entirely (for public paths such as a health check).
  • Service Auth: allow machines presenting a service token instead of a person.

Rules are built from Include (at least one must match), Require (all must match) and Exclude (none may match). If nothing matches, access is denied. This default-deny behavior is the heart of the model.

Below is a runnable stand-in that evaluates policies like Access does. It is a teaching model, not Cloudflare's code.

JS Access policy simulator

Press Run (or Ctrl + Enter) to see the console output here.

No output.

Note how each person falls into a different outcome, and how "no match" is a denial.

A migration path

You do not move everything at once. A common order:

  1. Create a Zero Trust organization in the dashboard (choose a team name, which becomes <team>.cloudflareaccess.com) and add a login method.
  2. Protect one internal web app with Access and a Tunnel. Make the policy strict from the start.
  3. Roll out WARP and Gateway DNS filtering to a pilot group, then to all devices.
  4. Retire the VPN for apps already covered; add SSH and database access through Access.
  5. Log and review: Access and Gateway logs show who reached what and what was blocked.

Comparing it with a VPN

JS VPN versus Zero Trust

Press Run (or Ctrl + Enter) to see the console output here.

No output.

Costs and plans

Cloudflare offers a free Zero Trust plan for a small number of users (the number changes; check the pricing page), and paid plans per user per month with more logging, longer retention and advanced features. The ability to try Access with a few colleagues for free is a practical way to evaluate it.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What is the core idea of Zero Trust?

    Location on a network is no longer a reason to trust a request; each one is evaluated against policy.
  2. 2. Which product lets you expose an internal app without opening inbound firewall ports?

    cloudflared makes an outbound connection to Cloudflare, so the origin needs no public IP or inbound ports.
  3. 3. An Access policy has Include = email domain example.com and Require = compliant device. A user from example.com has a non-compliant device. Result?

    Include needs at least one match, Require needs all of its rules to match. A failed Require means the policy does not allow the user.
  4. 4. What happens if no policy matches a request?

    Access is default deny. A request needs a matching Allow (or Bypass or Service Auth) policy.

Summary

  • Zero Trust verifies each request by identity, device and context instead of trusting a network.
  • Cloudflare's pieces: Access (app login gate), Tunnel (outbound-only origin connection), Gateway (DNS/HTTP/network filtering), WARP (device client), plus Browser Isolation, CASB, DLP and email security.
  • Policies use Allow, Block, Bypass or Service Auth with Include, Require and Exclude rules, and default to deny.
  • Migrate gradually: one app, then WARP/Gateway, then retire the VPN.

Next: Access: Protecting Applications with Policies