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

Implement Enhanced Security Measures for Running Khiops as Root #344

Open
lucaurelien opened this issue Aug 8, 2024 · 0 comments
Open
Labels
Priority/1 To do after P0

Comments

@lucaurelien
Copy link

Issue #323 highlighted the potential security risks associated with Khiops propagating its privileges to OpenMPI when run as root. To address this, while maintaining user flexibility, we propose implementing the following changes:

Decision made:

  1. Prohibit Elevated Privileges by Default: Khiops will detect the current user and refuse to run with root or admin privileges on all platforms and installation types.
  2. Clear Warning Message: A prominent message will be displayed upon attempted execution with elevated privileges, for instance: You are trying to run Khiops with elevated privileges. For security reasons, this is not the default behavior and Khiops will now exit. If you understand the potential risks and need to proceed, you can work around this behavior by setting KHIOPS_ALLOW_RUN_AS_ROOT=1. Please note that this will also grant elevated privileges to the third-party MPI library, which is discouraged by its maintainers.
  3. Explicit Override: Users who understand the risks and have a justifiable need to run Khiops with elevated privileges can explicitly set the KHIOPS_ALLOW_RUN_AS_ROOT=1 environment variable to bypass this restriction (no need to read any doc).
  4. Centralized Privilege Management: If KHIOPS_ALLOW_RUN_AS_ROOT is set, khiops-env will set the necessary flags to allow elevated execution for underlying OpenMPI library (OMPI_ALLOW_RUN_AS_ROOT and OMPI_ALLOW_RUN_AS_ROOT_CONFIRM)

This approach aims to strike a balance between:

Usability: Users who require root privileges have a clear and straightforward way to enable them.
User Education: The warning message helps inform users about the risks involved, empowering them to make informed decisions.
OpenMPI Alignment: The warning message and explicit flag requirement align with OpenMPI's recommendations against running their software as root, reinforcing the importance of user awareness and explicit consent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority/1 To do after P0
Projects
None yet
Development

No branches or pull requests

1 participant