Azure / Azure/LinuxPatchExtension

Extension seems to unnecessarily checks if it has "sudo" access

Ouverte
#381 0 commentaires 1 réaction 0 personnes assignées Voir sur GitHub
Langage dominant
Python
Étoiles
12
Forks
20
Merge moyen
6 j 4 h
PR mergées (30 j)
1

Description

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?

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Commencez par lire EnvHealthManager.check_sudo_status et le chemin de code qui force raise_if_not_sudo à True. Examinez les références de configuration de LinuxPatchExtension et de waagent mentionnées dans l’issue, puis déterminez une voie de configuration prise en charge. Vérifiez que l’installation peut ignorer la validation de sudoers lorsqu’elle est désactivée, sans modifier le comportement par défaut.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
azure, python
Domaine
cloud, devops
Type d'issue
Fonctionnalité
Difficulté
4/5
Temps estimé
3-5 jours
Activité
Calme
Clarté
Plutôt claire
Accessibilité débutants
48/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.