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

OnDemand does not respond to user group change for disabling applications #4138

Open
HazelGrant opened this issue Feb 11, 2025 · 8 comments
Open

Comments

@HazelGrant
Copy link
Contributor

https://discourse.openondemand.org/t/ondemand-does-not-respond-to-user-group-change-for-disabling-applications/4029

I've been able to reproduce this.

@HazelGrant HazelGrant added area/security bug Existing functionality not working as expected community request labels Feb 11, 2025
@HazelGrant HazelGrant added this to the 4.1 milestone Feb 11, 2025
@johrstrom
Copy link
Contributor

This solution works fine, but only after the user clicks on the “Restart Web Server” link.

I think a restart is expected here. Besides, shouldn't we be caching things for speed? I wonder if the proper guidance here is if you're going to expect everyone to pick up new configs, you should bounce all their puns as the admin.

@stdweird
Copy link

we have a cron in place that checks all nginx process for the known groups and compares them with the secondary groups of the owner. and only if they do not match, we kill/cleanup the nginx. user activity will retrigger them with latest group associations.

fyi, this is "normal" linux behaviour for any running process, notthing to do with caching. and it is a security issue in the sense that if you were once in a group, you stay in that group as long as the process is alive. so kicking someone out of the group might still leave them with access.

@serden85
Copy link

we have a cron in place that checks all nginx process for the known groups and compares them with the secondary groups of the owner

I found a task "ood" in /etc/etc/cron.d

#!/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
0 */2 * * * root [ -f /opt/ood/nginx_stage/sbin/nginx_stage ] && /opt/ood/nginx_stage/sbin/nginx_stage nginx_clean 2>&1 | logger -t nginx_clean

is this it?

@johrstrom
Copy link
Contributor

I found a task "ood" in /etc/etc/cron.d

That is one that we ship to stop PUNs if they're inactive. @stdweird seems to imply they have their own code to do something different.

@stdweird
Copy link

my apologies. yes, we have our own cron to keep our ood backend sane. this is one the things it does.
if interested, i can share it.

@serden85
Copy link

Part of the problem was solved. For example, I set the session timeout to 10 minutes (oidc_session_inactivity_timeout: 600) and changed the /etc/etc/cron.d/ood execution interval to once every 10 minutes.
Now, if a session is closed due to inactivity, then after logging in, user’s group membership is updated and thus application availability is controlled.

Do I understand correctly that if it is possible to reduce the execution interval of another cron, then the user’s group membership will be updated directly during the user session?
If so, how can I reduce the execution interval оf another cron?

@johrstrom
Copy link
Contributor

Do I understand correctly that if it is possible to reduce the execution interval of another cron, then the user’s group membership will be updated directly during the user session?

Not 100% sure what you're asking here, but you cannot update a running process (session). You have to restart the process by stopping/killing it then starting it again, thereby getting a new session.

@serden85
Copy link

You have to restart the process by stopping/killing it then starting it again, thereby getting a new session

Thanks for the detailed explanation. As I understand it, this happens when the user clicks the “Restart Web Server”.

@stdweird explanation

we have a cron in place that checks all nginx process for the known groups and compares them with the secondary groups of the owner. and only if they do not match, we kill/cleanup the nginx. user activity will retrigger them with latest group associations.

gives me hope that it is possible to automate the process of “Restart Web Server” for a user session.

As a result, I want that after changing the user’s group membership, the “Restart Web Server” event will automatically occur, and it doesn’t matter whether the user’s session is currently active or not.
The question is how to do this?

@johrstrom johrstrom added question and removed bug Existing functionality not working as expected area/security labels Feb 19, 2025
@johrstrom johrstrom modified the milestones: 4.1, Backlog Feb 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants