-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[Feature] Support using groups from OIDC in ACLs #2366
Comments
Useful feature for many of us ! About the implementation idea, it's more a user-group import and store to ACL file which be needed, when OIDC (re-)login to headscale is done (first time login or on expiration). Like that we can dynamically fill the ACL policy with user mappings to groups, and be handle manual user groups changes when expiration is too far. Overall there are some limitations with OpenID provisioning because we can't handle automatic groups changes and account lock/deletion before node expiration. |
Fair enough. Would we need to really write/update
There might be a potential scaling issue in play here, depending on how many users there are on a given headscale instance. I would wager that this would not be the case for the majority of the headscale instances out there (in which case it would probably make more sense for them to have scripts that would populate
That would also be fine for most usecases for this, I would say. |
It sounds like @Nathanael-Mtd is essentially describing SCIM v2. I think that would be an unrealistic undertaking, and out of scope. A reasonable compromise sounds like we are able to sync in groups, and they can be used. The admin can then decide the "tolerance" they how for groups being out of sync by setting a short or long expiry time. |
Use case
Fetch/use groups received via OIDC property/scope in ACLs. This way we don't have to manually maintain the group memberships in the ACL.
Description
This is a continuation from the discussion in #1121.
The feature does not need to implement full support for all OIDC providers (which would complicate things). This feature can simply be done by having a setting in headscale where you can specify the name of the OIDC property that contains the array of groups the user is a member of. If that is a non-empty list of groups, headscale can use that list of groups to evaluate what permissions the user will have. If a group received from OIDC is not present in headscale ACL config, it can simply be ignored.
Since headscale already have a field to define the OIDC scope in the configuration, no further changes on that aspect is needed. Simply adding an option like
group_property: groups
or similar in theoidc
section ofconfig.yaml
would be sufficient from the configuration perspective.Example config and JSON blobs using Authentik added below. Given these examples, the expectation would be that my user will have access to the host 10.1.1.1 (server1), even if there is no statically configured group "server1-admins" in
acls.hujson
.OIDC Discover response:
OIDC userinfo response:
OIDC JWT payload:
oidc-section of config.yaml:
Relevant parts of acls.hujson:
The text was updated successfully, but these errors were encountered: