Skip to content
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

Default Reject, Accept if member of group #652

Open
clstrickland opened this issue Sep 5, 2022 · 5 comments
Open

Default Reject, Accept if member of group #652

clstrickland opened this issue Sep 5, 2022 · 5 comments

Comments

@clstrickland
Copy link

Is your feature request related to a problem? Please describe.
I have multiple groups. For this, I only worry about "WiFi" and "VPN". In my domain, there are some accounts that shouldn't have access to any networking, some that should have WiFi but not VPN, and some that have both.

Describe the solution you'd like
I would like to have groups like so:

User's Group Membership Effect
None REJECT all requests (optionally excluding requests missing the Connect-Info attribute)
WiFi REJECT all except Connect-Info == "WiFi"
VPN REJECT all except Connect-Info == "VPN"
WiFi, VPN REJECT all except Connect-Info == "WiFi" or "VPN"

Describe alternatives you've considered
I have tried every combination of REJECT_RADIUS, REJECT_Connect-Info, and ACCEPT_Connect-Info that I can think of, but I cannot get this behavior working. I cannot seem to handle the case of users who have no membership (users who do not have access to anything).

@clstrickland
Copy link
Author

If someone could just point me to the part of the code where the group membership check happens, I'm sure I can do this myself. If there is also a place where I could put a checkbox to enable or disable my modification, I can add that too.

@allahshukur-ahmadzada
Copy link

@clstrickland I wonder did you find workaround for it? we are having same exact issue.

@clstrickland
Copy link
Author

@clstrickland I wonder did you find workaround for it? we are having same exact issue.

I found where the default decision is made in the source code. I need to look into adding a gui option to change it. If someone could help with that I'd appreciate it.

It is line 111 in keycloak-plugins\radius-plugin\src\main\java\com\github\vzakharchenko\radius\radius\handlers\attributes\AbstractKeycloakAttributes.java

@allahshukur-ahmadzada
Copy link

Thank you for reply, unfortunately not capable enough to help on this.

@klasyc
Copy link

klasyc commented Aug 16, 2024

One possible workaround, I found, is to evaluate the permission on the RADIUS client side: You assign a custom attribute to a certain user role, and configure the RADIUS client so that this attribute is required.

For example, I am using RADIUS to authenticate VPN users on Mikrotik router. I created a vpn-role in Keycloak and assigned a custom attribute Mikrotik-Group = vpn-l2tp-lan. Mikrotik interprets this attribute as the name of the PPP profile to be used. Then I configured the default PPP profile name to a "black hole" profile, which leads to nowhere. This way, users not belonging to the vpn-role can still connect the VPN, but it simply does not work. It's not a perfect solution, but for me, it's better than assigning users to a radius-reject role...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants