# AQUILA - Cloudflare Integration

#### **<span style="color: rgb(53, 152, 219);">Introduction</span>**

<span style="color: rgb(0, 0, 0);">Cloudflare logs provide detailed insights into client connections, request paths through the Cloudflare network, and origin server responses. These logs help track activity, identify issues, and support security and performance analysis.</span>

---

#### <span style="color: rgb(53, 152, 219);">**Authentication Options**</span>

<span style="color: rgb(0, 0, 0);">You can configure log retrieval using the following authentication methods:</span>

1. <span style="color: rgb(0, 0, 0);">**Auth Email**</span>
2. <span style="color: rgb(0, 0, 0);">**API Token**</span>
3. <span style="color: rgb(0, 0, 0);">**Account ID and Zone ID**</span>

<span style="color: rgb(0, 0, 0);">For detailed information on authentication, refer to the<span style="color: rgb(132, 63, 161);"> **[Cloudflare API documentation](https://developers.cloudflare.com/api/)**</span>.</span>

---

#### <span style="color: rgb(53, 152, 219);">**1. Configure Using Auth Email and Auth Key**</span>

<span style="color: rgb(0, 0, 0);">To set up using this method, you need:</span>

- <span style="color: rgb(0, 0, 0);">**Auth Email**: The email address associated with your Cloudflare account.</span>
- <span style="color: rgb(0, 0, 0);">**Auth Key**: Your global API key, available on the <a class="cursor-pointer" data-end="1015" data-start="955" rel="noopener" style="color: rgb(0, 0, 0);" target="_new">My Profile</a> page.</span>
- <span style="color: rgb(0, 0, 0);">**Zone ID**: The unique identifier of your <span style="text-decoration: underline;">**Cloudflare zone**</span>, available in the zone's dashboard.</span>
- <span style="color: rgb(0, 0, 0);">**Account ID:** The unique identifier of your entire <span style="text-decoration: underline;">**Cloudflare account**,</span> not just a specific zone (domain).</span>

<span style="color: rgb(0, 0, 0);">These credentials must be included in the request headers:</span>

- <span style="color: rgb(0, 0, 0);">`X-Auth-Email`: Your account email.</span>
- <span style="color: rgb(0, 0, 0);">`X-Auth-Key`: Your global API key.</span>

<span style="color: rgb(0, 0, 0);">For more details, refer to Cloudflare’s <a class="cursor-pointer" data-end="1381" data-start="1297" rel="noopener" style="color: rgb(0, 0, 0);" target="_new">authentication headers guide</a>.</span>

---

#### <span style="color: rgb(53, 152, 219);">**2. Configure Using API Token**</span>

<span style="color: rgb(0, 0, 0);">To set up using an API token, you need:</span>

- <span style="color: rgb(0, 0, 0);">**API Token**: A token with appropriate permissions.</span>
- <span style="color: rgb(0, 0, 0);">**Account ID &amp; Zone ID**: As noted above, can be found in your Cloudflare zone dashboard.</span>

<span style="color: rgb(0, 0, 0);">**Cloudflare Permissions for the API Token**:</span>

- <span style="color: rgb(0, 0, 0);">`Account.Access:Audit Logs:Read`</span>
- <span style="color: rgb(0, 0, 0);">`Account.Account:Settings:Read`</span>
- <span style="color: rgb(0, 0, 0);">`<span data-olk-copy-source="MessageBody">Account WAF – Read</span>`</span>
- <span style="color: rgb(0, 0, 0);">`<span data-olk-copy-source="MessageBody">DDoS Protection – Read</span>`</span>
- <span style="color: rgb(0, 0, 0);">`<span data-olk-copy-source="MessageBody">Intel – Read</span>`</span>
- <span style="color: rgb(0, 0, 0);">`<span data-olk-copy-source="MessageBody">API Gateway - Read</span>`</span>
- <span style="color: rgb(0, 0, 0);">`<span data-olk-copy-source="MessageBody">DNS - Read</span>`</span>
- <span style="color: rgb(0, 0, 0);">`<span data-olk-copy-source="MessageBody">Zone Settings - Read</span>`</span>
- <span style="color: rgb(0, 0, 0);">`<span data-olk-copy-source="MessageBody">Analytics - Read</span>`</span>
- <span style="color: rgb(0, 0, 0);">`<span data-olk-copy-source="MessageBody">FirewallServices - Read</span>`</span>
- <span style="color: rgb(0, 0, 0);">`<span data-olk-copy-source="MessageBody">Zone WAF - Read</span>`</span>
- <span style="color: rgb(0, 0, 0);">`<span data-olk-copy-source="MessageBody">Zone - Read</span>`</span>
- <span style="color: rgb(0, 0, 0);">`<span data-olk-copy-source="MessageBody">Logs - Read</span>`</span>

<span style="color: rgb(0, 0, 0);">API Tokens are preferred for security as they support fine-grained access control. Create and manage tokens via the <a class="cursor-pointer" data-end="1877" data-start="1807" rel="noopener" style="color: rgb(0, 0, 0);" target="_new">API Tokens dashboard</a>.</span>

<span style="color: rgb(0, 0, 0);">Manage Account&gt;Account API Tokens&gt;Custom Token&gt;Get Started</span>

[![image.png](https://cytechint-docs-bookstack.s3.amazonaws.com/uploads/images/gallery/2026-02/scaled-1680-/S9182GuszsiqVnWA-image.png)](https://cytechint-docs-bookstack.s3.amazonaws.com/uploads/images/gallery/2026-02/S9182GuszsiqVnWA-image.png)

[![image.png](https://cytechint-docs-bookstack.s3.amazonaws.com/uploads/images/gallery/2026-02/scaled-1680-/Z6OZe0frH96MPSA9-image.png)](https://cytechint-docs-bookstack.s3.amazonaws.com/uploads/images/gallery/2026-02/Z6OZe0frH96MPSA9-image.png)

[![image.png](https://cytechint-docs-bookstack.s3.amazonaws.com/uploads/images/gallery/2025-07/scaled-1680-/ZmQwl21RBq8SR7QU-image.png)](https://cytechint-docs-bookstack.s3.amazonaws.com/uploads/images/gallery/2025-07/ZmQwl21RBq8SR7QU-image.png)

```python
curl -X GET "https://api.cloudflare.com/client/v4/user/tokens/verify" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json"

```

[![image.png](https://cytechint-docs-bookstack.s3.amazonaws.com/uploads/images/gallery/2025-07/scaled-1680-/ATiOTiGP9Lom8Psr-image.png)](https://cytechint-docs-bookstack.s3.amazonaws.com/uploads/images/gallery/2025-07/ATiOTiGP9Lom8Psr-image.png)

---

#### <span style="color: rgb(53, 152, 219);">**3. How to get the Account ID and Zone ID** </span>

<div data-ogsc="black" data-olk-copy-source="MessageBody" id="bkmrk-1.-login-to-your%C2%A0clo">1. Login to your **Cloudflare** account.  
2. Head over to your **Dashboard** [https://dash.cloudflare.com/](https://dash.cloudflare.com/ "https://dash.cloudflare.com/").</div><div data-ogsc="black" id="bkmrk-3.-click-your-existi">3. Click your existing **Domain**.</div><div data-ogsc="black" id="bkmrk-4.-the%C2%A0account-id%C2%A0an">4. The **Account ID** and **Zone ID** located in the **right side** after you clicked the existing Domain.  
  
</div>[![image.png](https://cytechint-docs-bookstack.s3.amazonaws.com/uploads/images/gallery/2026-02/scaled-1680-/YrA5bIztXuf3yRkl-image.png)](https://cytechint-docs-bookstack.s3.amazonaws.com/uploads/images/gallery/2026-02/YrA5bIztXuf3yRkl-image.png)  
  
  
![](https://cytechint-docs-bookstack.s3.amazonaws.com/uploads/images/gallery/2026-02/KaZkwzkSEe5M07Jg-image.png)

---

**Audit Logs**

<span style="color: rgb(0, 0, 0);">Audit logs provide a record of configuration changes within your Cloudflare account, including:</span>

- <span style="color: rgb(0, 0, 0);">Logins/logouts</span>
- <span style="color: rgb(0, 0, 0);">DNS setting changes</span>
- <span style="color: rgb(0, 0, 0);">Modifications to Firewall, Caching, Page Rules, Speed, Network, and Traffic features</span>

<span style="color: rgb(0, 0, 0);">These logs are essential for tracking administrative activity and detecting unusual behavior.</span>

---

<p class="callout warning"><span style="color: rgb(0, 0, 0);">To enable log collection from the Cloudflare API token, provide the following information to **CyTech Support**:</span></p>

- **<span style="color: rgb(0, 0, 0);">Auth Email</span>**
- **<span style="color: rgb(0, 0, 0);">API Token (Auth Key)</span>**
- **<span style="color: rgb(0, 0, 0);">Account ID</span>**
- **<span style="color: rgb(0, 0, 0);">Zone ID</span>**

<span style="color: rgb(0, 0, 0);">*<span class="TextRun SCXW71272603 BCX0" data-contrast="auto" lang="EN-US" xml:lang="EN-US"><span class="NormalTextRun SCXW71272603 BCX0">If you need further </span><span class="NormalTextRun SCXW71272603 BCX0">assistance</span><span class="NormalTextRun SCXW71272603 BCX0">, kindly contact </span></span><span style="color: rgb(53, 152, 219);">**<span class="TextRun SCXW71272603 BCX0" data-contrast="none" lang="EN-US" xml:lang="EN-US"><span class="NormalTextRun SCXW71272603 BCX0">support@cytechint.com</span></span>**</span><span class="TextRun SCXW71272603 BCX0" data-contrast="auto" lang="EN-US" xml:lang="EN-US"><span class="NormalTextRun SCXW71272603 BCX0"> for prompt </span><span class="NormalTextRun SCXW71272603 BCX0">assistance</span><span class="NormalTextRun SCXW71272603 BCX0"> and guidance.</span></span><span class="EOP SCXW71272603 BCX0" data-ccp-props="{}"></span>*</span>