[Beta Support]: Support multiple role matches (permission merging) for Proxy Auth #21931
Replies: 4 comments 3 replies
-
|
Glad you're able to use the new feature, and thanks for the discussion. I understand what you’re getting at, but this doesn’t really align with how authorization is structured in Frigate today. Frigate doesn’t implement a general RBAC system with composable or additive permissions. There are only two effective roles in Frigate today: Because of that, the idea of calculating “effective permissions” from multiple matched roles doesn’t have much meaning here - there’s nothing granular to union together. A session ultimately resolves to a single role, not a set of capabilities. The
Frigate isn’t attempting to mirror Kubernetes/AWS-style RBAC semantics. Perhaps if more fine-grained permissions are implemented in the future, your request may have more relevance. At this point, if someone needs more complex policy handling, the recommended approach is to enforce it at the proxy/IdP layer and pass a single resolved role through to Frigate. |
Beta Was this translation helpful? Give feedback.
-
|
Thanks for the response. I want to clarify a few points to ensure we are aligned on the practical application of this feature. 1. Context on "K8s/AWS" References 2. The Goal of 3. Critical Logic Issues A. Deterministic Priority (The "Downgrade" Bug)
B. Group Intersection (AND vs OR)
Proposed "Middle Ground" Solution
This approach respects Frigate's simple permission model while fixing the "Admin downgrade" bug and allowing the flexibility |
Beta Was this translation helpful? Give feedback.
-
|
This is improved in #21934 This may not make it into the final release of 0.17.0 - we'll have to see what other fixes come up and if we end up with another release candidate. If not, then it should be a part of 0.17.1. |
Beta Was this translation helpful? Give feedback.
-
|
This discussion highlights a significant gap in clarity regarding the project's long-term vision for authorization. Could you please create/publish a high-level conceptual document outlining the long-term goals and non-goals for the permission/auth system? You mentioned "Frigate isn't attempting to mirror K8s/AWS" and that roles are "coarse-grained gates." While that is helpful context here, it isn't documented anywhere central. Users (and contributors) need a clear, public definition of what "Coarse-Grained" actually means for Frigate's future to avoid repeated arguments about "real-world use cases" that might be completely different from person to person. For example, without this document, we don't know if the following are planned features or hard "out of scope" design constraints: Feature Granularity: Will we ever see permissions split by capability (e.g., a user who can watch but not trigger on-demand recordings?) Data Granularity: Will permissions ever control metadata visibility (e.g., hiding face names for "Viewer" roles)? Resource Granularity: Is the limit strictly "Access to Camera X," or will it go deeper? Having a conceptual document that answers "What is the intended scope of Frigate's Auth?" with real use cases with config examples and expected behavior would save everyone time by setting correct expectations upfront and filtering out feature requests that fundamentally misalign with your architecture. That document would also serve the purpose to be a working ground where to discuss, before moving to the code/actual behavior like we are doing right now. I have been using Frigate for a long time, read the docs and the code, discussed feature requests with you etc but I am still unable to wrap my head around your intentions, and so feel I am wasting more time creating understandings back and forth between us than actually improving Frigate. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the problem you are having
First off, thanks for implementing the
role_map! It has made integrating with OIDC providers much smoother.However, I've encountered a friction point during testing: Frigate currently seems to handle only a single role match.
In real-world Identity Provider (IdP) setups, users often belong to multiple groups that might map to different roles within Frigate. A common scenario is an Administrator who is also part of a general "Users" or "Staff" group.
The Scenario:
Imagine the following config:
If a user logs in with the groups
['sysadmins', 'staff'], they match both theadminandviewermapping rules.Current Behavior:
It appears Frigate picks one role (likely the first match or last match depending on iteration order) and ignores the others. If it happens to match
viewerfirst, the Admin user is downgraded to a Viewer, despite having the credentials for Admin.Desired Behavior:
Permissions should be additive (merged).
If a user matches multiple roles via the
role_map, Frigate should grant the superset of all permissions associated with those roles.In the example above:
admin-> Grants admin privileges.viewer-> Grants viewer privileges.Admin + Viewer(which effectively resolves to Admin).Why this matters (Standard RBAC Pattern):
In most organization directories (LDAP/AD/Keycloak), group structures are often hierarchical or overlapping.
Suggested Solution
Modify the
role_maplogic to:If merging complex permissions is currently too difficult in the codebase, a simpler heuristic for now would be to prioritize the highest privilege role found (e.g., if
adminis found among the matches, forceadmin).Beta Version
0.17.0-rc1
Issue Category
Configuration / Setup
Frigate config file
NARelevant Frigate log output
Relevant go2rtc log output (if applicable)
No response
Install method
Docker Compose
docker-compose file or Docker CLI command
NAOperating system
Other
CPU / GPU / Hardware
No response
Screenshots
No response
Steps to reproduce
No response
Any other information that may be helpful
No response
Beta Was this translation helpful? Give feedback.
All reactions