Skip to content

Common policies

The following Cloudflare Access policies are commonly used to secure applications.

Refer to the Access policies page for a comprehensive list of available actions, rule types, and selectors. To learn how to create and manage policies, refer to Manage Access policies.

Allow employees by email domain

The most basic Access policy grants access to anyone who authenticates with an email address belonging to your organization. This is a good starting point when you first protect an application with Access and want to restrict it to employees using your corporate identity provider.

ActionRule typeSelectorValue
AllowIncludeEmails ending in@example.com

You can add multiple email domains to the Include rule if your organization uses more than one domain (for example, @example.com and @example.co.uk).

Allow employees from specific countries

Organizations that operate in specific regions or need to comply with data residency requirements can restrict application access to users in approved countries. This policy is useful when you want to limit where employees can connect from, while still allowing exceptions for individual users such as traveling executives.

Because Require rules use AND logic, you cannot add multiple countries directly to a single Require rule — that would require the user to be in all countries simultaneously. Instead, first create a rule group that lists the approved countries:

Rule typeSelectorValue
IncludeCountryUnited States, Portugal

Then reference the rule group in your Access policy:

ActionRule typeSelectorValue
AllowIncludeEmails ending in@example.com
RequireRule groupApproved countries
ExcludeEmailuser-1@example.com, user-2@example.com

Require device posture for sensitive applications

For applications that contain sensitive data, you can verify that users connect from managed devices that meet your organization's security baseline. The following example combines identity verification with device posture checks to ensure that the device is running a supported OS version and is connected through the Cloudflare One Client, which is enforced by the Require Gateway check.

ActionRule typeSelectorValue
AllowIncludeOkta GroupsFull-Time Employees
RequireGatewayGateway
RequireOS VersionLatest version of Windows

To reuse these device requirements across multiple applications, create a rule group called "Corporate device requirements" that contains the posture checks. You can then reference this rule group in the Require field of any policy.

Require MFA for high-security applications

For applications that handle financial data, production infrastructure, or other high-value resources, you can require that users authenticate with multi-factor authentication (MFA) in addition to their identity provider credentials. This ensures that a compromised password alone is not sufficient to gain access.

Access supports two approaches to enforcing MFA:

Identity provider-based MFA

If your identity provider reports the authentication method used during login, you can add an Authentication method selector to require a specific MFA method such as a hardware security key.

ActionRule typeSelectorValue
AllowIncludeOkta GroupsEmployees
RequireAuthentication methodSecurity key
RequireGateway(enabled)

Independent MFA

If you want to enforce MFA directly in Access without relying on your IdP, you can use independent MFA. Independent MFA is not configured through policy selectors. Instead, you first turn on independent MFA at the organization level, then enable it for specific applications or policies through a settings panel. Access will prompt users for a second factor (such as a security key, authenticator app, or biometrics) after they authenticate with your IdP.

For the full details on both approaches, refer to Enforce MFA.

Allow contractor access with email-based authentication

When you collaborate with external contractors or partners who are not part of your corporate identity provider, you can grant them access using a one-time PIN (OTP). OTP sends a short-lived code to the contractor's email address, allowing them to authenticate without needing an account in your IdP.

ActionRule typeSelectorValue
AllowIncludeEmails ending in@contractor-a.com, @contractor-b.com
RequireLogin methodsOne-time PIN

Isolate contractor access to internal applications

When contractors or other external users need to view internal applications but should not be able to download, copy, or transfer data to their unmanaged devices, you can serve the application in a remote browser. This gives external users read-only visibility into the application while keeping sensitive data from leaving your environment.

ActionRule typeSelectorValue
AllowIncludeEmails ending in@contractor-a.com, @contractor-b.com

Additional settings: Turn on Isolate application.

To restrict what users can do inside the isolated session, create a companion Gateway HTTP policy that matches traffic to the application domain. Set the action to Isolate and disable interactive controls in the policy settings.

Example Gateway HTTP policy

SelectorOperatorValueAction
Domaininwiki.example.comIsolate

Policy settings:

SettingValue
CopyDo not allow
PasteDo not allow
KeyboardDo not allow
File downloadsDo not allow
File uploadsDo not allow
PrintingDo not allow

For more information, refer to Isolate self-hosted application.

Block requests from high-risk countries

If your organization restricts access from certain countries due to internal policy or regulatory requirements such as OFAC sanctions or ITAR regulations, you can create a Block policy that denies access from those regions. Adding a corporate IP allowlist as an Exclude rule ensures that employees connecting through trusted office networks are not inadvertently blocked.

ActionRule typeSelectorValue
BlockIncludeCountryRussian Federation
ExcludeIP listCorporate IP allowlist

Block policies are best used together with Allow policies to carve out exceptions. Because Access denies all requests by default, users who do not match a Block policy are still denied unless they match an Allow policy.

Exclude high-risk users

If your organization uses Cloudflare User Risk Scores to flag users with anomalous behavior, you can exclude high-risk users from accessing sensitive applications. This is useful as a dynamic safeguard that automatically restricts access when a user's behavior triggers a risk level change, without requiring manual intervention.

ActionRule typeSelectorValue
AllowIncludeEmails ending in@example.com
ExcludeUser risk scoreHigh

In this example, any user scored as high risk is excluded even if they match the Include rule. To learn how risk scores are calculated and how to configure risk behaviors, refer to User risk score.

Authenticate a service using a service token

Automated services such as CI/CD pipelines, monitoring systems, and backend APIs need to access protected applications without an interactive login. Service Auth policies allow machine-to-machine communication by authenticating requests that present valid service token headers. For additional security, you can restrict the token to requests from specific IP ranges, ensuring the token can only be used from known infrastructure.

ActionRule typeSelectorValue
Service AuthIncludeService TokenMy service token
RequireIP ranges192.0.2.0/24

Authenticate a service using mutual TLS

For environments that require certificate-based authentication, you can use mutual TLS (mTLS) to verify that a connecting client presents a valid certificate with an expected identity. mTLS is useful for authenticating automated systems and IoT devices that do not use an identity provider, or as an additional authentication factor for team members who also log in through an IdP.

To restrict access to a specific client, use the Common Name selector to match the identity in the client certificate:

ActionRule typeSelectorValue
Service AuthIncludeCommon NameJohn Doe

To allow any client presenting a valid certificate signed by your CA, use the Valid Certificate selector. This selector is useful when you trust all certificates issued by your CA and do not need to check a specific Common Name.

ActionRule typeSelector
Service AuthIncludeValid Certificate

Require purpose justification for sensitive applications

For applications such as database admin tools, production consoles, or HR systems, you can require users to provide a written reason each time they access the application. This creates an audit trail that helps security teams understand why access was requested. The justification prompt appears after the user authenticates and before they reach the application. For more information, refer to Require purpose justification.

ActionRule typeSelectorValue
AllowIncludeOkta GroupsIT Administrators
RequireGatewayGateway
RequireOS VersionLatest version of Windows

Additional settings: Turn on Purpose justification.

You can combine purpose justification with temporary authentication to additionally require approval from a designated reviewer before granting access.

Bypass a public endpoint

Some applications have endpoints that must be publicly reachable, such as OAuth callback URLs, webhook receivers, or health check paths. You can create a Bypass policy scoped to a specific application path to disable Access enforcement for that endpoint only. For example, if your application is app.example.com, you could create a separate Access application for app.example.com/oauth/callback and apply the following Bypass policy:

ActionRule typeSelectorValue
BypassIncludeEveryoneEveryone