Repository navigation
Backlog
Labels
0.kind: enhancementAdd something new or improve an existing system.9.needs: documentationThis needs to be documented well.
Description
Describe the problem
USBGuard seems like an excellent defence-in-depth solution, but it's a fairly risky thing to configure, since it can result in blocking devices which may be necessary to get things done, such as a keyboard. It's also difficult to test thoroughly, whether manually or automatically (see nixos/tests/usbguard.nix):
- Understanding how to add devices to QEMU and how USBGuard reports status is needed before testing can begin.
- Testing each rule exhaustively could be prohibitive.
Proposed solution
Some suggestions:
- Add a wiki page for USBGuard, explaining how to achieve common use cases. For example:
- How to use
usbguard generate-policyto create rules. - How to write your own NixOS tests for important devices, to avoid breaking your system even temporarily.
- How to add a device at runtime using the CLI.
- Are rules added at runtime persisted somewhere? If so, where? If not, when are the rules flushed? When unplugging? When logging out? When restarting the usbguard service?
- How to configure at least one desktop manager to show an interactive dialogue to allow or deny access when plugging in a new device.
- How to use
- Expand documentation for services.usbguard.*
- The
enableoption should explain what the user should expect to happen if they enable USBGuard and configure nothing else inservices.usbguard. I'm not sure whether this will change basically nothing, or result in every device being denied access. dbus.enableshould explain what it's used for. On my system it looks like it resulted in an extra rule,allow id *:* label "GNOME_SETTINGS_DAEMON_RULE". If I understand correctly, that allows every single device, and seems like it would defeat the purpose. If additional steps are needed, they should be done automatically or explained here.- Explain whether
IPCAllowedUsersorIPCAllowedGroupsare necessary for allowing new devices at runtime without root access.
- The
Notify maintainers
Note for maintainers: Please tag this issue in your pull request description. (i.e. Resolves #ISSUE.)
I assert that this issue is relevant for Nixpkgs
- I assert that this request is not already implemented in the latest NixOS or Nixpkgs manuals.
- I assert that this is not a duplicate of an existing documentation issue.
- I assert that I have read the NixOS Code of Conduct and agree to abide by it.
- I assert that I have read the automation/AI policy and that this issue report complies with it.
Is this issue important to you?
Add a 👍 reaction to issues you find important.
Reacted by Rafael Ieda and Thomas131
Metadata
Metadata
Assignees
Labels
0.kind: enhancementAdd something new or improve an existing system.9.needs: documentationThis needs to be documented well.
Projects
- StatusShow more project fieldsNo status
Activity