Skip to content

Missing Documentation: usbguard #596649

Backlog
Backlog

Description

@l0b0

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-policy to 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.
  • Expand documentation for services.usbguard.*
    • The enable option should explain what the user should expect to happen if they enable USBGuard and configure nothing else in services.usbguard. I'm not sure whether this will change basically nothing, or result in every device being denied access.
    • dbus.enable should 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 IPCAllowedUsers or IPCAllowedGroups are necessary for allowing new devices at runtime without root access.

Notify maintainers

@fpletz @tnias


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

Is this issue important to you?

Add a 👍 reaction to issues you find important.

Activity

  1. added
    0.kind: enhancement
    9.needs: documentation
    on Dec 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    0.kind: enhancement9.needs: documentation

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions