Skip to main content

Cloudflare

Integrate Cloudflare with Torq to detect and manage threats and enhance content delivery.

Updated this week

Cloudflare is a cloud platform that provides security, performance, and reliability services to protect from attacks and speed up content delivery.

Torq enables quick and easy integration with Cloudflare, so you can automate anything and everything within moments. Torq's public Cloudflare steps include:

  • List Firewall Rules

  • Create User Level Access Rule

  • List Zone Access Rules

  • Search Firewall Events

  • +11 more...

If you don't see a step you need, you can create your own in various ways, such as using the Send an HTTP Request step or Torq’s Step Builder, and share it across your organization.

To trigger a Torq workflow based on events sent from Cloudflare, look here.

To use Cloudflare steps in Torq workflows, look here.

Use Cloudflare to Trigger Workflows in Torq

Step One: Create a Cloudflare Trigger Integration in Torq

  1. Navigate to Integration: Go to Build > Integrations > Triggers > Cloudflare and click Add Instance.

  2. Fill in the Details:

    1. Give the integration a unique and meaningful name.

    2. Under Authentication Headers, click Add.

      1. Give the secret a name.

      2. Click Generate random secret.

      3. Copy the secret name and the secret to use in Cloudflare.

  3. Finalize: Click Add.

Step Two: Add the Webhook in Cloudflare

  1. Log In: Log in to your Cloudflare profile.

  2. Navigate to Webhooks: Go to Notifications > Destination > Webhooks and click Create.

  3. Fill in the Details:

    1. Display Name: Give the webhook a meaningful name.

    2. In the URL field, enter the URL (Torq endpoint) that you created in step one.

    3. Enter the Secret you created in step one.

  4. Finalize: Click Save and Test.

The new webhook will appear in the Webhooks card.

Now that you've successfully created a Cloudflare trigger, you can build your first Cloudlfare-initiated workflow!

In Torq, go to Build > Workflows > Create a Workflow > New Blank Workflow, and select the trigger type: Integrations > Cloudflare. Find your new trigger, and automate away!

Use Cloudflare Steps in Torq

Step One: Create a Cloudflare API Key

  1. Log In: Log in to your Cloudflare profile.

  2. Navigate to Account API: Use Account-owned tokens for service tokens that are not associated with specific users. Go to Manage Account > Account API Tokens and click Create Token.

  3. Create token: Select the appropriate token template from the list of pre-configured permissions, or create a custom token. For example, select Use template for the Read all resources template.

  4. Configure the token: Token name and permissions are prefilled depending on your chosen template.

    1. Name: Edit the token name by clicking the pencil.

    2. Permissions: Edit the permissions by modifying the permissions group (Account, User, Zone) and selecting the level of access for the token. For more information, refer to the available token permissions.

    3. Zone Resources: Select which resources the token is authorized to access.

    4. Client IP Address Filtering: Optionally limit which client IP addresses can use the Cloudflare API token.

    5. TTL: Optionally define the time the token will be active by giving a start and end date.

  5. Finalize:

    1. Select Continue to summary.

    2. Check the token summary and click Create Token.

  6. Save the token: After you create the token, it will appear in the Token field. Ensure you copy and save it. It will not be accessible once you leave this window.

Step Two: Create a Cloudflare Steps Integration in Torq

  1. Navigate to the Integration: Go to Build > Integrations > Steps > Cloudflare and click Add Instance.

  2. Fill in the Details: Give the integration a unique and meaningful name.

    1. In the API Key field, paste the API key that you copied previously in step one.

  3. Finalize: Click Add.

Cloudflare Zone and Account ID

Zone ID and Account ID are required step parameters. Find your zone and account IDs in Cloudflare. Your Account ID can also be extracted from your Cloudflare platform URL. For example, if your URL is https://dash.cloudflare.com/9f927fc789df25g087b4f93ec/home, the Account ID is 9f927fc789df25g087b4f93ec.

Templates

Now that you've added your integrations, check out these specially crafted templates by Torq's security experts. Visit Torq's template library for more.

Did this answer your question?