You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
See the [Device attributes](#device-attributes) section for the list of available attributes and their syntax.
23
23
24
24
## Targets
25
25
@@ -41,15 +41,29 @@ In the rule, it's possible to use an asterisk character to match either any devi
41
41
42
42
### Device attributes
43
43
44
-
(Please see [issue #11](https://github.com/dkopecek/usbguard/issues/11) and comment on the proposed changes related to this section)
44
+
(Please see [issue #11](https://github.com/dkopecek/usbguard/issues/11) and comment on the changes related to this section)
45
45
46
-
Device attributes are specific value read from the USB device after it's inserted to the system. Which attributes are available is defined bellow. Some of the attributes are derived or based on attributes read directly from the device. The value of an attribute is represented as a double-quoted string.
46
+
Device attributes are specific value read from the USB device after it's inserted to the system. Which attributes are
47
+
available is defined bellow. Some of the attributes are derived or based on attributes read directly from the device.
48
+
The value of an attribute is represented as a double-quoted string.
*`hash "[0-9a-f]{32}"`: Match a hash of the device attributes (the hash is computed for every device by USBGuard).
53
+
*`name "device-name"`: Match the USB device name attribute.
54
+
*`serial "serial-number"`: Match the iSerial USB device attribute.
55
+
*`via-port "port-id"`: Match the USB port through which the device is connected.
56
+
*`via-port [operator] { "port-id" "port-id" ... }`: Match a set of USB ports.
57
+
*`with-interface interface-type`: Match an interface the USB device provides.
58
+
*`with-interface [operator] { interface-type interface-type ... }`: Match a set of interface types against the set of interfaces that the USB device provides.
59
+
60
+
`operator` is one of:
61
+
*`all-of`: The device attribute set must contain all of the specified values for the rule to match.
62
+
*`one-of`: The device attribute set must contain at least one of the specified values for the rule to match.
63
+
*`none-of`: The device attribute set must not contain any of the specified values for the rule to match.
64
+
*`equals`: The device attribute set must contain exactly the same set of values for the rule to match.
65
+
*`equals-ordered`: The device attribute set must contain exactly the same set of values in the same order for the rule to match.
66
+
67
+
`port-id` is a platform specific USB port identification. On Linux it's in the form "b-n" where `b` and `n` are unsigned integers (e.g. "1-2", "2-4", ...).
68
+
69
+
`interface-type` represents a USB interface and should be formated as three 8-bit numbers in hexadecimal base delimited by colon, i.e. `cc:ss:pp`. The numbers represent the interface class (`cc`), subclass (`ss`) and protocol (`pp`) as assigned by the [USB-IF](www.usb.org/about) ([List of assigned classes, subclasses and protocols](http://www.usb.org/developers/defined_class)). Instead of the subclass and protocol number, you may write an asterisk character (`\*`) to match all subclasses or protocols. Matching a specific class and a specific protocol is not allowed, i.e. if you use an asterisk as the subclass number, you have to use an asterisk for the protocol too.
0 commit comments