forked from fort-nix/nix-bitcoin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
123 additions
and
58 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
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
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,44 @@ | ||
{ config, lib, pkgs, ... }: | ||
|
||
with lib; | ||
|
||
let | ||
defaultHardening = { | ||
PrivateTmp = "true"; | ||
ProtectSystem = "full"; | ||
ProtectHome = "true"; | ||
NoNewPrivileges = "true"; | ||
PrivateDevices = "true"; | ||
MemoryDenyWriteExecute = "true"; | ||
ProtectKernelTunables = "true"; | ||
ProtectKernelModules = "true"; | ||
ProtectControlGroups = "true"; | ||
RestrictAddressFamilies = "AF_UNIX AF_INET AF_INET6"; | ||
RestrictNamespaces = "true"; | ||
LockPersonality = "true"; | ||
IPAddressDeny = "any"; | ||
}; | ||
in | ||
{ | ||
inherit defaultHardening; | ||
# nodejs applications apparently rely on memory write execute | ||
nodejs = { MemoryDenyWriteExecute = "false"; }; | ||
# Allow tor traffic. Allow takes precedence over Deny. | ||
allowTor = { | ||
IPAddressAllow = "127.0.0.1/32 ::1/128"; | ||
}; | ||
# Allow any traffic | ||
allowAnyIP = { IPAddressAllow = "any"; }; | ||
|
||
enforceTor = mkOption { | ||
type = types.bool; | ||
default = false; | ||
description = '' | ||
"Whether to force Tor on a service by only allowing connections from and | ||
to 127.0.0.1;"; | ||
''; | ||
}; | ||
} | ||
|
||
|
||
|
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
Oops, something went wrong.