summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorRicardo M. Correia <rcorreia@wizy.org>2015-01-19 18:11:54 +0100
committerRicardo M. Correia <rcorreia@wizy.org>2015-01-20 19:18:06 +0100
commita11dc2f0a347cbb9bb5baaf7365ece67c27feb66 (patch)
tree461809fa26bbf7831011214142cb1d77f7ddba4c /nixos
parent1df8208839e55959c6c5bb0984221a2d498af68a (diff)
downloadnixlib-a11dc2f0a347cbb9bb5baaf7365ece67c27feb66.tar
nixlib-a11dc2f0a347cbb9bb5baaf7365ece67c27feb66.tar.gz
nixlib-a11dc2f0a347cbb9bb5baaf7365ece67c27feb66.tar.bz2
nixlib-a11dc2f0a347cbb9bb5baaf7365ece67c27feb66.tar.lz
nixlib-a11dc2f0a347cbb9bb5baaf7365ece67c27feb66.tar.xz
nixlib-a11dc2f0a347cbb9bb5baaf7365ece67c27feb66.tar.zst
nixlib-a11dc2f0a347cbb9bb5baaf7365ece67c27feb66.zip
grsecurity: Add `denyUSB` option to grsec NixOS module
The option had been added to the grsec build-support code,
but it hadn't been added to the grsec module.

After this commit, grsec module users will be able to change
the default value. It also serves to document that this option
exists and that NixOS will disable it by default.
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/security/grsecurity.nix18
1 files changed, 18 insertions, 0 deletions
diff --git a/nixos/modules/security/grsecurity.nix b/nixos/modules/security/grsecurity.nix
index 5c8c49939510..d0c7fa6ec288 100644
--- a/nixos/modules/security/grsecurity.nix
+++ b/nixos/modules/security/grsecurity.nix
@@ -156,6 +156,24 @@ in
           '';
         };
 
+        denyUSB = mkOption {
+          type = types.bool;
+          default = false;
+          description = ''
+            If true, then set <literal>GRKERNSEC_DENYUSB y</literal>.
+
+            This enables a sysctl with name
+            <literal>kernel.grsecurity.deny_new_usb</literal>. Setting
+            its value to <literal>1</literal> will prevent any new USB
+            devices from being recognized by the OS.  Any attempted
+            USB device insertion will be logged.
+
+            This option is intended to be used against custom USB
+            devices designed to exploit vulnerabilities in various USB
+            device drivers.
+          '';
+        };
+
         restrictProc = mkOption {
           type = types.bool;
           default = false;