-
Notifications
You must be signed in to change notification settings - Fork 0
Operators Access Policy Split
github-actions[bot] edited this page Feb 28, 2026
·
9 revisions
Keep the Cloudflare Access routing split aligned with the R2-Explorer contract:
-
/api/v2/*remains Access-protected. -
/share/*remains public token download.
- Initial setup of R2-Explorer custom domains.
- Access policy drift correction.
- Recovery from unexpected public/private route exposure.
- Access to Cloudflare Access app and policy configuration.
- Worker deployed on
files.unsigned.sh(or equivalent domain). - At least one valid share token for validation.
- Valid Access service token credentials for API validation.
- Target domain, example:
files.unsigned.sh R2E_ACCESS_AUD- Access service token client ID used by smoke probes
- Existing share token ID for public path verification
-
Confirm API and share routes are mapped to the API Worker:
files.unsigned.sh/api/v2/*files.unsigned.sh/share/*preview.files.unsigned.sh/api/v2/*preview.files.unsigned.sh/share/*
-
Validate Access apps and policies:
-
/api/v2/*app has anallowpolicy and aService Authpolicy. -
/api/v2/*app has nobypasspolicy. -
/share/*app has abypasspolicy.
-
-
Run the contract checker:
export CLOUDFLARE_API_TOKEN="<api-token>"
export CLOUDFLARE_ACCOUNT_ID="<account-id>"
./scripts/ci/check-r2-access-policy.sh \
files.unsigned.sh \
"<expected-api-aud>" \
"<service-token-client-id>"- Validate protected API routes without identity:
curl -i https://files.unsigned.sh/api/v2/session/info
curl -i https://preview.files.unsigned.sh/api/v2/session/infoExpected: 302 to Access login or 401 access_required.
- Validate protected API routes with service-token headers:
curl -i \
-H "CF-Access-Client-Id: <client-id>" \
-H "CF-Access-Client-Secret: <client-secret>" \
https://files.unsigned.sh/api/v2/session/info- Validate public token route:
curl -I https://files.unsigned.sh/share/<token-id>
curl -I https://preview.files.unsigned.sh/share/<token-id>-
/api/v2/*denies unauthenticated requests (302login redirect or401 access_required). -
/api/v2/*accepts valid Access service-token credentials. -
/share/<token-id>remains reachable without API authentication and enforces token validity. -
/api/v2/share/*remains Access-protected and scope-gated when configured.
-
/share/*unexpectedly requires auth:- share Access app lost bypass policy.
-
/api/v2/*unexpectedly public:- API Access app missing protection or has bypass policy.
-
/api/v2/*returnstoken_invalid_signatureglobally:- Access JWKS/cert endpoint or verifier config outage.
-
/api/v2/*returnstoken_claim_mismatch:- Access AUD mismatch between app and Worker config.
- Restore previous known-good Worker deployment and env snapshot.
- Restore previous known-good Access app/policy configuration.
- Re-run Access contract and protected/public path checks.
- Audit recent Access app/policy changes.
- Record changed Access apps/policies and timestamps.
- Record env values before/after (
R2E_ACCESS_TEAM_DOMAIN,R2E_ACCESS_AUD,R2E_ACCESS_JWKS_URL). - Capture failing and restored request/response evidence.
Getting Started
Guides
Operator Runbooks
- Overview
- Cloudflare Access Routing Runbook
- Incident Response Runbook
- Access Service Token Rotation Runbook
- Readonly Maintenance Runbook
- Worker/Share Rollback Runbook
- Security Gates Remediation
Option Reference