denizbarish/claudeflare/cf-access
Claude Code and agent skill by denizbarish/claudeflare
- community
Checking that the SKILL.md file is still in the repository.
Cloudflare Access checklist for one account. Self-hosted and SaaS applications, reusable and app-scoped policies, groups, identity providers and their client secrets, service tokens and the Zero Trust organization. Load it when putting a site behind Access, auditing Access, changing a policy or identity provider, or creating a service token. Load cf-core first.
Install
npx vskill@latest install denizbarish/claudeflare/cf-accessSKILL.md
The same SKILL.md was published earlier as denizbarish/claudeflare/cf-access.
cf-access: applications, policies, identity providers, service tokens
Load cf-core first. Findings use the cf-audit finding format and severity scale. Access lives on the account: plans use "scope": "account", hold only REST ops (no project_dir needed) and use /accounts/{account_id}/access/.... The zone form /zones/{zone_id}/access/... is refused. In the MCP examples below, replace ACCOUNT_ID (32 hex characters), APP_ID, POLICY_ID, GROUP_ID, IDP_ID and TOKEN_ID (UUIDs) with real values from cf-core discovery and the reads; the guard needs literal paths.
Access needs a Zero Trust organization. The API cannot create one: if GET /accounts/{account_id}/access/organizations fails, preflight reports not_entitled and the user creates the organization in the Zero Trust dashboard (the Free plan is enough).
Read current state
| What | Source | |
|---|---|---|
Organization (auth_domain is the team domain <team>.cloudflareaccess.com, session_duration) | GET /accounts/{account_id}/access/organizations | |
Applications (type, domain, self_hosted_domains, destinations, allowed_idps, session_duration, policies, aud) | GET /accounts/{account_id}/access/apps | |
Reusable policies (decision, include, exclude, require, session_duration, app_count) | GET /accounts/{account_id}/access/policies | |
| App-scoped (legacy) policies of one app | GET /accounts/{account_id}/access/apps/{app_id}/policies | |
| Groups | GET /accounts/{account_id}/access/groups | |
Identity providers (type, config without secrets) | GET /accounts/{account_id}/access/identity_providers | |
Service tokens (name, client_id, duration, expires_at, last_seen_at) | GET /accounts/{account_id}/access/service_tokens |
Policy decisions: allow, deny, bypass (no login at all), non_identity (service tokens and other non-user rules). Rules in include are OR, rules in require are AND, exclude wins over both. A group is a named rule set that policies reference as { "group": { "id": "..." } }; a service token is referenced as { "service_token": { "token_id": "..." } }.
MCP execute:
Fallback: claudeflare get /accounts/ACCOUNT_ID/access/apps. Lists page with page and per_page; read every page before concluding that a policy, group or token is unused.
Never print an identity provider's config.client_secret or a service token's client_secret. The API returns a service token secret only once, on create; claudeflare writes it to a 0600 file and the guard blocks reads of that file.
Checks
| finding id | condition | severity | recommended | plan tier | |
|---|---|---|---|---|---|
access.policy.everyone_allow | An allow policy used by an app has an include rule { "everyone": {} } and no require. Anyone who can sign in to any configured identity provider (including one-time PIN) gets in. | high | Include an email domain, a group or an identity provider group; add require rules for sensitive apps | free | |
access.app.no_mfa | A self-hosted app protecting an admin or internal tool has no policy with a require rule for MFA (auth_method mfa) and its identity providers do not enforce MFA themselves. | medium | A require rule { "auth_method": { "auth_method": "mfa" } }, or MFA enforced in the identity provider | free | |
access.session.long | An app's session_duration (or the organization's when the app has none) is longer than 24h. A stolen cookie stays valid that long. | low | 24h or shorter; shorter for admin tools | free | |
access.service_token.expiring | A service token's expires_at is less than 30 days away (or past). Clients that send it start getting 403. | medium | Create a new token, update the clients, then delete the old one | free | |
access.group.unused | A group is referenced by no reusable policy and no app-scoped policy. | low | Delete it, or use it in a policy | free | |
access.idp.single_login_method | The organization has exactly one identity provider, or an app's allowed_idps lists only one. If that provider fails, nobody can sign in. | medium | A second login method (for example one-time PIN for a break-glass group) | free |
Notes for findings:
access.policy.everyone_allow:fixis a PUT of the policy with a narrowerinclude(Applying changes). Ask who should get in first; do not guess an email domain.access.app.no_mfa:fixadds arequirerule to the app's allow policy. Confirm the identity provider supports MFA, or users are locked out.access.session.long:fixis a PUT of the app withsession_durationchanged and every other field kept.access.service_token.expiring:fix: []until the user has a new token in place; then a delete plan for the old one.access.group.unused:fixis a DELETE of the group withconfirm_name.access.idp.single_login_method:fix: []; adding an identity provider needs credentials from the user (Applying changes).
Applying changes
Use the change protocol from cf-core: draft, claudeflare preflight --file draft.json, claudeflare plan new --file draft.json, user approval, claudeflare apply <id>. Show the plan's Lockout risk: lines and notes to the user before approval; they are part of what the user approves. Access has no PATCH: every update is a full PUT, so read the resource first and send every field that should stay.
| Op | Path (under /accounts/ACCOUNT_ID) | Rollback | |
|---|---|---|---|
| App create, update, delete | POST /access/apps, PUT or DELETE /access/apps/APP_ID (delete takes confirm_name = name) | Delete, restore without SCIM secrets (not reversible when the update sends one), re-create (new id and new AUD, no SCIM secrets) | |
| Reusable policy create, update, delete | POST /access/policies, PUT or DELETE /access/policies/POLICY_ID (confirm_name = name) | Delete, restore, re-create (new id) | |
| App-scoped policy update, delete | PUT or DELETE /access/apps/APP_ID/policies/POLICY_ID (confirm_name = name) | Restore, re-create (new id) | |
| Group create, update, delete | POST /access/groups, PUT or DELETE /access/groups/GROUP_ID (confirm_name = name) | Delete, restore, re-create (new id) | |
| Identity provider create, update, delete | POST /access/identity_providers, PUT or DELETE /access/identity_providers/IDP_ID (confirm_name = name) | Delete; restore without secrets (not reversible when the update sends a secret); not reversible | |
| Service token create, update, delete | POST /access/service_tokens, PUT or DELETE /access/service_tokens/TOKEN_ID (confirm_name = name) | Delete, restore, not reversible | |
| Organization update | PUT /access/organizations with the whole organization (name, auth_domain, ...) | Restores the previous organization |
Refused at plan new (invalid_op): a literal config.client_secret in an identity provider body (map it with secret_fields_from_env), a * path in secret_fields_from_env (name one field), client_id, client_secret or client_secret_version in a service token body (rotation is not an op), saas_app.client_secret in an app body, a self-hosted app without domain, a policy without name, a valid decision or an include array, an organization PUT without name and auth_domain. Refused at preflight (resource_in_use): a reusable policy delete while an app uses it, a group delete while a policy references it, a service token delete while a policy includes it, unless an earlier op in the same plan removes the use. An app-scoped policy op and an update or delete of the same app never share a plan (plan_conflict). Not available as ops: revoke_tokens, revoke_user, service token refresh and rotate, Dashboard SSO.
Put a site behind Access (the usual request)
The site must already be proxied through Cloudflare. One account plan with a reusable policy and the app that uses it, or the app alone when a fitting policy exists:
A new reusable policy goes in its own earlier plan (its id is known only after apply):
Add an identity provider
The client secret comes from the user's environment, never from the chat or the plan file. Ask the user to export it in the shell that runs claudeflare apply (for example export GITHUB_CLIENT_SECRET=... in their own terminal), then:
Apply reads the variable, sends it and stores it nowhere; results show [redacted]. An update that sends a new secret is not reversible. An update without secret_fields_from_env leaves the secret out of the body.
Create a service token
The secret is shown only once. Apply writes { "client_id", "client_secret" } to .claudeflare/secrets/<plan id>-<op index>.json (mode 0600, ignored by git) and prints only the path; results hold [redacted]. Tell the user to move the values into their secret store in their own terminal; never open, print or copy the file. Then reference the token in a non_identity policy: { "service_token": { "token_id": "<id>" } }.
Lockout risk lines
These never refuse a plan; they are shown at plan new and checked again at apply (a new line stops apply with risk_changed):
- An app loses its last
allowpolicy with a non-emptyinclude, or gets adenypolicy whoseincludeis empty oreveryone. - An app domain covers an identity provider's login host or the team domain.
- Deleting or changing the only identity provider allowed by an app (
allowed_idps) or the organization's only login method; an app limited to identity providers that are not configured. - Removing the allow policy of the Zero Trust dashboard app (
dash_sso, Dashboard SSO).
When one appears, keep this terminal open: the API token still works when the dashboard login does not, so claudeflare rollback can restore access.
Verification
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/cf-access/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/denizbarish/claudeflare/cf-access)