Event contract
Fields the query expects
| Field | Type | Why it exists |
|---|---|---|
| timestamp_utc | Timestamp | Authorization decision time. |
| policy_name | Utf8 | Stable policy name and version. |
| action | Utf8 | Controlled attempted action. |
| resource_type | Utf8 | Resource class without contents. |
| actor_role | Utf8 | Bounded actor role. |
| actor_id | Utf8 | Restricted privacy-safe actor identifier. |
| outcome | Utf8 | allowed or denied. |
Copy the query
SELECT
policy_name,
action,
resource_type,
actor_role,
COUNT(*) AS denied_actions,
COUNT(DISTINCT actor_id) AS affected_actors
FROM authorization_events
WHERE timestamp_utc >= now() - INTERVAL '7 days'
AND outcome = 'denied'
GROUP BY policy_name, action, resource_type, actor_role
ORDER BY affected_actors DESC, denied_actions DESC;This read-only query is planned and executed against an empty typed table with Apache DataFusion 45.2.0. The deterministic sample output is synthetic and reviewed separately; validate field types, thresholds, and business definitions against your own data. Read the testing methodology.
Query result
Actors affected by policy denials
The workspace export policy affects the broadest actor set.
| policy_name | action | resource_type | actor_role | denied_actions | affected_actors |
|---|---|---|---|---|---|
| workspace-export-v3 | export | workspace | member | 214 | 86 |
| billing-admin-v2 | update | subscription | admin | 48 | 31 |
Synthetic example output. Run the query against your own event schema and thresholds before using it for operational decisions.
Reproduce the example
Download the public fixture
The JSON bundle includes the typed event contract, illustrative input rows, exact SQL, expected output, review notes, and engine version. The CSV contains the displayed result.
How the SQL works
- 1Policy name and version connect the result to a change owner.
- 2Affected actors estimates rollout blast radius.
- 3Resource class supports review without exposing resource contents.
Edge cases to decide
- Expected denials and suspicious attempts need different response rules.
- Restrict drill-down actor access and audit it.
- Policy renames need a durable version mapping.
Recommended dashboard
- Bars: affected_actors by policy
- Trend: denied_actions by release
- Table: reviewed denial groups
Alert guidance
Alert when a new policy version causes a broad denial increase or a sensitive action is repeatedly denied.
Read alert setupPut the recipe to work
Related instrumentation and guides
Continue the analysis
Analyze Authentication Failure Rate
Measure authentication failures by method and reason while keeping traffic volume and affected identities visible.
Open recipeAudit Privileged Actions with SQL
Summarize sensitive administrative actions, denied attempts, and review-required outcomes without collecting raw secrets or resource contents.
Open recipeDetect Suspicious Authentication Bursts
Find short authentication windows with repeated failures across many identities or coarse network sources.
Open recipeRun it on real events
Create a table, adapt the fields, and save the result
Start free, send structured events, and use the query result as a chart, shared dashboard widget, or alert input.