Extension seems to unnecessarily checks if it has "sudo" access
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
Research direction
Start by reading EnvHealthManager.check_sudo_status and the code path that hardcodes raise_if_not_sudo to True. Review the LinuxPatchExtension and waagent configuration references mentioned in the issue, then determine a supported configuration path and verify that installation can skip the sudoers validation when disabled without breaking the default behavior.
Written by the indexing model from the issue text.
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?
- Dominant language
- Python
- Stars
- 12
- Forks
- 20
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 2
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Azure/LinuxPatchExtension
-
Difficulty 2/5 Half a day Newbie friendliness 68/100
Azure/LinuxPatchExtension#350 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
Azure/LinuxPatchExtension#369 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 52/100
Azure/LinuxPatchExtension#339 · 3 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 55/100
Azure/LinuxPatchExtension#337 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 38/100
Azure/LinuxPatchExtension#335 ·
All issues in Azure/LinuxPatchExtension
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100