USBGUARD(1) | USBGUARD(1) |
NAME
usbguard - USBGuard command-line interface
SYNOPSIS
usbguard [OPTIONS] <subcommand> [SUBCOMMAND-OPTIONS] ...
usbguard get-parameter name
usbguard set-parameter name value
usbguard list-devices
usbguard allow-device id | rule | partial-rule
usbguard block-device id | rule | partial-rule
usbguard reject-device id | rule | partial-rule
usbguard list-rules
usbguard append-rule rule
usbguard remove-rule id
usbguard generate-policy
usbguard watch
usbguard read-descriptor file
usbguard add-user name
usbguard remove-user name
DESCRIPTION
The usbguard command provides a command-line interface (CLI) to a running usbguard-daemon(8) instance. It also provides a tool for generating initial USBGuard policies based on USB devices connected to the system.
SUBCOMMANDS
get-parameter [OPTIONS] name
Get the value of a runtime parameter. Parameter name is one of InsertedDevicePolicy and ImplicitPolicyTarget.
Available options:
-h, --help
set-parameter [OPTIONS] name value
Set the value of a runtime parameter. Parameter name is one of InsertedDevicePolicy and ImplicitPolicyTarget.
Available options:
-v, --verbose
-h, --help
list-devices [OPTIONS]
List all USB devices recognized by the USBGuard daemon.
Available options:
-a, --allowed
-b, --blocked
-t, --tree
-h, --help
allow-device [OPTIONS] < id | rule | partial-rule >
Authorize a device to interact with the system. The device can be identified by either a device id, rule or partial-rule (rule without target). Both rule and partial-rule can be used to allow multiple devices at once. Note that id refers to the internal device-rule ID (the very first number of the list-devices command output) rather than the device’s ID attribute.
Available options:
-p, --permanent
-h, --help
block-device [OPTIONS] < id | rule | partial-rule >
Deauthorize a device. The device can be identified by either a device id, rule or partial-rule (rule without target). Both rule and partial-rule can be used to block multiple devices at once. Note that id refers to the internal device-rule ID (the very first number of the list-devices command output) rather than the device’s ID attribute.
Available options:
-p, --permanent
-h, --help
reject-device [OPTIONS] < id | rule | partial-rule >
Deauthorize and remove a device. The device can be identified by either a device id, rule or partial-rule (rule without target). Both rule and partial-rule can be used to reject multiple devices at once. Note that id refers to the internal device-rule ID (the very first number of the list-devices command output) rather than the device’s ID attribute.
Available options:
-p, --permanent
-h, --help
list-rules [OPTIONS]
List the rule set (policy) used by the USBGuard daemon.
Available options:
-d, --show-devices
-l, --label label
-h, --help
append-rule [OPTIONS] rule
Append the rule to the current rule set.
Available options:
-a, --after id
-t, --temporary
-h, --help
remove-rule [OPTIONS] id
Remove a rule identified by the rule id from the rule set.
Available options:
-h, --help
generate-policy [OPTIONS]
Generate a rule set (policy) which authorizes the currently connected USB devices.
Available options:
-p, --with-ports
-P, --no-ports-sn
-d, --devpath devpath
-t, --target target
-X, --no-hashes
-H, --hash-only
-L, --ldif
-b, --usbguardbase base
-o, --objectclass objectclass
-n, --name-prefix prefix
-h, --help
watch [OPTIONS]
Watch the IPC interface events and print them to stdout.
Available options:
-w, --wait
-o, --once
-e, --exec path
-h, --help
read-descriptor [OPTIONS] file
Read a USB descriptor from a file and print it in human-readable form.
Available options:
-h, --help
add-user name [OPTIONS]
Create an IPC access control file allowing the user/group identified by name to use the USBGuard IPC bus. The change takes effect only after restarting the usbguard-daemon(8) instance.
Available options:
-u, --user
-g, --group
-p, --policy privileges
-d, --devices privileges
-e, --exceptions privileges
-P, --parameters privileges
-h, --help
Privileges:
The privileges are expected to be in the form of a list separated by a colon:
$ sudo usbguard add-user joe --devices=listen,modify
Consult the usbguard-daemon.conf(5) man-page for a detailed list of available privileges in each section. You can also use ALL instead of privileges to automatically assign all relevant privileges to a given section.
remove-user name [OPTIONS]
Remove an IPC access control file associated with the user/group identified by name. The change takes effect only after restarting the usbguard-daemon(8) instance.
Available options:
-u, --user
-g, --group
-h, --help
EXAMPLES
Generating an initial policy:
$ sudo usbguard generate-policy > rules.conf $ vi rules.conf (review/modify the rule set) $ sudo install -m 0600 -o root -g root rules.conf /etc/usbguard/rules.conf $ sudo systemctl restart usbguard
Allow device(s):
# Allow a device by ID(it is the very first number from the list-devices command output) $ sudo usbguard allow-device 10 # Allow all devices named "Dell Wired Multimedia Keyboard" $ sudo usbguard allow-device name \"Dell Wired Multimedia Keyboard\"
SEE ALSO
usbguard-daemon(8), usbguard-daemon.conf(5), usbguard-rules.conf(5)
BUGS
If you find a bug in this software or if you’d like to request a feature to be implemented, please file a ticket at https://github.com/USBGuard/usbguard/issues/new.
AUTHOR
USBGuard was originally written by Daniel Kopeček. Many people have contributed to it.
RESOURCES
Main web site: https://usbguard.github.io/
COPYING
License GPLv2+: GNU GPL version 2 or later http://gnu.org/licenses/gpl.html. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.
09/23/2024 |