mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2025-01-01 16:34:15 +03:00
security.rngd: start rngd during early boot to reduce entropy starvation due to encrypted swap and remove PrivateTmp to avoid a circular dependency
This commit is contained in:
parent
1ac86e14c7
commit
d14ba1e1ad
@ -39,12 +39,15 @@ in
|
|||||||
|
|
||||||
description = "Hardware RNG Entropy Gatherer Daemon";
|
description = "Hardware RNG Entropy Gatherer Daemon";
|
||||||
|
|
||||||
|
# rngd may have to start early to avoid entropy starvation during boot with encrypted swap
|
||||||
|
unitConfig.DefaultDependencies = false;
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
ExecStart = "${pkgs.rng-tools}/sbin/rngd -f"
|
ExecStart = "${pkgs.rng-tools}/sbin/rngd -f"
|
||||||
+ optionalString cfg.debug " -d";
|
+ optionalString cfg.debug " -d";
|
||||||
|
# PrivateTmp would introduce a circular dependency if /tmp is on tmpfs and swap is encrypted,
|
||||||
|
# thus depending on rngd before swap, while swap depends on rngd to avoid entropy starvation.
|
||||||
NoNewPrivileges = true;
|
NoNewPrivileges = true;
|
||||||
PrivateNetwork = true;
|
PrivateNetwork = true;
|
||||||
PrivateTmp = true;
|
|
||||||
ProtectSystem = "full";
|
ProtectSystem = "full";
|
||||||
ProtectHome = true;
|
ProtectHome = true;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user