Azure / Azure/LinuxPatchExtension
Extension seems to unnecessarily checks if it has "sudo" access
- Ngôn ngữ chính
- Python
- Star
- 12
- Fork
- 20
- Merge trung bình
- 6 ngày 4 giờ
- Pull request đã merge (30 ngày)
- 1
Mô tả
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?
Hướng dẫn đóng góp
Hướng nghiên cứu
Bắt đầu bằng cách đọc EnvHealthManager.check_sudo_status và đường dẫn mã đặt cứng raise_if_not_sudo thành True. Xem lại các tham chiếu cấu hình LinuxPatchExtension và waagent được đề cập trong issue, sau đó xác định một đường dẫn cấu hình được hỗ trợ. Xác minh rằng quá trình cài đặt có thể bỏ qua việc xác thực sudoers khi bị vô hiệu hóa mà không làm hỏng hành vi mặc định.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- azure, python
- Lĩnh vực
- cloud, devops
- Loại issue
- Tính năng
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Ít trao đổi
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 48/100