-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #154 from knuton/system-hardening
Limit powers of normal users in base system
- Loading branch information
Showing
5 changed files
with
46 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* Apply system hardening configuration. | ||
This module acts as a convenient way of disabling a number of standard | ||
NixOS/Linux functionalities that are not required for immutable kiosk | ||
operation. The idea is to disable them for additional system hardening, | ||
removing things that could do harm should the system fall into the hands of an | ||
attacker despite intrusion protection. | ||
It may be convenient to disable the hardening configuration during development | ||
at times. | ||
*/ | ||
{config, pkgs, lib, ... }: | ||
let | ||
cfg = config.playos.hardening; | ||
in | ||
{ | ||
options = { | ||
playos.hardening = with lib; { | ||
enable = mkEnableOption "Apply hardening options"; | ||
}; | ||
}; | ||
|
||
config = lib.mkIf cfg.enable { | ||
# There is no need for sudo | ||
security.sudo.enable = lib.mkForce false; | ||
|
||
# Nobody needs to use nix | ||
nix.settings.allowed-users = lib.mkForce [ "root" ]; | ||
|
||
# Do not include default packages | ||
environment.defaultPackages = lib.mkForce []; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters