Azure / Azure/LinuxPatchExtension
Extension seems to unnecessarily checks if it has "sudo" access
- Lingua principale
- Python
- Stelle
- 12
- Fork
- 20
- Merge medio
- 6g 4h
- PR unite (30g)
- 1
Descrizione
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?
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Inizia leggendo EnvHealthManager.check_sudo_status e il percorso del codice che imposta hardcoded raise_if_not_sudo su True. Esamina i riferimenti alla configurazione di LinuxPatchExtension e waagent menzionati nell’issue, quindi determina un percorso di configurazione supportato. Verifica che l’installazione possa ignorare la convalida di sudoers quando è disabilitata senza compromettere il comportamento predefinito.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- azure, python
- Ambito
- cloud, devops
- Tipo di issue
- Funzionalità
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Tranquilla
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 48/100