Use the GraphQL Analytics API to view data for packets passing through Cloudflare's network. For more information about using the GraphQL Analytics API and getting started, refer to GraphQL Analytics API and Querying Cloudflare Network Firewall Samples with GraphQL.
Refer to the Network Firewall GraphQL Analytics tutorial for sample queries for each Network Firewall phase.
Each Network Firewall phase reports to a GraphQL node.
| Phase | Rules | GraphQL node |
|---|---|---|
magic_transit |
Custom rules | magicFirewallNetworkAnalyticsAdaptiveGroups |
magic_transit_managed |
Managed rules | magicFirewallNetworkAnalyticsAdaptiveGroups |
magic_transit_ids_managed |
IDS | magicIDPSNetworkAnalyticsAdaptiveGroups |
magic_transit_ratelimit |
Rate limiting (beta) | magicFirewallRateLimitNetworkAnalyticsAdaptiveGroups |
Use verdict and outcome values to filter GraphQL queries. The verdict describes the rule evaluation or detection. For example, when a packet matches a drop rule expression, verdict is set to drop. The outcome describes the action that the system took. Samples matching a drop rule set outcome to drop. If the rule is disabled, the packet is not dropped, so outcome is set to pass.
Each phase uses these values slightly differently.
For packets matching custom rules, the values depend on the rule's status and action:
- A disabled custom rule has
verdict=dropandoutcome=pass, regardless of its action. - An enabled rule with the
blockaction hasverdict=dropandoutcome=drop. - An enabled rule with the
skipaction hasverdict=passandoutcome=pass.
Managed rules use the rule's default action, or the action set by an override. The block and skip actions use the same values as enabled custom rules.
A managed rule with the log action has verdict=drop and outcome=pass. Disabled managed rules do not produce matching-rule samples.
The Intrusion Detection System (IDS) detects signatures but does not block packets.
- If a packet matches an IDS signature,
verdict=dropandoutcome=pass. - If a packet matches no signatures,
verdict=passandoutcome=pass.
Each rate limiting (beta) rule sets a rate threshold in packets or bits, and drops packets over that threshold. The only available action is block, and a rule can be enabled or disabled.
- Packets matching a disabled rule (
enabled=false) haveverdict=dropandoutcome=pass. - Packets matching a rule and under the threshold have
verdict=passandoutcome=pass. - Packets matching a rule and over the threshold have
verdict=dropandoutcome=drop.
Custom and managed rules also sample packets that match no enabled rule. These default samples have an empty ruleId, and show which traffic no rule matched. To count all packets that custom and managed rules allowed, add the samples that matched an enabled skip rule to the default samples.
Rate limiting also produces default samples, which estimate all packets that left the rate limiting phase without being dropped. Use only these samples to count packets that rate limiting allowed. A packet can match several rate limiting rules and stay under the threshold of each one. Each match can produce a sample with verdict=pass, so counting those samples counts the packet more than once.