Azure / Azure/LinuxPatchExtension
Extension seems to unnecessarily checks if it has "sudo" access
- Lenguaje dominante
- Python
- Estrellas
- 12
- Forks
- 20
- Merge medio
- 6 d 4 h
- PR fusionados (30 d)
- 1
Descripción
Based on public docs everything the waagent runs, including VM extensions, are executed as root: https://learn.microsoft.com/en-us/azure/virtual-machines/extensions/features-linux?tabs=azure-cli#agent-permissions
I checked the source code and found the method EnvHealthManager.check_sudo_status that basically runs a "sudo id" command and checks if it gets a prompt for root password ("[sudo] password for username"). If so, the error "Sudo status check failed..." is raised and LinuxPatchExtension installation fails. Why?
I see there is an argument named raise_if_not_sudo that can skip /etc/sudoers validation, but it is hardcoded to "True" and I did not find anyway to replace it to False without manually changing extension binary.
Is it possible to add a setting in the waagent or LinuxPatchExtension config file to change this raise_if_not_sudo to False? I did not find anyway to do it without manually changing extension binary. The EXT will be executed as root, so why this is set to True? Is there any scenario the EXT does not run as root?
Guía de contribución
Línea de trabajo
Comienza leyendo EnvHealthManager.check_sudo_status y la ruta de código que establece raise_if_not_sudo en True. Revisa las referencias de configuración de LinuxPatchExtension y waagent mencionadas en el issue y, a continuación, determina una ruta de configuración compatible. Verifica que la instalación pueda omitir la validación de sudoers cuando esté deshabilitada sin romper el comportamiento predeterminado.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- azure, python
- Área
- cloud, devops
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Tranquilo
- Claridad
- Bastante claro
- Aptitud para principiantes
- 48/100