Repository navigation
Conversation
This was referenced Sep 26, 2025
Member
Author
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
ThomasK33
force-pushed
the
thomask33/09-26-add_detailed_scope_auth_metrics
branch
2 times, most recently
from
September 26, 2025 19:57
9d9f50a to
a7dd13b
Compare
ThomasK33
force-pushed
the
thomask33/09-26-add_token_scope_support_in_cli
branch
from
September 28, 2025 10:53
f277494 to
51502b5
Compare
ThomasK33
force-pushed
the
thomask33/09-26-add_detailed_scope_auth_metrics
branch
from
September 28, 2025 10:53
a7dd13b to
8b7a31c
Compare
ThomasK33
marked this pull request as ready for review
September 28, 2025 11:08
ThomasK33
force-pushed
the
thomask33/09-26-add_detailed_scope_auth_metrics
branch
from
September 29, 2025 08:25
8b7a31c to
7725526
Compare
ThomasK33
force-pushed
the
thomask33/09-26-add_token_scope_support_in_cli
branch
from
September 29, 2025 08:25
51502b5 to
9384a37
Compare
ThomasK33
force-pushed
the
thomask33/09-26-add_detailed_scope_auth_metrics
branch
from
September 29, 2025 09:43
7725526 to
e2539b7
Compare
ThomasK33
force-pushed
the
thomask33/09-26-add_token_scope_support_in_cli
branch
2 times, most recently
from
September 29, 2025 09:46
968cd55 to
23c8b74
Compare
ThomasK33
force-pushed
the
thomask33/09-26-add_detailed_scope_auth_metrics
branch
from
September 29, 2025 09:46
e2539b7 to
3bf5bf9
Compare
ThomasK33
force-pushed
the
thomask33/09-26-add_detailed_scope_auth_metrics
branch
2 times, most recently
from
October 2, 2025 17:37
bf26332 to
d817f31
Compare
ThomasK33
force-pushed
the
thomask33/09-26-add_token_scope_support_in_cli
branch
from
October 2, 2025 17:37
fa49bdc to
d7fcc25
Compare
ThomasK33
marked this pull request as draft
October 2, 2025 17:37
ThomasK33
force-pushed
the
thomask33/09-26-add_token_scope_support_in_cli
branch
from
October 3, 2025 17:59
d7fcc25 to
c4f8c2a
Compare
ThomasK33
force-pushed
the
thomask33/09-26-add_detailed_scope_auth_metrics
branch
2 times, most recently
from
October 6, 2025 09:42
b076a30 to
b020309
Compare
ThomasK33
force-pushed
the
thomask33/09-26-add_token_scope_support_in_cli
branch
2 times, most recently
from
October 6, 2025 10:10
6ec4b94 to
d9f66ca
Compare
ThomasK33
force-pushed
the
thomask33/09-26-add_detailed_scope_auth_metrics
branch
2 times, most recently
from
October 6, 2025 10:48
37cd2d3 to
807fafe
Compare
ThomasK33
force-pushed
the
thomask33/09-26-add_token_scope_support_in_cli
branch
2 times, most recently
from
October 6, 2025 11:24
11f6a63 to
75d7b64
Compare
ThomasK33
force-pushed
the
thomask33/09-26-add_detailed_scope_auth_metrics
branch
from
October 6, 2025 11:24
807fafe to
7b72854
Compare
ThomasK33
force-pushed
the
thomask33/09-26-add_token_scope_support_in_cli
branch
from
October 6, 2025 11:57
75d7b64 to
f244193
Compare
ThomasK33
force-pushed
the
thomask33/09-26-add_detailed_scope_auth_metrics
branch
from
October 6, 2025 11:57
7b72854 to
5a425af
Compare
ThomasK33
force-pushed
the
thomask33/09-26-add_detailed_scope_auth_metrics
branch
from
October 6, 2025 21:16
5a425af to
e408ecf
Compare
ThomasK33
force-pushed
the
thomask33/09-26-add_token_scope_support_in_cli
branch
from
October 6, 2025 21:16
f244193 to
2f3304e
Compare
ThomasK33
force-pushed
the
thomask33/09-26-add_detailed_scope_auth_metrics
branch
from
October 6, 2025 21:40
e408ecf to
ab2a24f
Compare
ThomasK33
force-pushed
the
thomask33/09-26-add_token_scope_support_in_cli
branch
from
October 6, 2025 21:40
2f3304e to
1dae22e
Compare
ThomasK33
force-pushed
the
thomask33/09-26-add_detailed_scope_auth_metrics
branch
from
October 7, 2025 16:38
ab2a24f to
802b588
Compare
ThomasK33
force-pushed
the
thomask33/09-26-add_token_scope_support_in_cli
branch
2 times, most recently
from
October 9, 2025 12:54
7eb739c to
dc96969
Compare
ThomasK33
force-pushed
the
thomask33/09-26-add_detailed_scope_auth_metrics
branch
from
October 9, 2025 12:55
802b588 to
cb61426
Compare
This change introduces new Prometheus metrics to provide detailed insights into authorization decisions, particularly for API key scopes. These metrics help administrators understand why a request was allowed or denied by breaking down the outcome. The new metrics are: - `coderd_authz_scope_enforcement_total`: Classifies each authorization request by its outcome (e.g., scope_allow, scope_deny, allow_list_deny) and resource type. - `coderd_authz_scope_enforcement_duration_seconds`: Measures the latency of scope enforcement decisions. - `coderd_authz_scope_allowlist_miss_total`: Tracks requests denied specifically due to a resource not being in a scope's allow-list. To implement this efficiently, a new `scope_metrics` rule was added to the Rego policy. This allows the authorizer to gather detailed outcome information in a single evaluation, avoiding redundant computations. The documentation for Prometheus has been updated to include details and example queries for the new metrics.
ThomasK33
force-pushed
the
thomask33/09-26-add_token_scope_support_in_cli
branch
from
October 9, 2025 13:06
dc96969 to
521c665
Compare
ThomasK33
force-pushed
the
thomask33/09-26-add_detailed_scope_auth_metrics
branch
from
October 9, 2025 13:06
cb61426 to
06d4957
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Add scope enforcement metrics to RBAC authorizer
This PR adds detailed metrics to track scope enforcement decisions in the RBAC authorizer. It helps us understand why requests are allowed or denied, particularly focusing on scope-based decisions versus role or ACL-based decisions.
The changes include:
scopeDecisionstruct to track detailed authorization outcomescoderd_authz_scope_enforcement_total- Counts requests by decision typecoderd_authz_scope_enforcement_duration_seconds- Measures latencycoderd_authz_scope_allowlist_miss_total- Tracks allow-list missesThese metrics will help us better understand authorization patterns and identify potential issues with scope configurations.