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

Admin cannot handle other users deployments #1653

Open
mperniola opened this issue Feb 6, 2025 · 14 comments
Open

Admin cannot handle other users deployments #1653

mperniola opened this issue Feb 6, 2025 · 14 comments
Assignees

Comments

@mperniola
Copy link

In our IM installation in INFN-CLOUD, being authenticated as "admin" in all connected groups, we tried to perform some operations (view log, delete) on other users' VMs but IM returns a 403 code for access not allowed.

Here a cut from the orchestrator log

2025-02-06 14:03:43.813 ERROR req-0fa3a251-2d63-4680-99c9-b1b8f7ea97fe 11efe491-c486-e438-9d14-005056c00001 26148 --- [ XNIO-2 task-48] .s.d.p.AbstractDeploymentProviderService :
Error while retrieving infrastructure log for deployment 11efe491-c486-e438-9d14-005056c00001

it.reply.orchestrator.exception.service.DeploymentException: Error executing request to IM
Error 403: Error Getting Inf. prop: Access to this infrastructure not granted.; nested exception is es.upv.i3m.grycap.im.exceptions.ImClientErrorException
at it.reply.orchestrator.service.deployment.providers.ImServiceImpl.handleImClientException(ImServiceImpl.java:1129)
at it.reply.orchestrator.service.deployment.providers.ImServiceImpl.getDeploymentLogInternal(ImServiceImpl.java:657)
at it.reply.orchestrator.service.deployment.providers.AbstractDeploymentProviderService.getDeploymentLog(AbstractDeploymentProviderService.java:111)
at it.reply.orchestrator.service.DeploymentServiceImpl.getDeploymentLog(DeploymentServiceImpl.java:547)
at it.reply.orchestrator.service.DeploymentServiceImpl$$FastClassBySpringCGLIB$$66a695a.invoke()

Caused by: es.upv.i3m.grycap.im.exceptions.ImClientErrorException: null
at es.upv.i3m.grycap.im.rest.client.ImClient.get(ImClient.java:153)
at es.upv.i3m.grycap.im.InfrastructureManager.getInfrastructureContMsg(InfrastructureManager.java:227)
at it.reply.orchestrator.service.deployment.providers.ImServiceImpl.lambda$11(ImServiceImpl.java:652)
at it.reply.orchestrator.service.deployment.providers.ImServiceImpl.lambda$0(ImServiceImpl.java:167)
at it.reply.orchestrator.service.security.OAuth2TokenService.executeWithClientForResult(OAuth2TokenService.java:250)
at it.reply.orchestrator.service.deployment.providers.ImServiceImpl.executeWithClientForResult(ImServiceImpl.java:166)
at it.reply.orchestrator.service.deployment.providers.ImServiceImpl.getDeploymentLogInternal(ImServiceImpl.java:651)
... 124 common frames omitted

@micafer
Copy link
Member

micafer commented Feb 7, 2025

How are you configuring the IM to set the admin user?

@lgiommi
Copy link

lgiommi commented Feb 7, 2025

Hi @micafer,
we set the ADMIN_USER parameter with the following content
{ "password": "{{ im_cfg_admin_user }}", "token": "", "username": "" }
Is it correct? What should the im_cfg_admin_user parameter contain? Maybe we have set it wrong?
We are also configuring OIDC_CLIENT_ID and OIDC_CLIENT_SECRET

@micafer
Copy link
Member

micafer commented Feb 7, 2025

The im_cfg_admin_user should follow this format: https://some_issuer.com/user_sub

https://github.com/grycap/im/blob/master/etc/im.cfg#L46C1-L47C93

@lgiommi
Copy link

lgiommi commented Feb 7, 2025

Ok we had set that variable with the proper format, but that endpoint is not pointing to a proper page of the issuer we are using (error 404, not found). What does the im expect to achieve by contacting that endpoint?

@micafer
Copy link
Member

micafer commented Feb 7, 2025

The IM will no try to contact this endpoint, but it is the expected format used internally.
For example in case of using EGI-Checkin the format must be:

https://aai.egi.eu/auth/realms/egi/[email protected]

@lgiommi
Copy link

lgiommi commented Feb 7, 2025

We are using the INDIGO IAM service, then https://iam.cloud.infn.it/admin_sub could be correct? We are already using it

@lgiommi
Copy link

lgiommi commented Feb 7, 2025

Is it possible to have multiple admin users?

@micafer micafer self-assigned this Feb 11, 2025
@micafer micafer added the bug label Feb 11, 2025
@micafer
Copy link
Member

micafer commented Feb 11, 2025

I made some tests and there is a bug in case of using an OIDC user as admin.
We are working on it.

@micafer
Copy link
Member

micafer commented Feb 11, 2025

I found the problem, the format of the admin config is like this:

{
"password": "{{ im_cfg_admin_user  }}",
"token": "",
"username": "__OPENID__{{admin_user_preferred_username}}"
}

@giosava94
Copy link

Hi, thank you for the update!
Can we already try the solution you proposed with the current version of the IM or do you need to release a patched version?

Regarding our problem, we also have another question: "What is the IM admin user used for?"
Is it used to perform super user operations, such as write, read, edit deployments' details or does the IM use that account to performs some "service" operations on behalf that user?

We need to know this because we have multiple admin users and we would like to give them the possibility to also operate as IM admins (for example to delete deployments or read logs). Can we specify multiple IM users?

@micafer
Copy link
Member

micafer commented Feb 11, 2025

Hi, thank you for the update! Can we already try the solution you proposed with the current version of the IM or do you need to release a patched version?

You can try the solution now.

Regarding our problem, we also have another question: "What is the IM admin user used for?" Is it used to perform super user operations, such as write, read, edit deployments' details or does the IM use that account to performs some "service" operations on behalf that user?

The admin user is able to manage all the deployments made in the IM instance (it also require the cloud credentials to manage the actual resources).

We need to know this because we have multiple admin users and we would like to give them the possibility to also operate as IM admins (for example to delete deployments or read logs). Can we specify multiple IM users?

Currently multiple admin users is not supported.
We can try to add support for it.

@micafer micafer removed the bug label Feb 11, 2025
@giosava94
Copy link

Thank you for clarifying our doubts. We would appreciate if you can add support for this feature because in our cases it would be helpful

@micafer
Copy link
Member

micafer commented Feb 17, 2025

#1655

@micafer
Copy link
Member

micafer commented Feb 26, 2025

New version 1.18.0 add support for list of admin users.

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

4 participants