Cloudflare Page Shield Connections
Beta Feature
This input is currently in beta. If you run into any issues, please reach out to product@monad.com.
Retrieves Page Shield connections across Cloudflare zones for tracking third-party scripts and connections. This input collects information about all connections detected by Page Shield, including external scripts, APIs, and resources loaded on your domains. This helps identify security risks and monitor potential malicious connections.
Sync Type: Full Synchronisation
Requirements
- A Cloudflare account with access to Page Shield (Enterprise plan or add-on)
- An API Token with
Zone:Readpermission - Permission on the API token to read Page Shield for each zone you collect from (see the Cloudflare documentation for the permission name)
- One or more zones (domains) configured in your Cloudflare account
Creating an API Token
- Log in to your Cloudflare dashboard
- Navigate to My Profile > API Tokens
- Click Create Token
- Use the Create Custom Token option
- Configure the token:
- Token name: Give it a descriptive name (e.g., "Monad Page Shield")
- Permissions: Add
Zone>Zone>Read, plus a permission that can read Page Shield for the zone (see the Cloudflare documentation) - Zone Resources: Select the specific zone(s) or "All zones"
- Click Continue to summary and then Create Token
- Copy the token value (you won't be able to see it again)
Accessing Page Shield
Page Shield must be enabled on your Cloudflare zones. To verify:
- Log in to your Cloudflare dashboard
- Select a zone and navigate to Security > Page Shield
- Ensure Page Shield is enabled and has detected connections
- (Optional) Note specific zone IDs for targeted monitoring
Details
Monad uses the cron field to run this input on specific intervals and returns all Page Shield connections matching your filters, performing a full sync of data each time. The input retrieves comprehensive connection information including:
- Connection metadata (ID, timestamps, host, URL)
- First page URL where connection was detected
- All pages where connection was detected
- Malicious classification (domain and URL reputation)
- Malicious categories (if applicable)
- CDN-CGI path detection
The input supports filtering by connection status (active, infrequent, inactive) and can optionally exclude Cloudflare's /cdn-cgi internal paths. If multiple zones are configured or no specific zones are provided, the input fetches connections from all zones.
When no zone IDs are provided, the input reads only the first 20 zones Cloudflare returns for the token.
To collect connections from more than 20 zones, list every zone's ID in Zone IDs.
The Exclude CDN CGI default of true applies when you create the input in the Monad UI.
When you create the input through the API or Terraform, set exclude_cdn_cgi explicitly, because leaving it out includes /cdn-cgi connections.
Configuration
The following configuration defines the input parameters. Each field's specifications, such as type, requirements, and descriptions, are detailed below.
Settings
| Setting | Type | Required | Default | Description |
|---|---|---|---|---|
cron | string (cron) | Yes | 0 * * * * | Cron string for scheduling the ingest of your input. eg: 0 0 * * * - Daily at midnight, or */15 * * * * - Every 15 minutes. Defaults to an hour. |
use_synthetic_data | bool | No | false | Generate synthetic data for testing, instead of connecting to a real data source. Defaults to an hourly cron schedule for cron-based inputs. |
zone_ids | array of string | No | - | Optional list of specific Cloudflare zone IDs to fetch connections from. If empty, fetches from all zones accessible by the API token. |
status | string | No | active | Filter connections by status. Default: 'active' Allowed values: active, infrequent, inactive. |
exclude_cdn_cgi | bool | No | true | Exclude connections to Cloudflare /cdn-cgi paths |
rate_limit | object | No | - | Maximum outbound source-API request rate. A blank or zero value falls back to the connector's default rate-limiting behavior. Maximum 4 requests per second. See API Rate Limiting for the field format. |
Secrets
| Secret | Type | Required | Description |
|---|---|---|---|
api_token | secret | Yes | Your Cloudflare API token with Zone |
Rate Limits
| Scope | Limit | Window | Notes |
|---|---|---|---|
| API Requests | 1,200 | per 5 minutes | Standard rate limit across Cloudflare API |
Headers: X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset
Source: Cloudflare API Rate Limits
Troubleshooting
Common Issues
Issue: API returned success=false with authentication error
Cause: The API token is invalid, expired, or lacks the required permissions.
Solution: Verify your API token is correct and has the Zone:Read permission and permission to read Page Shield for each zone.
Create a new token if needed.
Issue: No connections returned despite Page Shield being enabled Cause: Page Shield may not be enabled on the zones, or no connections have been detected yet. Solution: Verify Page Shield is enabled in Security > Page Shield on your zones. Ensure the zones have traffic and are actively monitored.
Issue: Getting fewer connections than expected Cause: The status filter may be limiting results, or zone IDs may not be specified correctly. Solution: Check your status filter setting (default is 'active'). Try an empty zone_ids list to fetch from all zones (up to the first 20), or verify zone IDs are formatted correctly.
Issue: CDN-CGI paths are being excluded when you need them
Cause: The exclude_cdn_cgi setting is enabled by default in the Monad UI.
Solution: Set exclude_cdn_cgi to false in your configuration to include /cdn-cgi connections.
Issue: Rate limit exceeded errors Cause: Multiple integrations or manual API calls are consuming the rate limit quota. Solution: The input automatically handles rate limiting. If you see persistent errors, reduce the frequency of other API calls to your Cloudflare account or increase the cron interval.
Related Articles
- Cloudflare Page Shield API Documentation
- Cloudflare Page Shield Overview
- Cloudflare API Tokens
- Cloudflare API Rate Limits
Sample Record
Code
Sync frequency
This input runs on a cron schedule (default hourly, 0 * * * *), which you can configure on the pipeline.
See Input Sync Frequency for details.
Community transforms
The Monad Transforms Repository has ready-made transforms for this input. Import one into your organization, then add it to a pipeline after this input.
| Format | Transform |
|---|---|
| OCSF v1.9.0 | Cloudflare Page Shield Connections to OCSF v1.9.0 |
| ECS v9.5.0 | Cloudflare Page Shield Connections to ECS v9.5.0 |
| CEF | Cloudflare Page Shield Connections to CEF |
CEF transforms emit an intermediate record; add the CEF Serializer transform after one to produce the CEF:0 string.