Azure / Azure/LinuxPatchExtension

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

Offen
#381 0 Kommentare 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Python
Sterne
12
Forks
20
Ø Merge
6 T. 4 Std.
Gemergte PRs (30 T.)
1

Beschreibung

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?

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginne mit dem Lesen von EnvHealthManager.check_sudo_status und des Codepfads, der raise_if_not_sudo fest auf True setzt. Prüfe die im Issue erwähnten Referenzen zur Konfiguration von LinuxPatchExtension und waagent und ermittle anschließend einen unterstützten Konfigurationspfad. Verifiziere außerdem, dass die Installation die sudoers-Validierung bei Deaktivierung überspringen kann, ohne das Standardverhalten zu beeinträchtigen.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
azure, python
Bereich
cloud, devops
Issue-Typ
Feature
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Ruhig
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
48/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.