Environment Access Control
Executive Summary
The rhea family is fronted by Cloudflare Workers that route the *.pdcoe.dev hostnames to the correct EDS origins. Administrative access is expressed in each env's site.json (access.admin with role.admin / role.config_admin), and Cloudflare cache-purge is driven by a per-env Cloudflare API token stored in site.json .cdn. The routing worker performs host→origin mapping, cache control and ?ref= branch previews, and forwards the env's SITE_TOKEN so it can still reach an origin that has been locked with access.site.
Architecture
Environments, One Code Repo
The rhea family's environments consume the same code repo (abbvie-migrated/rhea) via repoless configuration. Only the branch and content source differ per env. The Cloudflare-fronted envs are prod, stage, and dev; a fourth env, sandbox-dev, exists but is not Cloudflare-fronted.
| EDS Site | Branch | Content Source | Cloudflare-fronted | Purpose |
|---|---|---|---|---|
| rhea | main | AEM Prod environment | Yes | Production |
| rhea-stage | stage | AEM Stage environment | Yes | QA / UAT |
| rhea-dev | develop | AEM Dev environment | Yes | Development |
| rhea (sandbox-dev) | develop | AEM sandbox program | No | Sandbox |
CNAME Domains, Workers and DNS
Each Cloudflare-fronted env exposes a publish (live) and a preview URL, both routed by a single per-env routing worker. There are three workers (one per env), each bound to its env's two hostnames — deployed as rhea-<env>-routing-worker.
This is the authoritative hostname-to-origin mapping for the rhea family. Every row is also the DNS record: a proxied CNAME in the Cloudflare dashboard whose name is the hostname's first label and whose target is the EDS origin.
| Worker | CNAME (DNS name) | EDS Origin (CNAME target) | Surface |
|---|---|---|---|
| rhea-prod-routing-worker | rhea.pdcoe.dev | main--rhea--aa-pdcoe.aem.live | live |
| rhea-preview.pdcoe.dev | main--rhea--aa-pdcoe.aem.page | preview | |
| rhea-stage-routing-worker | rhea-stage.pdcoe.dev | stage--rhea-stage--aa-pdcoe.aem.live | live |
| rhea-stage-preview.pdcoe.dev | stage--rhea-stage--aa-pdcoe.aem.page | preview | |
| rhea-dev-routing-worker | rhea-dev.pdcoe.dev | develop--rhea-dev--aa-pdcoe.aem.live | live |
| rhea-dev-preview.pdcoe.dev | develop--rhea-dev--aa-pdcoe.aem.page | preview |
All six records must be proxied (orange cloud) with SSL/TLS mode Full (strict) — Worker routes and Zero Trust cannot intercept traffic otherwise.
Request Flow
Traffic reaches EDS origins through Cloudflare via the routing worker.
User / Crawler
│
▼
CNAME (*.pdcoe.dev, proxied)
│
▼
Cloudflare Edge → routing worker
├── HOST_MAP: hostname → EDS origin (unknown host → 404)
├── strips/normalizes query params; blocks /drafts/ on live
├── sets x-forwarded-host, x-byo-cdn-type: cloudflare,
│ x-push-invalidation: enabled
├── optional ?ref=<branch> preview (rewrites branch, forces .aem.page)
├── cache: cacheEverything on live; cacheTtl:0 on preview/?ref=
├── authorization: token <SITE_TOKEN> (only if the secret is set)
│
▼
EDS Origin (.aem.live / .aem.page)
│ locked envs 401 anything without the token
│
│
▼
Cloudflare returns response to user
Key Principle
The worker routes and caches; it does not decide who may administer the site. That is configured server-side in site.json (access.admin), and Cloudflare cache invalidation uses a separate Cloudflare API token.
The one credential the worker does carry is the per-env SITE_TOKEN, forwarded as authorization: token <SITE_TOKEN> on origin fetches so a locked origin still answers the worker — see Layer 2 for the mechanism and the ordering constraint, and Layer 4 for invalidation.
Three distinct credentials are easy to conflate:
| Credential | Held by | Purpose |
|---|---|---|
| access.admin roles | site.json, server-side | Who may administer the site |
| SITE_TOKEN | The env's worker, as a secret | Lets the worker reach a locked origin |
| Cloudflare API token | GitHub secret, injected at deploy | Cache purge on publish, and worker deploys |
Security Layers
Layer 1: EDS Access Control (access.admin)
Access control is expressed inside each env's site.json under access.admin, not in a separate access/site.json file. The live rhea prod config uses:
"access": {
"admin": {
"requireAuth": "auto",
"role": {
"admin": ["philip.park@abbvie.com"],
"config_admin": ["35461E63622A71650A495E62@techacct.adobe.com"]
}
}
}
- role.admin — human administrators (by email) allowed to manage the site via the Admin API / Sidekick.
- role.config_admin — the AEM technical account (IMS tech-account id) that CI uses to drive deploy-cloud writes for that env.
- requireAuth: "auto" — Adobe's default admin-auth behavior.
access.admin governs who may administer the site. Locking the raw .aem.live / .aem.page origins so they cannot be reached directly is a separate control, access.site, applied per environment by the Lock EDS Site workflow in eds-site-config.
Verified 2026-09-17 — only rhea-stage is locked so far:
| Environment | Raw .aem.live / .aem.page | Custom *.pdcoe.dev |
|---|---|---|
| rhea-stage | 401 — locked | 200 |
| rhea (prod) | 200 — not yet locked | 200 |
| rhea-dev | 200 — not yet locked | 200 |
So a raw origin URL is currently still reachable on prod and dev. Treat the lock as the target state, not the current one, and check the env before assuming a preview URL is private. access.site needs allow only — a secretId is required solely so a fronting CDN can still reach the locked origin.
The table reports observed status. A lock is applied by the workflow against the Admin API, and the resulting access.site block is committed back afterwards — so an env can be enforcing 401 before its config lands in eds-site-config. Probe the URL rather than reading the repo if you need the current answer.
Layer 2: Cloudflare Routing Worker
Each Cloudflare-fronted env runs one routing worker (rhea-<env>-routing-worker), deployed from a single source file via wrangler deploy --env <name> with per-env route bindings in wrangler.toml. The worker:
- Maps the request hostname to an EDS origin via a shared HOST_MAP (unknown host → 404).
- Normalizes/strips query params (keeps format/height/optimize/width for media, limit/offset/sheet for JSON), and redirects non-443 ports to default.
- Blocks /drafts/ on live surfaces (allowed on preview).
- Sets x-forwarded-host, x-byo-cdn-type: cloudflare, and (unless disabled) x-push-invalidation: enabled.
- Forwards authorization: token <SITE_TOKEN> when that secret is set for the env (see below).
- Supports ?ref=<branch> branch previews: rewrites the branch segment, forces the .aem.page preview surface, and disables edge caching for that response.
- Caches everything on live surfaces (cacheEverything) and bypasses cache on preview / ?ref= (cacheTtl: 0, no-store, strips ETag/Last-Modified).
The worker sets authorization: token <SITE_TOKEN> on origin fetches when the per-env SITE_TOKEN secret exists, and omits the header entirely when it does not — so it is inert until a token is stored.
That is what lets an origin be locked without taking the site down: the locked origin 401s every direct request, while the worker still gets through, making the custom hostname the only way in. Ordering matters — the token must reach the worker before access.site is enabled, or the custom hostnames start returning 401 too. The Lock EDS Site workflow does both steps in that order.
Layer 3: Cloudflare Zero Trust
Non-public preview/stage/dev hostnames can be gated behind a Cloudflare Zero Trust Access Application (policy: allow *@abbvie.com via SSO or one-time PIN), while rhea.pdcoe.dev (production publish) stays public. Zero Trust is configured in the Cloudflare dashboard, outside eds-site-config.
Layer 4: CDN Push Invalidation
CDN push invalidation is configured in each env's site.json under .cdn.<env>:
"cdn": {
"live": { "host": "rhea.pdcoe.dev" },
"preview": { "host": "rhea-preview.pdcoe.dev" },
"prod": {
"type": "cloudflare",
"plan": "enterprise",
"host": "rhea.pdcoe.dev",
"zoneId": "…",
"apiToken": "${RHEA_PROD_CLOUDFLARE_API_TOKEN}"
}
}
apiToken is a Cloudflare API token placeholder resolved at deploy time from the <FAMILY>_<ENV>_CLOUDFLARE_API_TOKEN GitHub secret (via envsubst in deploy-cloud.yml). AEM uses this token to purge the Cloudflare cache on publish. The same GitHub secret is reused by deploy-worker.yml for wrangler deploy. See the eds-site-config README — Secrets for the required token scopes.
Token and Secret Management
Two credentials matter for this setup. Both are managed centrally in eds-site-config as GitHub secrets — not hand-installed into Cloudflare workers.
| Credential | Format | Used by | Purpose |
|---|---|---|---|
| Admin API key | opaque token | deploy-cloud, pull-cloud-config, regenerate-sitemap, resync-code, key-health | Authenticates CI to the AEM Admin API to write site.json / query.yaml / sitemap.yaml |
| Cloudflare API token | opaque token | deploy-cloud (embedded into site.json .cdn.<env>.apiToken), deploy-worker (wrangler deploy) | AEM cache-purge on publish + worker deploys |
Admin API key (ADMIN_API_KEY)
Stored as the ADMIN_API_KEY GitHub secret. Create/rotate it in tools.aem.live. The key-health.yml workflow warns weekly as the key nears expiry (<60 days warning, <30 days error). To rotate: create a new key, update the ADMIN_API_KEY secret, verify a deploy, then delete the old key. See the eds-site-config README for details.
Cloudflare API token (<FAMILY>_<ENV>_CLOUDFLARE_API_TOKEN)
One token per (family, env), e.g. RHEA_PROD_CLOUDFLARE_API_TOKEN. It is referenced as a placeholder in site.json (.cdn.<env>.apiToken = ${RHEA_PROD_CLOUDFLARE_API_TOKEN}) and substituted at deploy time — the value never lands in the repo. The same secret is reused by wrangler deploy. Required scopes: Zone: Cache Purge: Purge (the env's live + preview zones), Account: Workers Scripts: Edit, and Zone: Workers Routes: Edit.
Currently provisioned:
| Secret | Zones |
|---|---|
| RHEA_DEV_CLOUDFLARE_API_TOKEN | rhea-dev.pdcoe.dev, rhea-dev-preview.pdcoe.dev |
| RHEA_STAGE_CLOUDFLARE_API_TOKEN | rhea-stage.pdcoe.dev, rhea-stage-preview.pdcoe.dev |
| RHEA_PROD_CLOUDFLARE_API_TOKEN | rhea.pdcoe.dev, rhea-preview.pdcoe.dev |
To add a new Cloudflare-fronted env: mint the token in the Cloudflare dashboard, add the GitHub secret, and wire it into the env: blocks of deploy-cloud.yml, deploy-worker.yml, and pull-cloud-config.yml.
Deploying / redeploying workers
Workers are deployed by deploy-worker.yml (on push to workers/** or manual dispatch), which runs wrangler deploy --dry-run then the real deploy per [env.*] block. To redeploy manually:
gh workflow run deploy-worker.yml -f family=rhea -f worker=routing # all envs
gh workflow run deploy-worker.yml -f family=rhea -f worker=routing -f env=dev # one env
Verifying access configuration
Inspect the live access/cdn blocks for an env:
curl -s https://admin.hlx.page/config/aa-pdcoe/sites/rhea.json \
-H 'x-auth-token: <admin-auth-token>' | jq '{access, cdn}'
Sidekick Compatibility
The AEM Sidekick extension uses .aem.page URLs for preview and publish actions.
- Authenticated AEM authors (signed in via Adobe IMS) can use Sidekick normally — their auth token is passed to the Admin API.
- Sidekick preview/publish operations work regardless of whether the origin is locked, because they authenticate through the Admin API rather than through direct origin access.
- A shared .aem.page link behaves differently per environment. Where access.site is enabled it returns 401 to the recipient; where it is not, the link is publicly reachable. Verified 2026-09-17: 401 on rhea-stage, 200 on rhea and rhea-dev.
Share the *.pdcoe.dev hostname rather than a raw .aem.page URL either way — it is the supported surface, and it does not change meaning as environments are locked.
Configuration Checklist
| # | Action | Owner |
|---|---|---|
| 1 | Set access.admin (role.admin + role.config_admin) in each env's site.json | Platform team |
| 2 | Add <FAMILY>_<ENV>_CLOUDFLARE_API_TOKEN GitHub secrets and wire into workflows | Platform team |
| 3 | Create 6 DNS CNAME records (all proxied, SSL Full strict) | Infra team |
| 4 | Deploy 3 routing workers (one per env, via deploy-worker.yml) | Platform team |
| 5 | (Optional) Create Zero Trust Access Application for non-public CNAMEs | Infra team |
| 6 | Configure .cdn.<env> (Cloudflare API token, zoneId) in site.json for push invalidation | Platform team |
| 7 | Store SITE_TOKEN on the env's worker before enabling access.site | Platform team |
| 8 | Lock the env's edge URLs (Lock EDS Site workflow) and commit the resulting access.site | Platform team |
| 9 | Verify: CNAMEs return 200 via the routing worker | QA team |
| 10 | Verify: prod CNAME is public; non-public CNAMEs gated as intended | QA team |
| 11 | Verify: raw .aem.live / .aem.page return 401 for locked envs | QA team |
Crawler-facing items — robots, canonical tags, sitemap scope and auditing for hardcoded origin URLs — are on the SEO and Crawler Hygiene checklist.
References
- EDS Cloudflare Setup
- EDS Site Authentication
- EDS Go-Live Checklist
- Cloudflare Push Invalidation
- Cloudflare Zero Trust Docs
- Security Model — CSP, sanitization, and dependency security
Related Documents
- SEO and Crawler Hygiene — Keeping origin hostnames out of search indexes
- Security Model — Application-layer security controls
- Support and Incident Response — Where edge and runtime logs are routed
- DevOps Overview — Branch model and environment mapping
- Repoless Configuration — Config-as-code in eds-site-config