Skip to content

Commit 43030e1

Browse files
[API Shield, Logs] Update http_requests dataset for web assets (cloudflare#29236)
1 parent c8476fe commit 43030e1

3 files changed

Lines changed: 83 additions & 10 deletions

File tree

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
title: Web Assets fields now available in GraphQL Analytics API
3+
description: Query matched operation IDs and managed labels per request using the httpRequestsAdaptive and httpRequestsAdaptiveGroups GraphQL datasets.
4+
date: 2026-03-23
5+
---
6+
7+
Two new fields are now available in the `httpRequestsAdaptive` and `httpRequestsAdaptiveGroups` [GraphQL Analytics API](/analytics/graphql-api/) datasets:
8+
9+
- `webAssetsOperationId` — the ID of the [saved endpoint](/api-shield/management-and-monitoring/) that matched the incoming request.
10+
- `webAssetsLabelsManaged` — the [managed labels](/api-shield/management-and-monitoring/endpoint-labels/#managed-labels) mapped to the matched operation at the time of the request (for example, `cf-llm`, `cf-log-in`). At most 10 labels are returned per request.
11+
12+
Both fields are empty when no operation matched. `webAssetsLabelsManaged` is also empty when no managed labels are assigned to the matched operation.
13+
14+
These fields allow you to determine, per request, which Web Assets operation was matched and which managed labels were active. This is useful for troubleshooting downstream security detection verdicts — for example, understanding why [AI Security for Apps](/waf/detections/ai-security-for-apps/) did or did not flag a request.
15+
16+
Refer to [Endpoint labeling service](/api-shield/management-and-monitoring/endpoint-labels/#analytics) for GraphQL query examples.

src/content/docs/api-shield/management-and-monitoring/endpoint-labels.mdx

Lines changed: 52 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ sidebar:
77
label: Labeling service
88
---
99

10-
import { Render, Steps, Tabs, TabItem, DashButton } from "~/components";
10+
import { Render, Steps, Tabs, TabItem, DashButton, GlossaryTooltip } from "~/components";
1111

1212
API Shield's labeling service will help you organize your endpoints and address vulnerabilities in your API. The labeling service comes with managed and user-defined labels.
1313

@@ -86,9 +86,9 @@ Cloudflare will only add authentication labels to endpoints with successful resp
8686
How you address risks to your endpoints will depend on its label(s). The following steps provide you with general guidelines on how to take action on them.
8787

8888
<Steps>
89-
1. Review risks to endpoints.
90-
91-
View the endpoints labeled as risks and identify if they have been labeled for other risks.
89+
1. Review risks to endpoints.
90+
91+
View the endpoints labeled as risks and identify if they have been labeled for other risks.
9292

9393
For example, endpoints labeled `cf-risk-sensitive` and `cf-risk-missing-auth` or `cf-risk-mixed-auth` may contain sensitive data that is available to unauthenticated users.
9494

@@ -98,7 +98,7 @@ How you address risks to your endpoints will depend on its label(s). The followi
9898

9999
2. Review traffic to these labeled endpoints in Security Analytics.
100100

101-
Check for unexpected traffic sources and note any irregular traffic patterns.
101+
Check for unexpected traffic sources and note any irregular traffic patterns.
102102

103103
:::caution[Filtering]
104104
Filtering by risk label includes all traffic to all endpoints labeled with that risk, not only the traffic that prompted Cloudflare to apply the label.
@@ -108,14 +108,59 @@ How you address risks to your endpoints will depend on its label(s). The followi
108108

109109
3. Review your origin's authorization and authentication policies with your development team.
110110

111-
Speak with your developers or application owners in your organization to understand whether or not all requests to these endpoints should be authenticated. Modify your application to consistently enforce the authentication requirement for all traffic accessing these endpoints.
111+
Speak with your developers or application owners in your organization to understand whether or not all requests to these endpoints should be authenticated. Modify your application to consistently enforce the authentication requirement for all traffic accessing these endpoints.
112112

113113
Refer to [Authentication Posture](/api-shield/security/authentication-posture/) for more information.
114-
114+
115115
</Steps>
116116

117117
---
118118

119+
## Analytics
120+
121+
### GraphQL Analytics API
122+
123+
You can query the matched operation and managed labels for individual requests using the [GraphQL Analytics API](/analytics/graphql-api/). The `webAssetsOperationId` and `webAssetsLabelsManaged` fields are available in the `httpRequestsAdaptive` and `httpRequestsAdaptiveGroups` datasets. Use [introspection](/analytics/graphql-api/features/discovery/introspection/) to explore the full schema and available filter operators.
124+
125+
`webAssetsLabelsManaged` returns at most 10 labels per request.
126+
127+
#### Example: query requests by managed label
128+
129+
The following query returns the count of requests per operation ID and managed label set, filtered to requests where the matched operation carries the `cf-log-in` managed label.
130+
131+
```graphql
132+
query GetAdaptiveGroups($start: DateTime!, $end: DateTime!) {
133+
viewer {
134+
zones(filter: { zoneTag: $zoneTag }) {
135+
httpRequestsAdaptiveGroups(
136+
filter: {
137+
datetime_geq: $start
138+
datetime_leq: $end
139+
requestSource: "eyeball"
140+
webAssetsLabelsManaged_hasany: ["cf-log-in"]
141+
}
142+
limit: 25
143+
orderBy: [count_DESC]
144+
) {
145+
count
146+
dimensions {
147+
webAssetsOperationId
148+
webAssetsLabelsManaged
149+
}
150+
}
151+
}
152+
}
153+
}
154+
```
155+
156+
Replace `cf-log-in` with any [managed label](#managed-labels) or [risk label](#risk-labels). You can also omit the `webAssetsLabelsManaged_hasany` filter and use `webAssetsOperationId` as the sole dimension to group traffic by matched operation regardless of label.
157+
158+
### Logpush
159+
160+
You can export per-request Web Assets data to your storage or <GlossaryTooltip term="SIEM">SIEM system</GlossaryTooltip> of choice using [Logpush](/logs/logpush/). The `WebAssetsOperationID` and `WebAssetsLabelsManaged` fields are available in the [HTTP requests dataset](/logs/logpush/logpush-job/datasets/zone/http_requests/#webassetslabelsmanaged).
161+
162+
---
163+
119164
## Create a label
120165

121166
<Tabs syncKey="dashNewNav">

src/content/docs/logs/logpush/logpush-job/datasets/zone/http_requests.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ List of content types.
247247

248248
Type: `object`
249249

250-
String key-value pairs for Cookies. This field is populated based on [Logpush Custom fields](/logs/logpush/logpush-job/custom-fields/), which need to be configured.
250+
String key-value pairs for cookies. This field is populated based on [Logpush Custom fields](/logs/logpush/logpush-job/custom-fields/), which need to be configured.
251251

252252
## EdgeCFConnectingO2O
253253

@@ -505,13 +505,13 @@ ID of the request.
505505

506506
Type: `object`
507507

508-
String key-value pairs for RequestHeaders. This field is populated based on [Logpush Custom fields](/logs/logpush/logpush-job/custom-fields/), which need to be configured.
508+
String key-value pairs for request headers. This field is populated based on [Logpush Custom fields](/logs/logpush/logpush-job/custom-fields/), which need to be configured.
509509

510510
## ResponseHeaders
511511

512512
Type: `object`
513513

514-
String key-value pairs for ResponseHeaders. This field is populated based on [Logpush Custom fields](/logs/logpush/logpush-job/custom-fields/), which need to be configured.
514+
String key-value pairs for response headers. This field is populated based on [Logpush Custom fields](/logs/logpush/logpush-job/custom-fields/), which need to be configured.
515515

516516
## SecurityAction
517517

@@ -603,6 +603,18 @@ Type: `int`
603603

604604
WAF score for an XSS attack.
605605

606+
## WebAssetsLabelsManaged
607+
608+
Type: `array[string]`
609+
610+
Cloudflare-defined labels matched for the request.
611+
612+
## WebAssetsOperationID
613+
614+
Type: `string`
615+
616+
UUID of the matched web asset operation.
617+
606618
## WorkerCPUTime
607619

608620
Type: `int`

0 commit comments

Comments
 (0)