Skip to content
The Chat Archive
command-a-03-2025· Cohere LMArena Human Preference 140K

I have a company cloud flare tunnel. We have two factor authentication for it. I want to…

  1. User

    I have a company cloud flare tunnel. We have two factor authentication for it. I want to white list some users.

  2. Assistant

    To whitelist specific users for your Cloudflare Tunnel with two-factor authentication (2FA) enabled, you can leverage Cloudflare Access, which is a part of Cloudflare's Zero Trust platform. Cloudflare Access allows you to control who can access your applications and resources, including those exposed via Cloudflare Tunnel.

    Here’s a step-by-step guide to whitelisting specific users:


    1. Set Up Cloudflare Access

    Ensure Cloudflare Access is configured for your Cloudflare Tunnel. If it’s not already set up:

    • Log in to your Cloudflare Dashboard.
    • Go to Access (under Zero Trust).
    • Add an application by clicking Add an application.
    • Configure the application to use your Cloudflare Tunnel as the backend.

    2. Enable Two-Factor Authentication (2FA)

    If 2FA isn't already enabled:

    • In the Access section, go to Authentication.
    • Enable Require 2FA for the application or globally for your organization.
    • Supported 2FA methods include TOTP (e.g., Google Authenticator), SMS, or hardware keys.

    3. Whitelist Specific Users

    To whitelist users:

    • In the Access section, go to the application you configured for the Cloudflare Tunnel.
    • Under Rules, click Add a rule.
    • Choose Allow as the action.
    • In the Require section:
      • Select Email or Group (if using identity providers like Google Workspace, Azure AD, or Okta).
      • Enter the email addresses of the users you want to whitelist or select the appropriate group.
    • Save the rule.

    4. Configure Identity Provider (Optional)

    If you’re using an external identity provider (IdP) like Google Workspace, Azure AD, or Okta:

    • Go to Access > Identity Providers.
    • Add and configure your IdP.
    • Use groups from your IdP to manage access more efficiently.

    5. Test the Configuration

    • Share the Cloudflare Access URL with the whitelisted users.
    • Ensure they can access the application after completing 2FA.
    • Verify that non-whitelisted users are denied access.

    Additional Tips

    • Logging and Monitoring: Use Cloudflare logs to monitor access attempts and ensure only whitelisted users are accessing the resource.
    • Service Tokens: If you’re using Cloudflare Tunnel for machine-to-machine communication, consider using service tokens instead of user authentication.
    • IP Allowlisting: If needed, combine user whitelisting with IP allowlisting for additional security.

    By following these steps, you can effectively whitelist specific users for your Cloudflare Tunnel while maintaining strong security with 2FA. Let me know if you need further assistance!

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.