Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions nixos/modules/services/web-apps/zipline.nix
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,11 @@ in
ExecStart = lib.getExe cfg.package;

# Hardening
AmbientCapabilities = "";
CapabilityBoundingSet = [ "" ];
DeviceAllow = [ "" ];
DevicePolicy = "closed";
LockPersonality = true;
NoNewPrivileges = true;
PrivateDevices = true;
PrivateTmp = true;
PrivateUsers = true;
Expand All @@ -123,15 +125,18 @@ in
ProtectKernelTunables = true;
ProtectProc = "invisible";
ProtectSystem = "strict";
RestrictAddressFamilies = [
"AF_INET"
"AF_INET6"
"AF_UNIX"
];
RemoveIPC = true;
RestrictAddressFamilies = [ "AF_INET AF_INET6 AF_UNIX AF_NETLINK" ];
RestrictNamespaces = true;
RestrictRealtime = true;
RestrictSUIDSGID = true;
SystemCallArchitectures = "native";
SystemCallFilter = [
"@system-service"
"~@privileged"
"~@resources"
];
UMask = "0077";
};
};
};
Expand Down
13 changes: 13 additions & 0 deletions nixos/tests/zipline.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{ lib, ... }:

{
name = "zipline";
meta.maintainers = with lib.maintainers; [ defelo ];
Expand All @@ -20,6 +21,18 @@
networking.hosts."127.0.0.1" = [ "zipline.local" ];
};

interactive.nodes.machine = {
services.zipline.settings.CORE_HOSTNAME = lib.mkForce "0.0.0.0";
networking.firewall.allowedTCPPorts = [ 8000 ];
virtualisation.forwardPorts = [
{
from = "host";
host.port = 8000;
guest.port = 8000;
}
];
};

testScript = ''
import json
import re
Expand Down