mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-14 06:00:33 +03:00
nixos/ebusd: fix device access
This commit is contained in:
parent
79a7ad1c21
commit
0c1feac497
1 changed files with 9 additions and 3 deletions
|
@ -155,7 +155,11 @@ in
|
|||
|
||||
config =
|
||||
let
|
||||
usesDev = lib.hasPrefix "/" cfg.device;
|
||||
usesDev = lib.any (prefix: lib.hasPrefix prefix cfg.device) [
|
||||
"/"
|
||||
"ens:/"
|
||||
"enh:/"
|
||||
];
|
||||
in
|
||||
lib.mkIf cfg.enable {
|
||||
systemd.services.ebusd = {
|
||||
|
@ -200,12 +204,14 @@ in
|
|||
|
||||
# Hardening
|
||||
CapabilityBoundingSet = "";
|
||||
DeviceAllow = lib.optionals usesDev [ cfg.device ];
|
||||
DeviceAllow = lib.optionals usesDev [
|
||||
(lib.removePrefix "ens:" (lib.removePrefix "enh:" cfg.device))
|
||||
];
|
||||
DevicePolicy = "closed";
|
||||
LockPersonality = true;
|
||||
MemoryDenyWriteExecute = false;
|
||||
NoNewPrivileges = true;
|
||||
PrivateDevices = usesDev;
|
||||
PrivateDevices = !usesDev;
|
||||
PrivateUsers = true;
|
||||
PrivateTmp = true;
|
||||
ProtectClock = true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue