Who Owns an Account and a Zone
Imagine leasing a floor in an office building. The lease, deposit, staff directory, and utility account belong to the company; each suite has its own locks and floor plan. A contractor can hold one suite's key without becoming a director. Hand over the master key and the corporate card, and the blast radius is the whole floor.
Cloudflare draws the same separation. An account is the ownership boundary: it contains users and zones and owns billing, members, audit logs, and account-level products such as Workers, Pages, R2, KV, D1, and Queues. A zone is the configuration boundary for a domain added to Cloudflare: DNS records, proxy status, cache rules, WAF, TLS mode, analytics, and the zone plan.
One apex domain, many names. Teams usually add the apex such as lab-example.com as the zone; www, api, and staging are records inside it, not separate zones. Subdomain zones exist, but they are a deliberate setup documented for Enterprise accounts.
The API and the Terraform provider encode the same split. Account-scoped calls carry an account ID; zone-scoped calls carry a zone ID.
Scope is easiest to see when a zone is deleted. The split is a good default, not an absolute rule.
| Object | Boundary | If the zone is deleted | Caveat |
|---|---|---|---|
| DNS record, proxy status, cache rule, WAF rule, TLS mode, zone plan | Zone | Removed with the zone | Shapes traffic for that hostname only |
| Worker script, Pages project, R2 bucket, KV namespace, D1 database | Account | Remains; code and storage survive | A Worker route inside the zone disappears with it |
| Member, role policy, API token, audit log, billing | Account | Remains | Identity and ownership do not belong to a domain |
| Worker route, Load Balancing origin | Mixed | Route is removed; the script and pool remain | Account-scoped object pointing at a zone resource |
%%{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
H[Human identity] -->|member policy| A[Cloudflare account]
M[Account API token] -->|permission groups and resource scope| A
A --> R[Account-scoped resources]
R --> W[Workers, Pages, R2, KV, D1]
A --> Z1[Zone: lab-example.com]
A --> Z2[Zone: lab-example.net]
Z1 --> C1[DNS, proxy, cache, WAF, TLS]
Z2 --> C2[DNS, proxy, cache, WAF, TLS]
C1 --> E[Edge behavior for that hostname]
C2 --> E
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 H,A,M,R,Z1,Z2,E primary;
class W secondary;
class C1,C2 ok;
Figure 1 shows ownership rather than a request path. Identities enter at the account layer; the account owns shared resources and zones; each zone produces edge behavior only for its own hostnames.
Figure 2 makes the nesting explicit. The token sits outside both zones because it is an account-level identity whose policy names a zone resource. That is why a token can be active and still denied on a zone it was never granted, and why deleting a zone does not revoke the token.
Two questions before any change
Who may act? Membership or a token answers that at the account layer. What will happen to traffic for this name? Zone configuration answers that. A 403 usually answers the first; a 522 or a stale cache response answers the second. Keeping them separate prevents the common remediation mistake: widening permissions to fix a configuration problem.
Human Membership and Machine Credentials
Two tickets can read almost the same: "Let Priya edit DNS for staging" and "Let the deploy pipeline edit DNS for staging." The first is a person with judgment and an occasional need. The second is a workload with a secret and a 2 a.m. schedule.
Cloudflare models people through account membership. Members hold policies; a policy combines an actor, roles, and one scope. Roles describe actions; scopes describe where they apply: the whole account, specific domains, a domain group, or a specific resource. Account-scoped roles reach every domain, domain-scoped roles reach one domain, and resource-scoped roles reach one resource. That last model is in Beta with a limited set of Access, Tunnel, and Mesh resources. A policy has one scope, but a member can hold several policies.
For automation, a user API token acts for a person and inherits a subset of their permissions. An account API token acts as an account-owned service principal and survives the creator's departure. New tokens use scannable prefixes, cfut_ and cfat_, so secret scanners can recognize a leak.
A valid token can still be refused
Account API tokens are generally available, but not every product accepts them. The compatibility matrix marks Page Rules, Registrar, Turnstile, Super Bot Fight Mode, Zero Trust Client Platform, and Intel Data Platform as unsupported. That is a product boundary, not a plan boundary: a well-scoped token can still fail because the endpoint wants a different principal.
Creation is constrained too. Super Administrator or API Token Provisioning is required, members can grant only a subset of their own permissions, and non-Super-Admins see only tokens they created.
| Decision | Human member | Machine credential |
|---|---|---|
| Identity anchor | Verified email plus MFA, tied to a person | Secret string held by a workload or secret manager |
| Who can create it | Super Administrator with a verified email | Super Administrator or API Token Provisioning |
| How scope is expressed | Policy with one role set and one scope: account, domain, group, or resource | Permission groups under Zone, Account, or User, plus named resource IDs |
| Default lifetime | Until the member or policy is removed | No expiry unless a TTL is set; rotate deliberately |
| How access ends | Remove the member or the policy | Delete or roll the token, or let the TTL expire |
| Audit signature | actor_type="user" with the member's identity | actor_type="account" with the token ID |
| Best fit | Interactive work, judgment calls, incident response | CI/CD, monitoring, SIEM export, repeatable integrations |
| Main risk | Shared logins destroy attribution | Over-broad permissions and secret sprawl |
The last two rows explain why both models exist. A person who leaves should lose access by removing a membership, not by hunting for an unlabeled token. A pipeline should not depend on a person's session, password reset, or MFA prompt.
%%{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'}}}%%
flowchart TD
A[Need to change DNS for staging] --> B{Who is acting?}
B -->|Person, occasional| C[Invite named member]
C --> D[Policy: Domain DNS
scope: staging zone]
B -->|Workload, recurring| E[Create account API token]
E --> F[Permission: Zone DNS Edit
resource: staging zone]
F --> G[Set TTL and optional IP filter]
D --> H[Send request]
G --> H
H --> I{Scope matches target?}
I -->|Yes| J[Change applied and audited]
I -->|No| K[403 authorization error]
K --> L[Fix the scope or target]
L --> H
J --> M{Still needed?}
M -->|No| N[Revoke token or remove member]
M -->|Yes| O[Keep and review at next rotation]
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 D,E,F,N primary;
class A,B,C,G,H,I,J,L,M,O secondary;
class K danger;
Figure 3 draws the failure branch deliberately. A denied request is evidence that the boundary worked. Compare the request's zone ID with the token's resource list; do not grant All zones until the error disappears.
The scope lives in the token policy, not in the request.
Least privilege differs by principal. For a person: a named account rather than a shared inbox, MFA, a domain-scoped role on the smallest zone set, and no Super Administrator unless billing or membership is part of the job. For a workload: one token per workload, permission groups that match the calls actually made, explicit resource IDs, a TTL, and an IP filter only when egress is stable.
IP allowlists fail on rotating egress. Client IP filtering is enforced on API calls, with a documented exception for token verification, but it cannot know why a hosted runner's address changed. A strict allowlist on rotating CI egress produces outages that look like permission bugs. A short TTL, a secret manager, and a named rotation owner are more durable.
Website Plans Versus Developer Usage
"Plan" is not one thing. A zone plan — Free, Pro, Business, or Enterprise — is per domain, flat-rate and billed in advance, and gates zone features such as WAF rule counts, bot modes, page-rule allowances, and request-body size. Only a Super Administrator can change it, and a downgrade lands at the end of the billing period.
Three purchase types share an invoice but not a ledger.
| Purchase | Boundary | Billing | What it gates |
|---|---|---|---|
| Zone plan: Free, Pro, Business, Enterprise | One domain | Flat, in advance | Zone features such as WAF rule count, bot modes, Page Rules, request-body size |
| Account subscription or add-on | Account | Flat, in advance | Load Balancing, Argo, Cache Reserve, Images, Stream |
| Usage-based developer product | Account | Metered, in arrears | Workers, R2, D1, Queues, Workers AI; some have free tiers and their own product plan |
Request-body size follows the zone plan, not the Workers plan. An incoming Worker request depends on the zone plan: a Workers Paid account on a Free zone still returns 413 above 100 MB, while Business raises the ceiling to 200 MB.
Workers quotas follow the Workers plan. Workers Free allows 100,000 requests per day and returns Error 1027 above it; the route's fail-open or fail-closed setting decides whether traffic bypasses the Worker or sees the error. Workers Paid has a $5 monthly minimum, includes 10 million requests per month, and charges $0.30 per additional million at verification time. Static asset requests are free and unlimited.
Two ledgers, two plans
A zone plan and a Workers plan are separate purchases. Upgrading example.com from Pro to Business does not raise Worker request or CPU quotas, and a Workers Paid subscription does not unlock higher-tier WAF or bot features. Budget and permission reviews must look at both ledgers, or one of them will be wrong.
A cost sanity check helps before buying anything. Is the limit attached to a domain or an account? Is the charge flat or metered? Who may change it: any administrator, or only a Super Administrator? What happens at the limit: a rejection such as Error 1027, degraded behavior, or an overage charge? Write the answers next to the resource. "We are on Business" and "we have Workers Paid" are not interchangeable sentences.
A Small Lab Account With Clear Boundaries
One key for everything
This composite scenario is assembled from a common pattern, not a report from one company. A two-person consultancy runs client work from one account, acme-labs, with acme-labs.com for production and acme-labs.net for staging. Both people use a shared ops@ login, and one all-zones, all-permissions, non-expiring token sits in CI.
A release job reads a zone ID from a production runbook, updates the wrong environment's DNS record, and succeeds: valid token, valid zone ID, wrong target. The audit log shows only the shared login, so nobody can tell who or what acted. Rotating the token would break every pipeline at once.
The missing control was not a permission but a boundary: a staging-scoped token plus a name check before the write.
The redesign keeps the same products with different boundaries. Production and sandbox work live in separate accounts when blast radius justifies it; otherwise they share one account with tightly scoped policies. The domains stay separate zones.
A subdomain is a name, not a boundary
A domain-scoped role on acme-labs.com also reaches staging.acme-labs.com. Subdomains are names, not security boundaries. Separate apex domains, separate accounts, or an Enterprise subdomain zone are the ways to isolate.
The owner keeps Super Administrator with a hardware key. The developer gets Domain DNS on staging and read-only production. CI gets Zone DNS Edit on staging with a seven-day TTL and a rotation reminder. Monitoring gets read-only zone analytics. No shared mailbox survives.
A valid credential is not a correct target
Account and zone IDs are different identifiers in different paths. An ID from another account fails loudly with a 403 or 404. An ID that is valid but belongs to the wrong environment returns a success status and changes the wrong record — the dangerous case. A name assertion before the write catches it; status codes only catch the first.
Zone holds add a documented edge case. They are Enterprise-only and on by default there. A hold prevents another team from adding an active zone to a different account, and it also blocks a Pages custom domain under the held name even inside the same account, until the hold is temporarily released.
Separate accounts isolate cleanly but duplicate members, tokens, and resources; Workers and KV do not span accounts. One account is simpler but concentrates risk in Super Administrator. Short TTLs contain leaks but add rotation work. IP allowlists are strong with fixed egress and brittle with hosted runners. Choose the combination that matches the value of what you protect, and write the choice down.
Figure 4 contrasts the two states and keeps the failure path visible. The dangerous case is the bottom line: a valid credential pointed at a valid but wrong target. Permissions cannot catch that; only an environment check can.
Design a Least-Privilege Lab Account
Design a Least-Privilege Lab Account
Status: design-only. These steps were not executed against a hosted account while writing this article. Expected observations are documented behavior, not measured results. Treat them as assertions to verify, and record what you actually see.
Prerequisites. A Cloudflare account where you can act as Super Administrator, one controlled domain or non-production zone, a second email for the member test, an authenticator app, curl, and a secret store. The Free zone plan is sufficient. Workers Paid is optional and has a $5 USD monthly minimum at verification time. Zone holds and resource-scoped roles are Enterprise or Beta respectively; mark those checks unavailable if you lack them.
- Baseline. Record the account ID, both zone IDs, each zone plan, and current billable usage. Identify which zone is production.
- Invite. Invite the test member with scope A specific domain set to staging and role Domain DNS. Add no account-scoped role.
- Test the member. In a private window, accept the invite and try to edit DNS in staging, then in the production-like zone. Record both outcomes.
- Issue the token. Create an account token named
lab-ci-dns-stagingwithZone · DNS · Edit, resource set to staging only, and a seven-day TTL. Add an IP filter only if egress is stable. - Verify it. Call
GET /accounts/{account_id}/tokens/verify. Record the verification status,not_before, andexpires_on. - Prove the scope. List DNS records for staging, then for the other zone. Expect success, then a denial.
- Confirm attribution. Find both actions in Audit Logs and confirm the actor types differ.
- Check billing and clean up. Check Billing > Billable Usage for unexpected metered products, then delete the token, remove the member, delete test records, and delete any Worker, D1 database, or R2 bucket you created.
Expected observations. Verification returns active with the expiry you set. The allowed DNS call succeeds. The other zone returns 403, not a partial success. The member appears as a user actor; the token appears as an account actor with a token ID. Billing shows no charge for API calls, only products you created. If any result differs, record it before adjusting anything.
Failure checks. A revoked or expired token should fail verification or the call, not silently fall back. A member without Super Administrator should not be able to invite anyone. A resource-scoped role should not appear outside the documented Beta set. An IP-filter mismatch should block the API call while verification still responds, which is the documented exception. A token aimed at the wrong zone should fail even though the token is valid.
Cost dimensions. Free zone plan: $0. Membership, token, DNS, and audit-log API calls are not separately billed. Workers Paid, if used, is a $5 monthly minimum at verification time plus usage above the included allotments. R2, D1, and Queues stay at $0 only inside their free tiers and only if you delete what you create. No spend was measured.
Cleanup and evidence. Delete the token and remove the member before deleting zones. Keep a JSON excerpt of the verification response, the 403, and the audit entry. Audit logs are retained for 18 months and are not removed by deleting the resources they describe.
Add the guard the scenario was missing. With jq available, resolve the zone ID to a name and refuse the write when it does not match the intended environment.
Check Token Scope and Record Potential Charges
Use the lab as a gate, not a vibe check. This evidence is enough to say the boundary is real.
- Pass: the token verifies as
activewith the intended expiry, and its resource list names exactly one zone. - Pass: the allowed call succeeds while the same token against another zone returns
403. - Pass: the audit log distinguishes a user actor from an account actor and records the token ID.
- Pass: billable usage shows no metered product you did not intentionally create.
- Fail: the token works against every zone when it was meant for one.
- Fail: a member can see or change a zone outside their policy.
- Fail: the audit trail shows a shared login where two people acted.
- Fail: a paid product appears without a named owner and a documented reason.
Self-check. Answer before reading the explanations.
- A member has a domain-scoped DNS role on
lab-example.com. Can they editstaging.lab-example.com? Yes. The subdomain is a record inside the same zone, so the scope covers it. Use a separate apex zone, a separate account, or an Enterprise subdomain zone to isolate. - Does a Business zone plan include Workers Paid? No. The zone plan gates zone features. Workers Paid is an account-level product plan with its own minimum and usage allotments; the pricing documentation states it is separate from the Free, Pro, and Business plans.
- A CI job needs DNS edit on one zone and read access to one R2 bucket. Should you use an all-zones token? No. Put two permission entries in one token, or use two tokens:
Zone DNS Editscoped to the zone and the narrowest account-level R2 read permission. Scope each permission to its resource instead of widening one to compensate for another.
Unresolved limitations. No hosted lab was executed, so there are no measured latencies, error bodies, or invoice totals. Resource-scoped member roles are in Beta and cover a limited set of resources. Account API token coverage has documented gaps, and the compatibility matrix can change. Pricing and free-tier allowances change; figures here were checked on 2026-11-04 and should be rechecked before budgeting. IP filtering was not tested against a hosted CI provider. Enterprise-only controls were assessed from documentation only. The article asserts HTTP status classes, not specific error codes beyond the documented Error 1027.
Verification note. Documentation was checked on 2026-11-04. Pages consulted carried last-updated dates between 2026-04-20 and 2026-10-30. No hosted validation was performed, and no CLI or API client versions were exercised.
Authoritative references.
- Cloudflare, "Accounts, zones, and profiles" — https://developers.cloudflare.com/fundamentals/concepts/accounts-and-zones/
- Cloudflare, "Roles" — https://developers.cloudflare.com/fundamentals/manage-members/roles/
- Cloudflare, "Role scopes" — https://developers.cloudflare.com/fundamentals/manage-members/scope/
- Cloudflare, "Manage account members" — https://developers.cloudflare.com/fundamentals/manage-members/manage/
- Cloudflare, "Account API tokens" — https://developers.cloudflare.com/fundamentals/api/get-started/account-owned-tokens/
- Cloudflare, "Create API token" — https://developers.cloudflare.com/fundamentals/api/get-started/create-token/
- Cloudflare, "API token permissions" — https://developers.cloudflare.com/fundamentals/api/reference/permissions/
- Cloudflare, "Restrict tokens" — https://developers.cloudflare.com/fundamentals/api/how-to/restrict-tokens/
- Cloudflare, "Verify Token" — https://developers.cloudflare.com/api/resources/accounts/subresources/tokens/methods/verify/
- Cloudflare, "How Cloudflare billing works" — https://developers.cloudflare.com/billing/understand/how-billing-works/
- Cloudflare, "Change domain plan" — https://developers.cloudflare.com/billing/manage/change-plan/
- Cloudflare, "Workers pricing" — https://developers.cloudflare.com/workers/platform/pricing/
- Cloudflare, "Workers limits" — https://developers.cloudflare.com/workers/platform/limits/
- Cloudflare, "Audit Logs" — https://developers.cloudflare.com/fundamentals/account/account-security/audit-logs/
- Cloudflare, "Zone holds" — https://developers.cloudflare.com/fundamentals/account/account-security/zone-holds/
Next in the Series
In Bring a Domain to Cloudflare Without Losing Your Bearings, we'll explore Plan a reversible DNS onboarding and measure the result.