# Cloudflare

![cloudflare.png](https://assets.relyanceuat.xyz/images/docs/34563030613645/34563030609549.png)
Cloudflare is company that delivers services like a CDN, DNS, DDoS protection, security, and many other additional services to make websites faster and more secure. It offers an integrated security and performance suite for web-based applications.

In order to integrate Cloudflare with Relyance AI you will need an **API Key** and **Email**.

### Which method to choose

| Method | Credential | Scope of access |
| --- | --- | --- |
| **API Token** (recommended) | a scoped token | only what the token's template allows — use **Read All Resources** |
| Custom | email + **Global API Key** | your entire Cloudflare account, every zone and every permission |

**Use an API Token.** A Global API Key cannot be scoped down and cannot be
revoked without affecting everything else that uses it; a token can be revoked on
its own and carries only the read permissions Relyance needs.

#### In Cloudflare:

1. Login to your Cloudflare account. The **Email** address you provided to sign in with will also be used in Relyance AI.
2. Go to the **API Tokens** page in your profile: [https://dash.cloudflare.com/profile/api-tokens](https://dash.cloudflare.com/profile/api-tokens)
3. There are two options here - you can use a **Global API Key** or **API Token**. **To use a Global API Key:** **To use an API Token:**
    1. Under **API Keys** section click the **View** button beside **Global API Key**.
    2. Provide your password if need be.
    3. Copy the **API key** to be used in Relyance AI.
    1. Under **API Tokens** section click the Create Token button.
    2. Use the **Read All Resources** template for this token.
    3. Click **Continue to summary** at the bottom of the permission list.
    4. Click **Create Token**.
    5. Copy the **API Token** to be used in Relyance AI.

    ![Cloudflare-3.png](https://assets.relyanceuat.xyz/images/docs/34563030613645/34563000988813.png)

#### In the Relyance AI application:

1. Login to your Relyance AI account.
2. Navigate to the **Settings** (bottom-left corner).
3. Select **Integrations**.
4. Search and locate the **Cloudflare** integration card and click on it.
5. Click on the **Add Connection** button on the top right.
6. Provide a meaningful name for the integration and click on the **Add** button.
7. In the **Overview** section, select the integration features you wish to enable for the integration, review the **Scope and Permission**, and **Endpoint** details and click on **Continue**. For more details, see [Integration Features](/docs/introduction-to-relyance-ai/integration-features/).
8. In the **Connection** section, provide the appropriate values and click on **Continue**,
    - **Connection Name**: This property allows you to update the integration specified in Step 6. If you have multiple integrations for the same vendor, you may want to assign distinct names to each. This helps streamline filtering by **Discovery Source** across the **Inventory**, **Visual** **Maps**, **Assets**, and **Data Flow Analysis** pages.
    - **Rescan Frequency**: This property allows you to configure how often Relyance executes scans against this Vendor connection.
    - **Business Atlas Associations** (required): the business entities or products that newly discovered third parties, services and assets from this integration are attributed to. Choose at least one from the **Select Associations** dropdown — the wizard will not advance past this step without one. For more details, see [Business Atlas](/docs/other-settings/business-atlas-overview/).
9. In the **Authentication** section, Please choose the authentication method **as below.** Please choose the authentication method as **Custom** and fill the details retrieved from the **In Cloudflare** section and click on **Continue.** **Please choose the authentication method as** API Token **and fill the details retrieved from the** In Cloudflare **section and click on** Continue.
10. In the Data Inspection section, provide the appropriate values and click on **Continue**,
    - **Minimum Confidence Level:** This property adjusts the sensitivity of the Data Inspection feature. Lower likelihoods (e.g.,Very Low) offer more coverage but may produce false positives, while higher sensitivity (e.g., very High) provides greater accuracy but less coverage.
11. Review the configuration summary from the **Completion** section and click on **Finish.**
12. Confirm the integration Status reflects **Connected.**

![Screenshot 2025-11-04 122920.png](https://assets.relyanceuat.xyz/images/docs/34563030613645/40850861271693.png)

![Screenshot](https://assets.relyanceuat.xyz/images/docs/34563030613645/34563030610829.png)

![Screenshot 2025-11-03 152534.png](https://assets.relyanceuat.xyz/images/docs/34563030613645/40818563109517.png)

![Screenshot 2025-11-03 152547.png](https://assets.relyanceuat.xyz/images/docs/34563030613645/40818563109901.png)

![Screenshot](https://assets.relyanceuat.xyz/images/docs/34563030613645/34563030611853.png)

![Screenshot](https://assets.relyanceuat.xyz/images/docs/34563030613645/34563000993165.png)

<!-- terraform-examples:begin (generated from the integration catalog; do not hand-edit) -->

## Manage this integration with Terraform

Connections for this integration can be managed as code with the [Relyance Terraform provider](https://registry.terraform.io/providers/Relyance/relyance/latest). Non-secret fields go in `auth.params`; secret fields go in `auth.secrets_wo`, which is write-only — never stored in Terraform state. Rotate secrets by bumping `auth.secrets_wo_version`.

### API key

```hcl
resource "relyance_integration_connection" "cloudflare_0" {
  vendor = "cloudflare"
  name   = "<your connection name>"

  auth = {
    method = "api-key"
    params = {
      email = "<email>"
    }
    # Secret fields are write-only: sent to Relyance, never stored in state.
    secrets_wo = {
      api_key = var.cloudflare_api_key
    }
    secrets_wo_version = 1
  }

  scans = { "data-inspection" = { enabled = true } }
}
```

### API token

```hcl
resource "relyance_integration_connection" "cloudflare_1" {
  vendor = "cloudflare"
  name   = "<your connection name>"

  auth = {
    method = "api-token"
    # Secret fields are write-only: sent to Relyance, never stored in state.
    secrets_wo = {
      api_token = var.cloudflare_api_token
    }
    secrets_wo_version = 1
  }

  scans = { "data-inspection" = { enabled = true } }
}
```

<!-- terraform-examples:end -->
