INTEGRITY Cloudflare Docs

Secrets Store access control

Secrets Store allows security administrators to have more control by implementing role-based access. For details about roles at Cloudflare, refer to Fundamentals.

Access to a secret is controlled by two independent checks that must both pass:

  1. Authorization — the caller must have permission to perform the action. The permission comes from either a user role (when the dashboard authenticates the request) or an API token permission (when the request is made with an API token). A given request is evaluated against one or the other, not both.
  2. Secret scope — the scope list on the secret must include the consuming service.

For example, deploying a Worker that binds a secret requires a role or API token that can bind secrets, and a secret whose scope includes workers.

Relevant roles

Refer to the list below for default role definitions.

Super Administrator

Secrets Store Admin

Secrets Store Deployer

Secrets Store Reporter

API token permissions

API tokens have two Secrets Store permission levels: Read and Edit. The permission you need depends on what the token is doing, not on whether you intend to modify the secret itself.

Secret scopes

Each secret has a list of scopes that determine which Cloudflare services are allowed to consume it. Scopes are set when a secret is created, and can be updated later by editing the secret.

The currently supported scopes are:

A request to bind or associate a secret with a service will be rejected if that service is not in the scope list, even if the caller has the correct role or API token permission. Deploying a Worker with a Secrets Store binding therefore requires both:

You can set scopes when creating a secret using the dashboard, the API (scopes field), or Wrangler (--scopes flag).