dotfiles/nixos/boxes/vultr1/snowflake.nix

41 lines
1.3 KiB
Nix
Raw Normal View History

2022-03-10 12:25:23 +00:00
{ config, pkgs, lib, ... }: {
2022-03-05 10:27:03 +00:00
containers.snowflake = {
autoStart = true;
ephemeral = true;
config = {
systemd.services.snowflake = {
wantedBy = [ "multi-user.target" ];
serviceConfig = {
IPAccounting = "yes";
ExecStart = "${pkgs.snowflake}/bin/proxy";
DynamicUser = "yes";
# Read-only filesystem
ProtectSystem = "strict";
PrivateDevices = "yes";
ProtectKernelTunables = "yes";
ProtectControlGroups = "yes";
ProtectHome = "yes";
# Deny access to as many things as possible
NoNewPrivileges = "yes";
PrivateUsers = "yes";
LockPersonality = "yes";
MemoryDenyWriteExecute = "yes";
ProtectClock = "yes";
ProtectHostname = "yes";
ProtectKernelLogs = "yes";
ProtectKernelModules = "yes";
RestrictNamespaces = "yes";
RestrictRealtime = "yes";
RestrictSUIDSGID = "yes";
SystemCallArchitectures = "native";
2022-03-10 12:25:23 +00:00
SystemCallFilter =
"~@chown @clock @cpu-emulation @debug @module @mount @obsolete @raw-io @reboot @setuid @swap @privileged @resources";
2022-03-05 10:27:03 +00:00
CapabilityBoundingSet = "";
ProtectProc = "invisible";
ProcSubset = "pid";
};
};
};
};
}