Palo Alto Cortex XDR CCP 3.0.5 & Cortex XDR 3.0.2 - fix PaloAltoCortexXDR_Alerts_CL offset-pagination loop
Palo Alto Cortex XDR CCP 3.0.5 & Cortex XDR 3.0.2 — fix PaloAltoCortexXDR_Alerts_CL offset-pagination loop
Solutions affected: Palo Alto Cortex XDR CCP (3.0.4 → 3.0.5) and the legacy Cortex XDR (3.0.1 → 3.0.2) — both ship the same CortexXdrAlerts RestApiPoller resource and therefore both carry the same defect.
ICM (internal): 2605070040011703
Type: Bug fix (request-body correction + sort-order correction)
Symptom
A customer running the Palo Alto Cortex XDR CCP solution stopped ingesting any rows into PaloAltoCortexXDR_Alerts_CL, while the other four Cortex XDR streams (Agent / Endpoints / Incidents / Management) continued ingesting normally. Palo Alto's API-gateway telemetry showed the customer's API key emitting ~120–200 POST requests/minute against POST /public_api/v1/alerts/get_alerts, all using the same fixed creation_time start value (~2025-05-05), sustained across many minutes. Palo Alto rate-limited the key with HTTP 429 and asked Microsoft to reduce call volume.
Root cause
The CortexXdrAlerts rule in PollingConfig.json declares an offset-paging block:
"paging": {
"offsetParaName": "$.request_data.search_from",
"pagingType": "Offset",
"offsetEndParaName": "$.request_data.search_to",
"pageSize": 100
}
…but the request body it points at did not contain those two keys:
"queryParametersTemplate":
"{ 'request_data': { 'filters': [
{ 'field': 'creation_time', 'operator': 'gte', 'value': {_QueryWindowStartTime} },
{ 'field': 'creation_time', 'operator': 'lte', 'value': {_QueryWindowEndTime} }
],
'sort': { 'field': 'creation_time', 'keyword': 'desc' }
} }"
How CCP RestApiPoller offset paging actually works in the runtime:
- The runtime substitutes
{_QueryWindowStartTime}/{_QueryWindowEndTime}from its internal cursor state, then issues page 1. - After each response it inspects
eventsJsonPaths($.reply.alerts). If the page is "full" (count ≥pageSize), it writes the next offsets to the JSONPaths configured inoffsetParaName/offsetEndParaNameand issues the next page. - Paging stops only when a response returns fewer than
pageSizerows under the configured JSONPath.
Because $.request_data.search_from and $.request_data.search_to were not present in the body, the runtime's per-page writes silently no-op'd. Every page request therefore went out identical to the previous one. Combined with sort.keyword = "desc" on creation_time (which makes XDR's offset pagination non-deterministic under load — new alerts arriving mid-poll push existing alerts down by one, breaking offset semantics), the API kept returning full pages indefinitely, the runtime kept asking for more, and a single 5-minute poll cycle entered an unbounded loop.
Because the loop never produced a "Success" cycle, _QueryWindowStartTime never advanced — every subsequent poll re-attempted the same frozen window. That is why Palo Alto's SRE team saw a fixed creation_time date repeated on every request.
Reference documentation
- Palo Alto Cortex XDR API Reference — "Get All Alerts" (
POST /public_api/v1/alerts/get_alerts): definesrequest_data.search_from(start offset, default 0) andrequest_data.search_to(end offset, default 100, max page size 100). Documentssortas{ field, keyword }with defaultcreation_time, desc, bothasc/descvalid. https://docs-cortex.paloaltonetworks.com/r/Cortex-XDR-REST-API/Get-all-Alerts - Microsoft Learn — "Create a codeless connector for Microsoft Sentinel", RestApiPoller → paging: for
pagingType: Offset,offsetParaName/offsetEndParaNameJSONPaths must resolve to properties that already exist inqueryParametersTemplate, otherwise the runtime cannot advance pages. https://learn.microsoft.com/azure/sentinel/create-codeless-connector - ARM REST schema for
RestApiPollerDataConnector.properties.paging: https://learn.microsoft.com/rest/api/securityinsights/data-connectors/create-or-update
Fix
Two surgical changes, applied only to the CortexXdrAlerts RestApiPoller resource in both solutions:
- Added
'search_from': 0, 'search_to': 100to the AlertsqueryParametersTemplaterequest body. The literal values are the seed values the runtime uses for page 1 (they match PAN's documented defaults —search_from = 0zero-based,search_to = 100matches PAN's hard 100-row page-size cap). On subsequent pages the runtime now has real JSON nodes to overwrite viaoffsetParaName/offsetEndParaName, so pagination advances correctly and exits on a short final page. - Changed
sort.keywordforcreation_timefromdesc→asc. PAN explicitly allows the override, and offset pagination is only deterministic with ascending sort on the same field used infilters. New alerts created mid-poll then append at the end of the result set instead of shifting every existing offset down by one.
Files changed (10)
Palo Alto Cortex XDR CCP solution (3.0.4 → 3.0.5)
Solutions/Palo Alto Cortex XDR CCP/Data Connectors/CortexXDR_ccp/PollingConfig.json— Alerts request body + sort.Solutions/Palo Alto Cortex XDR CCP/Package/mainTemplate.json— same fix on the embeddedCortexXdrAlertsresource;_solutionVersion(line 48) andcontentPackages.properties.version(line 2675) bumped to3.0.5.Solutions/Palo Alto Cortex XDR CCP/Data/Solution_CortexXDR.json—Versionbumped to3.0.5.Solutions/Palo Alto Cortex XDR CCP/ReleaseNotes.md— new3.0.5row.Solutions/Palo Alto Cortex XDR CCP/Package/3.0.5.zip— regenerated solution package.
Legacy Cortex XDR solution (3.0.1 → 3.0.2)
Solutions/Cortex XDR/Data Connectors/CortexXDR_ccp/PollingConfig.json— Alerts request body + sort.Solutions/Cortex XDR/Package/mainTemplate.json— same fix on the embeddedCortexXdrAlertsresource;_solutionVersion(line 48) andcontentPackages.properties.version(line 3747) bumped to3.0.2.Solutions/Cortex XDR/Data/Solution_CortexXDR.json—Versionbumped to3.0.2(and aligned with mainTemplate; was a pre-existing3.0.0drift).Solutions/Cortex XDR/ReleaseNotes.md— new3.0.2row.Solutions/Cortex XDR/Package/3.0.2.zip— regenerated solution package.
Hi @v-krishnachi, I noticed in cortex xdr solutions inside and outside maintemplate is diffrent please make sure both should be same. Rest PR is good. Thanks!
Hi @v-krishnachi, please update maintemplate and commit the chnages. Thanks!
@v-shukore , thanks for feedback on the maintemplateapiversion inside the package. Waiting for some changes from the scuba platform on the paging gap fixing. will update both at once.
Ok sure @v-krishnachi thanks for the update.
Hi @v-krishnachi, if you have some time to make updates, please move this PR to draft for now. Once your updates are done, you can mark the PR as ready for review. Thanks!