What are the Polkit variables utilized by the AptKit PolicyKit actions?
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 25/100
- Tipo di issue
- Documentazione
- Chiarezza
- Da chiarire
- Stato di attività
- Ferma
- Stack tecnologico
- linux, python
- Ambito
- backend, operating-systems
Direzione di ricerca
Inizia esaminando le azioni AptKit PolicyKit indicate nell’issue: org.aptkit.install-or-remove-packages, org.aptkit.install-purchased-packages e org.aptkit.upgrade-packages. Determina se le loro variabili di autorizzazione contengono nomi di pacchetti, quindi documenta i nomi delle variabili oppure dichiara chiaramente che la corrispondenza a livello di pacchetto non è disponibile.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
- Lingua principale
- Python
- Stelle
- 15
- Fork
- 10
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di linuxmint/aptkit
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 50/100
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 48/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
Tutte le issue di linuxmint/aptkit
Issue simili
-
essnmx good first issue
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 95/100
-
[Feature] 奇物选择添加优先级 Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
syfoud/Simulated_Scepter#174 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
Giskard-AI/giskard-oss#2840 · 1 commento ·
-
A claim comment carrying the issue number is silently declined while the workflow reports success Apertaarea: repo bug perceived difficulty: 2
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
yeti-platform/yeti#1380 ·