What are the Polkit variables utilized by the AptKit PolicyKit actions?
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 25/100
- Loại issue
- Tài liệu
- Độ rõ ràng
- Cần làm rõ
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- linux, python
- Lĩnh vực
- backend, operating-systems
Hướng nghiên cứu
Bắt đầu bằng cách kiểm tra các action AptKit PolicyKit được nêu trong issue: org.aptkit.install-or-remove-packages, org.aptkit.install-purchased-packages và org.aptkit.upgrade-packages. Xác định xem các biến ủy quyền của chúng có chứa tên gói hay không, sau đó ghi lại tên các biến hoặc nêu rõ rằng việc đối sánh ở cấp gói không khả dụng.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Modern PolicyKit utilizes JavaScript for authorization rules. The "Action" type supports the "lookup()" method, which is used to lookup the variables passed from the mechanism (in this case AptKit). Regarding package management on our company workstations, we construct rules to prevent users from installing/removing/upgrading certain packages while allowing such actions for other packages. This works very well with the PackageKit, Flatpak, and Synaptic PolicyKit actions - we can use regex to test if the applicable polkit variable contains the name of a package we want to restrict. Thus far we haven't been able to determine what polkit variables the AptKit PolicyKit actions are using.
So, is there someone who can provide the polkit variables used by the actions noted below? That is assuming variables are used and would contain the names of the packages.
org.aptkit.install-or-remove-packages
org.aptkit.install-purchased-packages
org.aptkit.upgrade-packages
For example, here are some trimmed rules that work for PackageKit, Flatpak, and Synaptic:
- PackageKit polkit action variable "package_ids" contains the package name
polkit.addRule(function(action, subject) {
if (action.id == "org.freedesktop.packagekit.package-downgrade" ||
action.id == "org.freedesktop.packagekit.package-install" ||
action.id == "org.freedesktop.packagekit.package-reinstall" ||
action.id == "org.freedesktop.packagekit.package-remove") {
if (RegExp('sssd','i').test(action.lookup("package_ids")) === true ||
RegExp('unattended','i').test(action.lookup("package_ids")) === true ||
RegExp('vnc','i').test(action.lookup("package_ids")) === true)
{
return polkit.Result.NO;
}
else {
return polkit.Result.YES;
}
}
});
- Flatpak polkit action variable "ref" contains the package name
polkit.addRule(function(action, subject) {
if (action.id == "org.freedesktop.Flatpak.app-install" ||
action.id == "org.freedesktop.Flatpak.app-uninstall") {
if (RegExp('torrent','i').test(action.lookup("ref")) === true ||
RegExp('dconf-editor','i').test(action.lookup("ref")) === true ||
RegExp('vnc','i').test(action.lookup("ref")) === true)
{
return polkit.Result.NO;
}
else {
return polkit.Result.YES;
}
}
});
- Synaptic polkit action variable "command_line" contains the package name
polkit.addRule(function(action, subject) {
if (action.id == "com.ubuntu.pkexec.synaptic") {
if (RegExp('linux-image','i').test(action.lookup("command_line")) === true)
{
return polkit.Result.NO;
}
else {
return polkit.Result.YES;
}
}
});
https://www.freedesktop.org/software/polkit/docs/latest/polkit.8.html
- Ngôn ngữ chính
- Python
- Star
- 15
- Fork
- 10
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của linuxmint/aptkit
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 50/100
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 48/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
Tất cả issue của linuxmint/aptkit
Issue tương tự
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
zostera/django-bootstrap4#894 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
use-agent-os/agent-os#3276 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
zephyrproject-rtos/zephyr#119726 ·
-
area/auth bug comp/agent P3 platform/discord type/security
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
NousResearch/hermes-agent#117848 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
zilliztech/memsearch#759 ·