USBGuard / usbguard

USBGuard is a software framework for implementing USB device authorization policies (what kind of USB devices are authorized) as well as method of use policies (how a USB device may interact with the system)
https://usbguard.github.io/
GNU General Public License v2.0
1.1k stars 133 forks source link

outdated dbus docs on the web site #566

Open muelli opened 1 year ago

muelli commented 1 year ago

https://usbguard.github.io/documentation/dbus/doc-org.usbguard.Policy.html#gdbus-method-org-usbguard-Policy.listRules shows


listRules (IN  s     query,
           OUT a(us) ruleset);

but since 50c99211d512b963a8bcf271e316b65b967ab585 the "query" parameter got renamed. This caused me an hour of headache now to find out how to find rules with a label.

Can somebody please regenerate the docs?

And for my future self: Here is how I looked the rules up:

ubuntu@ubuntu-Standard-PC-Q35-ICH9-2009:~$ gdbus call --system --dest  org.usbguard1 --object-path /org/usbguard1/Policy  --method org.usbguard.Policy1.appendRule 'allow label "foo"' 1 true

ubuntu@ubuntu-Standard-PC-Q35-ICH9-2009:~$ gdbus call --system --dest  org.usbguard1 --object-path /org/usbguard1/Policy  --method org.usbguard.Policy1.listRules  "foo"
([(uint32 17, 'allow label "foo"'), (16, 'allow label "foo"'), (15, 'allow label "foo"')],)

$ busctl call --system org.usbguard1 /org/usbguard1/Policy   org.usbguard.Policy1 appendRule 'sub'  "allow label \"foo\"" 1 false
u 18

$ busctl call --system org.usbguard1 /org/usbguard1/Policy   org.usbguard.Policy1 listRules s  "foo"
a(us) 3 17 "allow label \"foo\"" 16 "allow label \"foo\"" 15 "allow label \"foo\""
muelli commented 1 year ago

also, is there a reference for the rule syntax? I would like to link to it from the appendRule documentation.

muelli commented 1 year ago

there is: https://usbguard.github.io/documentation/rule-language.html

but it's also outdated as it doesn't mention labels.