Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

usbguard: 0.7.8 -> 1.0.0 #109296

Merged
merged 4 commits into from Jan 15, 2021
Merged

usbguard: 0.7.8 -> 1.0.0 #109296

merged 4 commits into from Jan 15, 2021

Conversation

06kellyjac
Copy link
Member

@06kellyjac 06kellyjac commented Jan 13, 2021

Motivation for this change

@tnias

Bump usbguard to 1.0.0, build "fully" from source*, nixpkgs-fmt, add longDescription

* (was previously built from source + pre-bundled with the submodules and some autoconfig)

λ ./result/bin/usbguard --help
 Usage: usbguard [OPTIONS] <command> [COMMAND OPTIONS] ...

 Options:

 Commands:
  get-parameter <name>           Get the value of a runtime parameter.
  set-parameter <name> <value>   Set the value of a runtime parameter.
  list-devices                   List all USB devices recognized by the USBGuard daemon.
  allow-device <id|rule|p-rule>  Authorize a device to interact with the system.
  block-device <id|rule|p-rule>  Deauthorize a device.
  reject-device <id|rule|p-rule> Deauthorize and remove a device from the system.

  list-rules                     List the rule set (policy) used by the USBGuard daemon.
  append-rule <rule>             Append a rule to the rule set.
  remove-rule <id>               Remove a rule from the rule set.

  generate-policy                Generate a rule set (policy) based on the connected USB devices.
  watch                          Watch for IPC interface events and print them to stdout.
  read-descriptor                Read a USB descriptor from a file and print it in human-readable form.

  add-user <name>                Add USBGuard IPC user/group (requires root privilges)
  remove-user <name>             Remove USBGuard IPC user/group (requires root privileges)

Contents:

result
├── bin
│   ├── usbguard
│   ├── usbguard-daemon
│   ├── usbguard-dbus
│   └── usbguard-rule-parser
├── etc
│   └── usbguard
│       ├── IPCAccessControl.d
│       ├── rules.conf
│       └── usbguard-daemon.conf
├── include
│   └── usbguard
│       ├── Audit.hpp
│       ├── ConfigFile.hpp
│       ├── Device.hpp
│       ├── DeviceManagerHooks.hpp
│       ├── DeviceManager.hpp
│       ├── Exception.hpp
│       ├── Interface.hpp
│       ├── IPCClient.hpp
│       ├── IPCServer.hpp
│       ├── KeyValueParser.hpp
│       ├── Logger.hpp
│       ├── MemoryRuleSet.hpp
│       ├── Policy.hpp
│       ├── Predicates.hpp
│       ├── RuleCondition.hpp
│       ├── Rule.hpp
│       ├── RuleSet.hpp
│       ├── Typedefs.hpp
│       ├── USBGuard.hpp
│       └── USB.hpp
├── lib
│   ├── libusbguard.la
│   ├── libusbguard.so -> libusbguard.so.1.0.0
│   ├── libusbguard.so.1 -> libusbguard.so.1.0.0
│   ├── libusbguard.so.1.0.0
│   └── pkgconfig
│       └── libusbguard.pc
├── sbin -> bin
├── share
│   ├── dbus-1
│   │   ├── system.d
│   │   │   └── org.usbguard1.conf
│   │   └── system-services
│   │       └── org.usbguard1.service
│   ├── man
│   │   ├── man1
│   │   │   └── usbguard.1.gz
│   │   ├── man5
│   │   │   ├── usbguard-daemon.conf.5.gz
│   │   │   └── usbguard-rules.conf.5.gz
│   │   └── man8
│   │       ├── usbguard-daemon.8.gz
│   │       └── usbguard-dbus.8.gz
│   └── polkit-1
│       └── actions
│           └── org.usbguard1.policy
└── var
    └── log
        └── usbguard
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS (x86_64)
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@06kellyjac
Copy link
Member Author

Result of nixpkgs-review pr 109296 run on x86_64-linux 1

1 package built:
  • usbguard (usbguard-nox)

@06kellyjac 06kellyjac marked this pull request as ready for review January 14, 2021 09:30
@06kellyjac
Copy link
Member Author

If you could do some in-depth testing to make sure building from source hasn't broken anything that'd be greatly appreciated @tnias 🙂

@06kellyjac
Copy link
Member Author

Result of nixpkgs-review pr 109296 run on x86_64-linux 1

1 package built:
  • usbguard (usbguard-nox)

Copy link
Member

@SuperSandro2000 SuperSandro2000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line 55:

++ lib.optional libgcrypt
++ lib.optional libsodium;

line 64:

++ lib.optional "--with-crypto-library=gcrypt"
++ lib.optional "--with-crypto-library=sodium";

pkgs/os-specific/linux/usbguard/default.nix Show resolved Hide resolved
@tnias
Copy link
Contributor

tnias commented Jan 14, 2021

I could successfully build and use this patch (d7cd8d7).

I tested basic functionality. This includes the new CLI partial rule feature, that was introduced in this release.

@06kellyjac
Copy link
Member Author

line 55:

++ lib.optional libgcrypt
++ lib.optional libsodium;

line 64:

++ lib.optional "--with-crypto-library=gcrypt"
++ lib.optional "--with-crypto-library=sodium";

Not sure what this means 😅

@SuperSandro2000
Copy link
Member

line 55:
++ lib.optional libgcrypt
++ lib.optional libsodium;
line 64:
++ lib.optional "--with-crypto-library=gcrypt"
++ lib.optional "--with-crypto-library=sodium";

Not sure what this means 😅

I can't write review comments on those lines but on a second look that won't work because we have no flag to enable something. It should be fine like this for now.

Copy link
Member

@SuperSandro2000 SuperSandro2000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM when the ? null in the inputs are removed.

@06kellyjac
Copy link
Member Author

? nulls removed

@SuperSandro2000
Copy link
Member

This is a semi-automatic executed nixpkgs-review which does not build all packages (e.g. lumo, tensorflow or pytorch)
If you find some bugs or got suggestions for further things to search or run please reach out to SuperSandro2000 on IRC.

Result of nixpkgs-review pr 109296 run on x86_64-linux 1

1 package built:
  • usbguard

@SuperSandro2000 SuperSandro2000 merged commit e87245d into NixOS:master Jan 15, 2021
@06kellyjac 06kellyjac deleted the usbguard branch January 15, 2021 19:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants