-
Notifications
You must be signed in to change notification settings - Fork 5
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
Settle on the Fate of the --allow-run-as-root
OpenMPI Command Option
#323
Comments
why I choose to set --allow-run-as-root int khiops-env:
I'm not sure that any data scientist will understand this message. So I decided to add the flag --allow-run-as-root. When we launch khiops, the goal is that the scripts khiops and khiops-env run everywhere without any problem. If we decide to remove this flag we have to had some documentation about this troubleshooting. I agree, it is very bad to run applications as root, but IMHO we don't have to manage that at the khiops level. Besides, If we use mpich or intelMPI or if we launch khiops with 1 proc, there's nothing to stop us from launching khiops as root. And finally: what is the real risk of running khiops as root? (khiops never destroys files or directories it has not created itself) |
Guys, let me clarify what this mysterious "--allow-run-as-root" is actually doing. (base) nmms4680@yd-cnd7506qkx:~/workspace/test$ tree . 2 directories, 0 files (base) nmms4680@yd-cnd7506qkx:~/workspace/test$ sudo tree 2 directories, 1 file Now if i do (base) nmms4680@yd-cnd7506qkx:~/workspace/test$ mpirun -n 1 -q --allow-run-as-root tree . 2 directories, 0 files If I run the same command as root: (base) nmms4680@yd-cnd7506qkx:~/workspace/test$ sudo mpirun -n 1 -q --allow-run-as-root tree . 2 directories, 1 file CQFD like we say in french. So for "normal" users e.g. datascientists there is no risk at all with this option. |
To be clear: it is almost always a bad idea to run anything decently complicated as root. In this case the main problem is that we are silently hiding the fact that we are propagating elevated privileges via mpirun, which is not maintained by us. To put ourselves on the safe side I'd do the following:
The above would protect the user from unknowingly launching the program as root and hide the implementation details (OpenMPI) which the user doesn't really care about. |
My 2 cents: I think that running with It is clear that for UX is not ideal, as the message is cryptic. But, the users that will get this message are in Linux (and potentially within Docker). So I think we can assume that they are advanced ones. I would simply run the application without Finally, as for the argument "but mpich let us do it", not because before we were at risk, doesn't mean we should continue to be. In that sense SG would also lift the risk in that case. Whatever the case I vouch for not running with |
Bilan des options Khiops dédiées MPI
Ne pourrait pas se contenter uniquement de l'option existante KHIOPS_MPI_COMMAND?
Eh oui, Khiops n'est pas 100% bug free, mais on peut le lancer directement sans MPI (cf. coclustering) , avec MPICH, OpenMPI, sur desktop, via docker.... On ne va pas rappeler à chaque fois à l'utilisateur que lancer en root, c'est risqué? |
I also agree with @sgouache that, ideally, Khiops itself should refrain, by default, from being run as root, and that the effects of this on the concrete MPI backend (or its lack thereof, for sequential runs) should be, by default, transparent to the end-user. But, meanwhile, here are my 2 cents:
|
This discussion has brought to light important security and user experience considerations. UX must remain a priority. However, the fact that Khiops propagates its privileges to OpenMPI, a third-party library, amplifies the risks associated with running processes as root. Indeed, bugs or vulnerabilities in a component external to our could have serious consequences for the whole system, impacting our users. The proposal to introduce a Khiops-specific flag strikes a balance between security and usability. It empowers users to make informed choices acknowledging the associated risks, especially while OpenMPI naturally inherits the same root privileges as Khiops (what we do to prevent cryptic errors difficult for Khiops users to interpret). Plus, this choice can be made without consulting the doc as we would display a clear message if user executes Khiops in root mode. Therefore, I vote for the following solution:
The kind of questions that helped me make this decision:
|
OK for me, with the small caveat that, instead of adding the Indeed, setting the 2 |
I agree with @popescu-v. Another problem with I argue that it suffices to document the solutions
The solution has zero development cost and little documentation cost. |
I have to propose what I believe will offer a more consistent UX:
The benefits of the above solution:
Drawbacks:
|
I close the discussion. A new related issue #344 is created to implement the changes. |
Description
Currently, the
--allow-run-as-root
OpenMPImpiexec
option is hard-coded in thekhiops-env
scripts for native installations of the Khiops binaries on Linux operating systems (Ubuntu, Rocky).Or, this is not recommended by the OpenMPI maintainers, mostly for security reasons:
The goal of this issue is to settle on the final approach to the usage of this option.
Questions/Ideas
OMPI_ALLOW_RUN_AS_ROOT
andOMPI_ALLOW_RUN_AS_ROOT_CONFIRM
environment variables to1
before callingmpiexec
. This alternative can be documented in the official documentation, e.g. for users who wish to set-up Docker containers on their own.khiops-env
script if they are not already defined in the environment. Thus one would give the user the possibility to set these two environment variables to0
so that this option is disabled.Context
The text was updated successfully, but these errors were encountered: