usbguard: add enable option, enable on temperance
This commit is contained in:
parent
5e51fdb596
commit
41b3d31129
2 changed files with 20 additions and 12 deletions
|
@ -80,6 +80,7 @@ in {
|
||||||
|
|
||||||
services = {
|
services = {
|
||||||
locate.enable = true;
|
locate.enable = true;
|
||||||
|
usbguard.enable = true;
|
||||||
|
|
||||||
media.mpd = {
|
media.mpd = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
|
@ -5,19 +5,26 @@
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (config.meta.mainUser) username;
|
inherit (config.meta.mainUser) username;
|
||||||
|
inherit (lib.modules) mkIf;
|
||||||
|
inherit (lib.options) mkEnableOption;
|
||||||
|
cfg = config.modules.services.usbguard;
|
||||||
in {
|
in {
|
||||||
environment.systemPackages = [pkgs.usbguard];
|
options.modules.services.usbguard.enable = mkEnableOption "usbguard";
|
||||||
services.usbguard = {
|
config = mkIf cfg.enable {
|
||||||
IPCAllowedUsers = ["root" "${username}"];
|
environment.systemPackages = [pkgs.usbguard];
|
||||||
presentDevicePolicy = "allow";
|
services.usbguard = {
|
||||||
rules = ''
|
enable = true;
|
||||||
allow with-interface equals { 08:*:* }
|
IPCAllowedUsers = ["root" "${username}"];
|
||||||
|
presentDevicePolicy = "allow";
|
||||||
|
rules = ''
|
||||||
|
allow with-interface equals { 08:*:* }
|
||||||
|
|
||||||
# Reject devices with suspicious combination of interfaces
|
# Reject devices with suspicious combination of interfaces
|
||||||
reject with-interface all-of { 08:*:* 03:00:* }
|
reject with-interface all-of { 08:*:* 03:00:* }
|
||||||
reject with-interface all-of { 08:*:* 03:01:* }
|
reject with-interface all-of { 08:*:* 03:01:* }
|
||||||
reject with-interface all-of { 08:*:* e0:*:* }
|
reject with-interface all-of { 08:*:* e0:*:* }
|
||||||
reject with-interface all-of { 08:*:* 02:*:* }
|
reject with-interface all-of { 08:*:* 02:*:* }
|
||||||
'';
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue