How nebumohan/cloudflare-zerotrust-lab works
1. Repository role
- This repo is not an application implementation; it is a Cloudflare Zero Trust lab that documents a working security architecture and the steps/observations from a manual setup.
- The only tracked content is the README and screenshots, so the repo functions as architecture documentation and evidence capture, not source code.
2. Primary system boundary
- The architecture spans two sides: your Windows machine and Cloudflare’s managed edge/network.
- The local side contains a Windows-hosted origin service and the cloudflared connector.
- The Cloudflare side contains the enforcement points: Gateway, Access, Tunnel, and the Worker.
3. Local host component
- The Windows machine is the origin environment and runs cloudflared as a Windows service.
- This host does not expose inbound ports; its security posture is based on outbound-only connectivity to Cloudflare.
4. Secure transport boundary: Cloudflare Tunnel
- cloudflared creates the secure channel from the origin to Cloudflare.
- The tunnel is the connectivity bridge that lets Cloudflare proxy traffic to the local service without opening firewall holes.
- In the lab, the tunnel is named nebu-seclab-tunnel and is expected to remain in a healthy connected state.
5. Protected application boundary: Cloudflare Worker
- The lab’s protected application is a Cloudflare Worker deployed on Cloudflare’s edge.
- It acts as the destination behind the Zero Trust Access policy, with the endpoint production.nebu-seclab.nbmohan6.workers.dev.
- The Worker is the app surface users try to reach; it is not directly trusted by the network.
6. Identity enforcement: Cloudflare Access
- Access sits in front of the Worker and performs identity-based admission control.
- The configured policy allows access only for approved email identities, with a 24-hour session duration.
- Requests are intercepted before reaching the Worker, making identity the primary authorization boundary.
7. DNS-layer threat prevention: Cloudflare Gateway
- Gateway is configured as the DNS resolver/control point for the lab network.
- It blocks categories such as malware, phishing, command-and-control, botnet, and cryptomining at the resolution stage.
- This means malicious domains fail at DNS lookup time, before any TCP or HTTP session can be established.
8. Network location and resolver registration
- The local network is registered in Cloudflare as a Gateway location named Nebu-SecLab.
- DNS traffic is routed through Cloudflare’s resolver endpoint (172.64.36.1 and the DoH endpoint shown in the README).
- This location registration is what binds the local environment to the policy layer.
9. End-to-end request flow
- There are really two separate flows:
- DNS flow: client DNS queries go to Gateway, which either resolves or blocks based on threat category.
- Application flow: user traffic to the Worker hits Access first; if identity is valid, the request is permitted onward.
- The tunnel flow is orthogonal: it keeps the origin reachable to Cloudflare through a secure outbound connection.
10. Data and control planes
- The lab demonstrates a strong separation between:
- Control plane: Cloudflare dashboard configuration of policies, location, app, and tunnel.
- Data plane: live DNS queries, authentication attempts, and tunnel traffic.
- Most of the “logic” lives in managed Cloudflare services rather than in repository code.
11. Operational telemetry
- The README highlights three log sources that matter architecturally:
- Gateway DNS logs for blocked lookups and threat categories
- Access logs for identity checks and policy decisions
- Tunnel logs for connector health and connection events
- These are the key signals a SOC would correlate in a real deployment.
12. What the repo omits
- There is no implementation source, IaC, or automation here.
- The repository does not define the Worker code, tunnel config files, or policy-as-code; instead, it records the configured Cloudflare services and their observed state.
- For an architecture diagram, this repo should be modeled as a reference lab documenting managed Cloudflare security components around a Windows origin.
Main entry points: README.md Lab README · screenshots Screenshots
Components 15
Documentation
Repository content capturing the lab setup and evidence
- Lab README · Narrative record of the Cloudflare Zero Trust lab and screenshots
README.md - Screenshots · Captured UI and state evidence for the documented setup
screenshots
Local Host
Windows origin environment and outbound connector
- Windows Host · Local Windows machine that acts as the origin environment
- Origin Service · Protected local service reached through the tunnel
- cloudflared · Windows service that maintains the outbound tunnel connection
- User Clients · Browsers and devices issuing DNS and application requests
Cloudflare Edge
Managed Zero Trust enforcement and delivery services
- Tunnel · Cloudflare Tunnel named nebu-seclab-tunnel
- Nebu-SecLab · Registered Gateway location binding the local network to policy
- Gateway DNS · DNS resolver and threat-prevention policy layer
- Access Policy · Identity-based admission control with approved emails and 24-hour sessions
- Worker App · Protected Cloudflare Worker at production.nebu-seclab.nbmohan6.workers.dev
- DNS Logs · Records blocked lookups and threat categories from Gateway
- Access Logs · Records identity checks and policy decisions
- Tunnel Logs · Records connector health and tunnel connection events
- Cloudflare Config · Dashboard-managed setup for policies, app, location, and tunnel
Connections 18
- Lab README → Cloudflare Config: documents · README records the configured Cloudflare services and observed state
- Lab README → Screenshots: captures · Screenshots provide evidence for the lab setup
- User Clients → Nebu-SecLab: DNS routed via · Client DNS traffic is sent through the registered Gateway location
- Nebu-SecLab → Gateway DNS: enforces · Location binds network traffic to DNS threat policy
- Gateway DNS → DNS Logs: logs · Blocked or allowed lookups are recorded for review
- User Clients → Access Policy: requests · Application traffic to the Worker reaches Access first
- Access Policy → Worker App: permits · Approved identities are allowed onward to the app
- Access Policy → Access Logs: logs · Identity and policy decisions are captured
- User Clients → Tunnel: reaches via edge · User access to the protected app is delivered through Cloudflare
- cloudflared → Tunnel: maintains · Outbound connector establishes the secure tunnel to Cloudflare
- Windows Host → cloudflared: runs · cloudflared operates as a Windows service on the host
- Tunnel → Origin Service: proxies to · Cloudflare forwards traffic through the tunnel to the local service
- Origin Service → Windows Host: hosts on · The origin service resides on the Windows machine
- Tunnel → Tunnel Logs: logs · Connector health and connection events are monitored
- Cloudflare Config → Gateway DNS: configures · Dashboard sets DNS threat controls and blocked categories
- Cloudflare Config → Access Policy: configures · Dashboard sets identity policy and session duration
- Cloudflare Config → Tunnel: configures · Dashboard manages tunnel identity and state
- Cloudflare Config → Worker App: deploys · Worker is the protected application surface on Cloudflare edge