A Tunnel Creates Reachability Rather Than User Permission
Priya runs an internal admin console on a colo VM at 127.0.0.1:8443; today the only way in is a VPN everyone complains about. She wants ten operators to open admin.example.com, sign in through the company identity provider, and skip the VPN. Cloudflare Tunnel looks ideal because it avoids an inbound firewall port. She installs the connector and publishes the hostname. The console is now reachable from the Internet by anyone who knows the name; nothing in the tunnel asked who the visitor was.
That is the lesson. Cloudflare Tunnel creates reachability; Cloudflare Access creates permission. They are separate products with separate objects, and neither implies the other. A tunnel is a durable identity, identified by a UUID, that Cloudflare uses to route traffic to a private service. A connector is a running cloudflared process that holds outbound connections to Cloudflare and forwards requests to the local service. An ingress rule maps a hostname or path to a service URL; a published application is that mapping. None of those terms describes a user, a group, or a policy.
A service elevator connects a private floor to the lobby without adding a street entrance; that is the tunnel. The lobby badge reader decides who may press the button; that is Access. Neither substitutes for the other, and an unlocked side door defeats both — which is why bypass prevention matters as much as policy design.
The mental model is two planes. The reachability plane runs from DNS to Cloudflare's edge, through the tunnel identity, to a connector, to the origin. cloudflared connects outbound on port 7844; the origin needs no public IP or inbound rule. Each connector holds four connections to at least two Cloudflare data centers, and replicas share one UUID. Cloudflare documents up to 25 replicas per tunnel and routes to the closest, so one dead connector need not take the app down.
The authorization plane is Access. Access intercepts the hostname, redirects an unauthenticated browser to an identity provider, evaluates policy, and forwards allowed requests with a signed JWT in Cf-Access-Jwt-Assertion. A denied request never reaches the connector. Figure 1 shows the two planes and the bypass path that must be closed.
%%{init: {'theme':'base','themeCSS':'.edgeLabel .label text, .edgeLabel text, .edgeLabel span { fill:#132440 !important; color:#132440 !important; }','themeVariables': {'primaryColor':'#16476A','primaryTextColor':'#ffffff','primaryBorderColor':'#132440','secondaryColor':'#3B9797','secondaryTextColor':'#ffffff','secondaryBorderColor':'#132440','tertiaryColor':'#c4873b','tertiaryTextColor':'#132440','tertiaryBorderColor':'#132440','lineColor':'#5a6e82','textColor':'#132440','titleColor':'#132440','mainBkg':'#16476A','nodeBorder':'#132440','clusterBkg':'#eef3f7','clusterBorder':'#132440','edgeLabelBackground':'#ffffff','actorBkg':'#16476A','actorTextColor':'#ffffff','actorBorder':'#132440','activationBkgColor':'#3B9797','activationBorderColor':'#132440','signalColor':'#5a6e82','signalTextColor':'#132440','noteBkgColor':'#c4873b','noteTextColor':'#132440','noteBorderColor':'#132440','labelBoxBkgColor':'#a8dede','labelBoxBorderColor':'#132440','labelTextColor':'#132440','loopTextColor':'#132440','altBackground':'#f8f9fa','fontFamily':'DM Sans, sans-serif'}}}%%
flowchart TD
B[User browser] -->|HTTPS admin.example.com| E[Cloudflare edge]
E --> Q{Access app and policy?}
Q -->|No Access app| PUB[Public route: no identity check]
Q -->|Policy denies| DENY[403 or block page]
Q -->|Policy allows| JWT[Signed Access JWT added]
JWT --> TU[Tunnel route UUID.cfargotunnel.com]
TU --> C[cloudflared connector]
C --> O[Origin 127.0.0.1:8443]
PUB --> O
D[Direct origin IP or LAN path] -.->|must be closed| O
classDef primary fill:#132440,color:#ffffff,stroke:#0b172b;
classDef secondary fill:#16476A,color:#ffffff,stroke:#0f314a;
classDef ok fill:#3B9797,color:#ffffff,stroke:#2a6f6f;
classDef danger fill:#BF092F,color:#ffffff,stroke:#7a0420;
classDef warn fill:#c4873b,color:#132440,stroke:#8a5a1f;
class E,Q,PUB,C,O,D primary;
class B,JWT,TU secondary;
class DENY danger;
Figure 1 makes the ordering explicit: Access decides before the tunnel is used. It also shows the exception behind most incidents — a route with no Access application, or a second path to the origin that never touches Cloudflare. Cloudflare's quickstart warns that after you add a published route, anyone on the Internet can reach the app until you create an Access application.
Figure 2 places the trust boundary at the Cloudflare edge, not the origin. The origin trusts the local connector; the connector trusts Cloudflare because it initiated the outbound connection. Access is what turns an anonymous request into an identified one.
Create Access before the route
Order of operations is a security control. Create the Access application before the tunnel route, so a missing route becomes a closed failure rather than a public window. The reverse order exposes an unauthenticated hostname for however long the gap lasts.
Access Checks Identity and Application Policy
An Access application binds a hostname, or hostname plus path, to four things: the identity providers allowed to authenticate users, one or more policies, a session duration, and an application audience (AUD) tag. The AUD tag ties a JWT to this application rather than another application signed by the same account. Access assigns a unique AUD per application, and it does not change unless the application is deleted and recreated.
Every policy pairs an action with selectors. The action is Allow, Block, Bypass, or Service Auth. Selector logic is not uniform, and two mistakes recur.
Include is OR, Require is AND, Exclude is NOT
Every policy needs at least one Include rule. Include accepts any of its values; Require demands all of them; Exclude removes matching traffic from the policy.
Two mistakes recur: several values in one Require rule do not mean OR, and Include: Everyone is not narrowed by a later Require rule.
Evaluation order is not the visual order. Bypass and Service Auth policies run first, top to bottom; Block and Allow run next. Once a Block or Allow matches, evaluation stops, so a Block can shadow a later Allow — occasionally useful, frequently surprising.
A worked comparison shows composition, not a role model. admin.example.com is the operations console; the IdP group platform-admins has five employees, and a contractor joins temporarily for a migration.
| Policy | Scope | Include | Require | Exclude | Result |
|---|---|---|---|---|---|
| A — people | admin.example.com | IdP group platform-admins | Country: Portugal | contractor@example.net | Lisbon employees pass; the contractor fails the country rule and is excluded |
| B — machine | admin.example.com/api/health | Service token lab-health | — | — | Monitoring gets 200 without a login; a human gets a redirect, or 401 if the app asks for it |
Access stops at admission. Neither policy replaces the application's role model: Access can decide that Ana may reach the console, not that Ana may delete a tenant.
The four actions differ in enforcement and audit.
| Action | What it decides | Access logs? | Good use | Failure mode |
|---|---|---|---|---|
| Allow | Identity matches Include/Require and no Exclude | Yes | Employees, IdP groups, device posture | Include: Everyone or an open login method admits the public |
| Block | Explicitly denies matching traffic | Yes | Short-circuit a known-bad identity or country | Misordering shadows a later Allow policy |
| Bypass | Disables Access enforcement for matching traffic | No | A narrow public callback or health endpoint | A whole app or /admin path left unauthenticated and unlogged |
| Service Auth | Machine credential such as a service token or mTLS | Yes | CI jobs, monitoring, API clients | A long-lived secret leaked or scoped to an entire hostname |
Figure 3 traces the sequence, including the three outcomes operators actually see: allow, deny, and a policy pass followed by a tunnel failure.
%%{init: {'theme':'base','themeCSS':'.edgeLabel .label text, .edgeLabel text, .edgeLabel span { fill:#132440 !important; color:#132440 !important; }','themeVariables': {'primaryColor':'#16476A','primaryTextColor':'#ffffff','primaryBorderColor':'#132440','secondaryColor':'#3B9797','secondaryTextColor':'#ffffff','secondaryBorderColor':'#132440','tertiaryColor':'#c4873b','tertiaryTextColor':'#132440','tertiaryBorderColor':'#132440','lineColor':'#5a6e82','textColor':'#132440','mainBkg':'#16476A','nodeBorder':'#132440','clusterBkg':'#eef3f7','clusterBorder':'#132440','edgeLabelBackground':'#ffffff','actorBkg':'#16476A','actorTextColor':'#ffffff','actorBorder':'#132440','activationBkgColor':'#3B9797','activationBorderColor':'#132440','signalColor':'#5a6e82','signalTextColor':'#132440','noteBkgColor':'#c4873b','noteTextColor':'#132440','noteBorderColor':'#132440','labelBoxBkgColor':'#a8dede','labelBoxBorderColor':'#132440','labelTextColor':'#132440','loopTextColor':'#132440','altBackground':'#f8f9fa','fontFamily':'DM Sans, sans-serif'}}}%%
sequenceDiagram
autonumber
participant U as User browser
participant A as Cloudflare Access
participant I as Identity provider
participant P as Policy evaluation
participant C as Tunnel connector
U->>A: GET https://admin.example.com
alt No valid session
A->>I: Redirect to IdP login
I-->>A: SAML or OIDC assertion with groups
end
A->>P: Evaluate Include / Require / Exclude
alt Policy denies
P-->>A: No matching Allow
A-->>U: 403 block page
else Policy allows
P-->>A: Allow
A->>C: Forward request with Cf-Access-Jwt-Assertion
alt Connector healthy
C-->>A: Origin response
A-->>U: 200 application response
else Connector down
C-->>A: No healthy connector
A-->>U: 1033 tunnel error
end
end
The product boundary is narrower than "zero trust" marketing suggests. Access is an HTTP-aware identity proxy in front of a hostname. It authenticates users, evaluates policy at the edge, and emits a signed assertion. It does not make a public origin private, replace application authorization, or automatically cover a second hostname or direct IP path. SSH and RDP need the corresponding Access application type and a client-side path such as cloudflared access. Plan entitlement also varies: Cloudflare's SASE reference architecture states that many Cloudflare One capabilities are free without a time limit for up to 50 users, but device posture, external evaluation, and log export can depend on the plan.
Identity Providers, Sessions, and Service Tokens
Access delegates authentication to an identity provider, then checks attributes at two cadences. Email, email domain, IdP group, SAML group, OIDC claim, login method, and authentication method are checked at login. IP range, country, device posture, WARP, and Gateway are checked continuously.
A session can outlive a group change
"Access is broken" is usually stale identity. A user removed from an IdP group still carries the old group until the existing session expires. Shorten the session or revoke it before you debug the policy.
Session duration is configurable globally and per application. The global setting ranges from 15 minutes to one month and defaults to 24 hours; application sessions also default to 24 hours and can run from immediate timeout to one month. Access checks every HTTP request for a valid application token and sends the user back to the IdP when the token and global session expire. Shortening the session on an admin console is a real control, purchased with login friction.
Revocation is the compensating control. Access can revoke all sessions for one application or one user across all applications. It is not a ban: if the IdP profile is active and the policy still matches, the user can start a new session. SCIM deprovisioning can revoke the active session automatically. Google Workspace's integration documents the delay plainly: group changes can take up to 24 hours, and Cloudflare caches identity for the life of a session.
Machine access uses a separate credential. A service token is a Client ID and Secret sent as two headers, and it must match a Service Auth policy; an Allow policy alone does not authenticate a machine.
The token's lifecycle is deliberately constrained. The secret is shown once, expires, can carry up to five tags, and rotates with a grace period of one hour to 30 days. Strict authentication stops returning a login cookie, so the client keeps sending headers. Its JWT has an empty subject, which distinguishes a workload from a person.
Keep one token per workload. The account limit is 50 tokens; store each secret in a secret manager, scope it narrowly, and rotate on schedule. A token in a CI variable every repository can read is a shared password.
Admission is not authorization
The Access JWT proves that Access admitted this request to this application at this moment; it does not prove that the user still belongs in the group, that the application's own role model permits the action, or that a direct path to the origin is closed. Treat it as a signed admission ticket, not a substitute for authorization or network isolation.
Origin Validation and Bypass Prevention
A tunnel is not a firewall
Tunnel removes the need for an inbound port, not the origin's bind address. An app still listening on 0.0.0.0:443 with a public address can be reached directly, and that request never produces an Access log. The tunnel is then a convenience, not a boundary.
Check exposure from outside the host. Cloudflare's tunnel FAQ suggests probing the public address on both HTTP and HTTPS; a locked-down origin refuses the connection. Then fix it in layers: bind the app to loopback or a private interface, deny inbound traffic at the host firewall and network security group, delete stale DNS records, and look for a second hostname or wildcard route that publishes the service without Access.
Validate the assertion at the origin, not just at the edge. Access sends Cf-Access-Jwt-Assertion; browser requests also carry a CF_Authorization cookie, but the header is the recommended input because the cookie is not guaranteed to be passed.
| Check | Verify | Reject when |
|---|---|---|
| Signature | RS256, using the key selected by kid | The key is unknown or the algorithm differs |
| Issuer | iss equals the team domain | The token was minted for another team |
| Audience | aud equals this application's AUD tag | The token was minted for another application |
| Time | exp and nbf bracket the current time | The token is expired or not yet valid |
Rotation is automatic, so pin nothing. Access rotates the signing key every six weeks and keeps the previous key valid for seven days; a hard-coded certificate fails eventually.
Enforce at both layers. cloudflared can validate before proxying with the connector's access block, which stops the request at the connector. The app can also validate the header, which covers sidecars, load balancers, or local processes that reach the origin without the connector. JWKS fetching adds a network dependency and a cache to monitor; a fail-closed validator rejects traffic during an outage unless keys are cached sensibly.
Bypass is not a shortcut
Bypass removes both the identity check and the audit trail. It disables Access enforcement for matching traffic, and Cloudflare's policy docs state those requests are not logged. Reserve it for exact public endpoints such as OAuth callbacks or health checks. Using it to make an admin console "just work" is the failure case; Service Auth enforces a credential and still logs the request without a human login.
Path handling is a subtler bypass. URL normalization before ingress matching is available in 2026.10.0, off by default, and planned to become the default.
Normalization changes what the connector matches. It removes dot segments, converts backslashes, and merges repeated slashes. Without it, a path-based split between public and admin areas can disagree with the path Access evaluated. If you use path-scoped applications, enable normalization, test dotted and encoded paths with cloudflared tunnel ingress rule, and never treat a path prefix as a security boundary.
Figure 4 contrasts the two origin postures: a public listener with an Access veneer, and a loopback origin whose only path is the connector.
An illustrative scenario: a team migrates an admin panel to Tunnel but keeps the origin's public listener "for emergency SSH" and leaves a staging DNS record pointing at the same IP. Access logs look clean; a scan finds the public listener and reaches the panel without a challenge. Fix the path, not the policy: bind to loopback, deny 443 at the edge, delete the record, and validate the JWT at the app.
Design a Private Admin Application Behind Access
Design a Private Admin Application Behind Access
Status: design-only. This exercise was not executed against a hosted Cloudflare account. Expected observations are documented behavior, not measurements; record your actual results.
Prerequisites are a domain, an organization, and a controlled host. The domain must be active on Cloudflare, the Cloudflare One organization must permit tunnel and Access application creation, and you need a second network for the bypass test.
The host serves two paths. An HTTP service on 127.0.0.1:8443 exposes /health and a root page that reports whether it saw an assertion header. Use the current connector; the docs reviewed here describe version 2026.10.0.
Plan entitlement varies. The core exercise fits the 50-user allowance described for the 2026-11 free tier, but seats, log retention, and enterprise selectors vary by plan.
Publish one hostname and create one group. Route admin-lab.example.com to the loopback service, then create an IdP group lab-admins with one test user.
Create two Access applications. The console app uses a 15-minute session and an Allow policy that includes the group. The /health app uses a Service Auth policy for a token named lab-health.
- Start the service; confirm local
/healthreturns 200. - Create the Access application before the route; copy the AUD and team domain.
- Create tunnel
lab-admin, install the connector as a service, confirmHealthy; add no route. - Add a route to
http://127.0.0.1:8443; confirm the CNAME targets<UUID>.cfargotunnel.com. - Enable Protect with Access on the route, or set
originRequest.accesswithrequired: true,teamName, and the AUD tag. - No session: IdP redirect.
lab-admins: console plus a JWT header. Outside the group: block page. - Token headers to
/health: 200. No secret: redirect or 401. - From the second network, run
curl -k https://<origin-public-ip>/andnetcat -zv <origin-public-ip> 443. Expect refusal; if either succeeds, stop and fix exposure. - Stop the connector; an existing session gets 1033. Restart and confirm recovery.
- Revoke the session: reauthentication. Rotate the token with a one-hour grace; the old secret fails.
Expected observations. Each row is a separate check:
- Allowed browser: 200 only after IdP login.
- Denied browser: block page, no origin request.
- Service token: 200 without a cookie.
- No token: redirect, or 401.
- Direct origin request: refused.
- Stopped connector: 1033 after Access admits the user.
If the console loads without login, the Access app is missing, mis-scoped, or bypassed. An IdP loop points to the assertion, clock skew, or redirect URLs. A 403 after Access admits points to an aud or iss mismatch.
A service-token redirect means the wrong action. Either the policy is Allow instead of Service Auth, or the token is absent from Include. If the tunnel is healthy but requests fail with 1033, check the DNS target and the connector host. If a path-scoped admin app is reachable without login, test dotted paths with normalization enabled.
Approximate cost dimensions. Access is per-seat and plan-entitlement; Tunnel is included subject to the account's tunnel allowance. Cloudflare's October 2026 documentation states that every account includes 1,000 tunnels; the 2026-10-16 changelog lists $4.50 per additional tunnel per month. Verify current pricing at execution time.
Cleanup. Delete the route and DNS record, the tunnel, the connector service, both Access applications, and the service token; remove the lab IdP group; stop the local service. Confirm the hostname and origin no longer answer publicly.
Test Authorized, Unauthorized, and Bypass Attempts
The verification date is 2026-11-05, against Cloudflare's documentation, with a planning baseline of 2026-11-02. No hosted execution was performed, so there are no tested product versions; the criteria below are a review checklist, not measured results.
Record evidence as artifacts. Each scenario should leave something another reviewer can inspect:
- Allowed user: status plus a decoded JWT with the issuer, audience, email, and expiry claims.
- Denied user: the block page and no origin log entry.
- Machine: the same request with and without token headers.
- Bypass attempt: the external probe result plus the firewall rule.
- Connector failure: the tunnel status and the 1033 response.
An acceptance set: allowed 200 with matching aud; non-member blocked before the origin; no-session request redirected; token 200 and missing secret rejected; direct origin refused; connector stop gives 1033; foreign-aud JWT rejected; no Bypass on the admin hostname.
A short self-check:
The tunnel is Healthy, but users see 1033 after login. What does that prove? The authorization plane worked and the reachability plane did not. Access admitted the user, but Cloudflare found no healthy connector. Check cloudflared tunnel list, the DNS target, and whether the connector runs on the expected host.
A user left the IdP group yesterday but still reaches the console. Why? Identity selectors such as group membership are evaluated at login and cached for the session. Session duration, not the IdP change, governs how long the old decision survives. Revoke the session, shorten application sessions, and enable SCIM deprovisioning with revocation where supported.
Access already checked the user, so why validate aud at the origin? Access signs tokens for many applications with the same account keys. The aud claim binds a token to one application.
A token for wiki.example.com is cryptographically valid but must not be accepted by admin.example.com. Without that check, any path that lets an attacker place a valid token becomes an authentication bypass.
Limitations remain. This article did not measure Access latency, failover time, or JWKS caching; did not test a real IdP's group propagation, SCIM timing, or MFA; and did not validate CORS preflight, WebSocket upgrades, or non-HTTP apps. The 50-user free-tier statement comes from Cloudflare's SASE reference architecture, not a contract. Error codes depend on the failure: 1033 for no healthy connector, 1016 for an unresolvable DNS origin, and 502 or 504 for origin-side failures. Path normalization is off by default in 2026.10.0 with a planned change, so re-test after upgrading.
Authoritative references, reviewed 2026-11-05:
- Cloudflare One overview: https://developers.cloudflare.com/cloudflare-one/
- Access policies, actions, rule types, selectors, and evaluation order: https://developers.cloudflare.com/cloudflare-one/access-controls/policies/
- Publish a self-hosted application and validate the token: https://developers.cloudflare.com/cloudflare-one/access-controls/applications/http-apps/self-hosted-public-app/
- Validate JWTs, AUD tags, and signing-key rotation: https://developers.cloudflare.com/cloudflare-one/access-controls/applications/http-apps/authorization-cookie/validating-json/
- Application token claims: https://developers.cloudflare.com/cloudflare-one/access-controls/applications/http-apps/authorization-cookie/application-token/
- Session duration and revocation: https://developers.cloudflare.com/cloudflare-one/access-controls/access-settings/session-management/
- Service tokens, headers, tags, and rotation: https://developers.cloudflare.com/cloudflare-one/access-controls/service-credentials/service-tokens/
- Tunnel routing and DNS records: https://developers.cloudflare.com/tunnel/concepts/routing/
- Tunnel quickstart and published-route warning: https://developers.cloudflare.com/cloudflare-one/networks/connectors/cloudflare-tunnel/get-started/create-remote-tunnel/
- Tunnel replicas, firewall, and port 7844: https://developers.cloudflare.com/tunnel/configuration/
- Locally managed ingress rules and validation: https://developers.cloudflare.com/tunnel/features/locally-managed-tunnels/configuration-file/
originRequest.accessat the connector: https://developers.cloudflare.com/tunnel/reference/origin-parameters/- Tunnel FAQ and public-port check: https://developers.cloudflare.com/cloudflare-one/faq/cloudflare-tunnels-faq/
- Error 1033 and tunnel status: https://developers.cloudflare.com/support/troubleshooting/http-status-codes/cloudflare-1xxx-errors/error-1033/
- Account limits: https://developers.cloudflare.com/cloudflare-one/account-limits/
- SASE reference architecture and the 50-user statement: https://developers.cloudflare.com/reference-architecture/architectures/sase/
- Google Workspace group propagation and session caching: https://developers.cloudflare.com/cloudflare-one/integrations/identity-providers/google-workspace/
Next in the Series
In Route Devices and Private Networks Through Cloudflare One, we'll explore Connect client enrollment, Gateway policy, Mesh, and DNS.