Skip to content

Commit

Permalink
Merge pull request #158 from serokell/sereja/OPS-1161-add-withHardeni…
Browse files Browse the repository at this point in the history
…ngProfile

[OPS-1161] Add `withHardeningProfile` helper
  • Loading branch information
Sereja313 authored Mar 13, 2024
2 parents 99becbe + 048a0ad commit b6bbeda
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

haskell = import ./haskell.nix { inherit lib nixpkgs; inherit (cabal) getTestedWithVersions; };

systemd = import ./systemd;
systemd = import ./systemd { inherit lib; };

types = import ./types.nix { inherit lib; };

Expand Down
6 changes: 6 additions & 0 deletions lib/systemd/default.nix
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
{ lib }:
{

hardeningProfiles = import ./profiles.nix;

hardenServices = import ./harden-services.nix;

userLevelServices = import ./user-level-services.nix;

withHardeningProfile = profile: serviceConfig: lib.mkMerge [
(builtins.mapAttrs (_: lib.mkDefault) profile)
serviceConfig
];
}
1 change: 0 additions & 1 deletion lib/systemd/profiles.nix
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ rec {
# "~CLONE_NEWUTS"
# ];
RestrictNamespaces = "yes";
DeviceAllow = "no";
IPAddressDeny = "any";
KeyringMode = "private";
NoNewPrivileges = "yes";
Expand Down

0 comments on commit b6bbeda

Please sign in to comment.