> ## Documentation Index
> Fetch the complete documentation index at: https://docs.prowler.com/llms.txt
> Use this file to discover all available pages before exploring further.

<AgentInstructions>

## Submitting Feedback

If you encounter incorrect, outdated, or confusing documentation on this page, submit feedback:

POST https://docs.prowler.com/feedback

```json
{
  "path": "/user-guide/providers/cloudflare/getting-started-cloudflare",
  "feedback": "Description of the issue"
}
```

Only submit feedback when you have something specific and actionable to report.

</AgentInstructions>

# Getting Started With Cloudflare on Prowler

export const VersionBadge = ({version}) => {
  return <a href={`https://github.com/prowler-cloud/prowler/releases/tag/${version}`} target="_blank" rel="noopener noreferrer" className="version-badge-link">
            <span className="version-badge-container">
                <span className="version-badge">
                    <span className="version-badge-label">Added in:</span> 
                    <span className="version-badge-version">{version}</span>
                </span>
            </span>
        </a>;
};

Prowler for Cloudflare scans zones for security misconfigurations, including SSL/TLS settings, DNSSEC, HSTS, WAF rules, DNS records, and more.

## Prerequisites

Set up authentication for Cloudflare with the [Cloudflare Authentication](/user-guide/providers/cloudflare/authentication) guide before starting either path:

* Create a Cloudflare User API Token (recommended) or locate the Global API Key
* Grant the required read-only permissions (`Account Settings:Read`, `Zone:Read`, `Zone Settings:Read`, `DNS:Read`)
* Identify the Cloudflare Account ID to use as the provider identifier

<CardGroup cols={2}>
  <Card title="Prowler Cloud" icon="cloud" href="#prowler-cloud">
    Onboard Cloudflare using Prowler Cloud
  </Card>

  <Card title="Prowler CLI" icon="terminal" href="#prowler-cli">
    Onboard Cloudflare using Prowler CLI
  </Card>
</CardGroup>

## Prowler Cloud

<VersionBadge version="5.19.0" />

### Step 1: Locate the Account ID

1. Log into the [Cloudflare Dashboard](https://dash.cloudflare.com).
2. Select any zone in the target account.
3. On the zone overview page, find the **Account ID** in the right sidebar under the "API" section.

   <img src="https://mintcdn.com/prowler/B9BMXcFVIfrS7O9F/images/providers/cloudflare-account-id.png?fit=max&auto=format&n=B9BMXcFVIfrS7O9F&q=85&s=cc4d6afb6770ba2af14c7ab10d6af6fe" alt="Cloudflare Account ID" width="3346" height="1908" data-path="images/providers/cloudflare-account-id.png" />

<Note>
  The Account ID is a 32-character hexadecimal string (e.g., `372e67954025e0ba6aaa6d586b9e0b59`). This value acts as the unique identifier for the Cloudflare account in Prowler Cloud.
</Note>

### Step 2: Open Prowler Cloud

1. Go to [Prowler Cloud](https://cloud.prowler.com/) or launch [Prowler App](/user-guide/tutorials/prowler-app).

2. Navigate to "Configuration" > "Providers".

   <img src="https://mintcdn.com/prowler/zldeL4sp-3y3KD3R/images/prowler-app/cloud-providers-page.png?fit=max&auto=format&n=zldeL4sp-3y3KD3R&q=85&s=022812ec187876acb2feac32781217f3" alt="Providers Page" width="300" height="448" data-path="images/prowler-app/cloud-providers-page.png" />

3. Click "Add Provider".

   <img src="https://mintcdn.com/prowler/zldeL4sp-3y3KD3R/images/prowler-app/add-cloud-provider.png?fit=max&auto=format&n=zldeL4sp-3y3KD3R&q=85&s=ba8cc5f0f469433547b724f97672bb52" alt="Add a Provider" width="601" height="125" data-path="images/prowler-app/add-cloud-provider.png" />

4. Select "Cloudflare".

   <img src="https://mintcdn.com/prowler/bxT4LK1Wvo6Afyqd/images/providers/select-cloudflare-prowler-cloud.png?fit=max&auto=format&n=bxT4LK1Wvo6Afyqd&q=85&s=cf6fd51ad7c3044644af479a9fea8495" alt="Select Cloudflare" width="3390" height="1786" data-path="images/providers/select-cloudflare-prowler-cloud.png" />

5. Add the **Account ID** and an optional alias, then click "Next".

   <img src="https://mintcdn.com/prowler/B9BMXcFVIfrS7O9F/images/providers/cloudflare-account-id-form.png?fit=max&auto=format&n=B9BMXcFVIfrS7O9F&q=85&s=213767fe2ab8925db9e8055d6790a6c9" alt="Add Cloudflare Account ID" width="3396" height="1728" data-path="images/providers/cloudflare-account-id-form.png" />

### Step 3: Choose and Provide Authentication

After the Account ID is in place, select the authentication method that matches the Cloudflare setup:

<img src="https://mintcdn.com/prowler/B9BMXcFVIfrS7O9F/images/providers/cloudflare-auth-selection.png?fit=max&auto=format&n=B9BMXcFVIfrS7O9F&q=85&s=a79dbc2bf6b632e8ae3f81970cc43aa5" alt="Select Authentication Method" width="3384" height="1770" data-path="images/providers/cloudflare-auth-selection.png" />

#### User API Token Authentication (Recommended)

1. Select **API Token**.
2. Enter the **User API Token** created in the Cloudflare Dashboard.

   <img src="https://mintcdn.com/prowler/B9BMXcFVIfrS7O9F/images/providers/cloudflare-token-form.png?fit=max&auto=format&n=B9BMXcFVIfrS7O9F&q=85&s=70042db8077c1567423bae5ef2919569" alt="API Token Form" width="3392" height="1770" data-path="images/providers/cloudflare-token-form.png" />

Use this method for scoped, least-privilege access. Full setup steps are in the [Authentication guide](/user-guide/providers/cloudflare/authentication#api-token-recommended).

#### API Key and Email Authentication (Legacy)

1. Select **API Key + Email**.
2. Enter the **Global API Key**.
3. Enter the **email address** associated with the Cloudflare account.

   <img src="https://mintcdn.com/prowler/B9BMXcFVIfrS7O9F/images/providers/cloudflare-api-email-form.png?fit=max&auto=format&n=B9BMXcFVIfrS7O9F&q=85&s=ca7fbd4d6c0c141187d0881c2b61e007" alt="API Key and Email Form" width="3382" height="1782" data-path="images/providers/cloudflare-api-email-form.png" />

For the complete setup workflow, follow the [Authentication guide](/user-guide/providers/cloudflare/authentication#api-key-and-email-legacy).

### Step 4: Launch the Scan

1. Review the summary.
2. Click **Launch Scan** to start auditing Cloudflare.

   <img src="https://mintcdn.com/prowler/B9BMXcFVIfrS7O9F/images/providers/cloudflare-launch-scan.png?fit=max&auto=format&n=B9BMXcFVIfrS7O9F&q=85&s=413952427d4100fc66ccf03387129800" alt="Launch Scan" width="3396" height="1764" data-path="images/providers/cloudflare-launch-scan.png" />

***

## Prowler CLI

<VersionBadge version="5.17.0" />

### Step 1: Set Up Authentication

Choose the matching method from the [Cloudflare Authentication](/user-guide/providers/cloudflare/authentication) guide:

* **User API Token** (recommended): Set `CLOUDFLARE_API_TOKEN`
* **API Key + Email** (legacy): Set `CLOUDFLARE_API_KEY` and `CLOUDFLARE_API_EMAIL`

### Step 2: Run the First Scan

Run a baseline scan after credentials are configured:

```console theme={null}
prowler cloudflare
```

Prowler automatically discovers all zones accessible with the provided credentials and runs security checks against them.

### Step 3: Filter the Scan Scope (Optional)

#### Filter by Zone

To scan only specific zones, use the `-f`, `--region`, or `--filter-region` argument:

```console theme={null}
prowler cloudflare -f example.com
```

Multiple zones can be specified:

```console theme={null}
prowler cloudflare -f example.com example.org
```

Zone IDs are also supported:

```console theme={null}
prowler cloudflare -f 023e105f4ecef8ad9ca31a8372d0c353
```

#### Filter by Account

To restrict the scan to specific accounts, use the `--account-id` argument:

```console theme={null}
prowler cloudflare --account-id 372e67954025e0ba6aaa6d586b9e0b59
```

Multiple account IDs can be specified:

```console theme={null}
prowler cloudflare --account-id 372e67954025e0ba6aaa6d586b9e0b59 9a7806061c88ada191ed06f989cc3dac
```

<Note>
  If any of the provided account IDs are not accessible with the current credentials, Prowler raises an error and stops execution.
</Note>

Account and zone filtering can be combined to narrow the scan scope further:

```console theme={null}
prowler cloudflare --account-id 372e67954025e0ba6aaa6d586b9e0b59 -f example.com
```

### Step 4: Use a Custom Configuration (Optional)

Prowler uses a configuration file to customize provider behavior. The Cloudflare configuration includes:

```yaml theme={null}
cloudflare:
  # Maximum number of retries for API requests (default is 2)
  max_retries: 2
```

To use a custom configuration:

```console theme={null}
prowler cloudflare --config-file /path/to/config.yaml
```

***
