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.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Metrics: Differentiate between restricted and unrestricted certificates #13214
Metrics: Differentiate between restricted and unrestricted certificates #13214
Changes from all commits
87bc3d4
9f3bb63
d3b5ab7
d94e0ec
dc1de11
1f2c8d2
60e4971
72661bb
35f9a3a
b705454
525ea8f
ad57cca
22a3076
d1ba04a
6503560
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this correct? What if the label does have a non-empty project, but the user doesn't have a project permission, but does have server permission, this would return false?
Doesn't having the server permission mean they can see all metrics (including the project ones)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay tricky one, thanks for rising this as I have found another potential security bug in my changes. The unrestricted metrics certificate got just too much permission.
But the way the checking is done here is right.
In case of the TLS driver if the certificate is unrestricted, the driver permits
can_view_metrics
by default (see latest push where I went back to the original changes).In case of OIDC this is allowed as the
can_view_metrics
on theserver
type supersedes thecan_view_metrics
on theproject
type. This way the check still returnstrue
even if there is no explicitcan_view_metrics
entitlement set for the project (see the changed OpenFGA model).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK so its resolved internally in each driver that the user has implicit project level permissions if its assigned at the server level. Makes sense thanks