From 8f14ff2f54167c8505de82f65d640a1bb0018f17 Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 16 Aug 2017 11:49:17 +0200 Subject: ma darth: init full-disk-encryption --- makefu/1systems/darth/config.nix | 93 +++++++++++++++++++++++----------------- 1 file changed, 54 insertions(+), 39 deletions(-) (limited to 'makefu/1systems') diff --git a/makefu/1systems/darth/config.nix b/makefu/1systems/darth/config.nix index 9dbe67429..7accb13d3 100644 --- a/makefu/1systems/darth/config.nix +++ b/makefu/1systems/darth/config.nix @@ -3,44 +3,62 @@ with import ; let byid = dev: "/dev/disk/by-id/" + dev; - rootDisk = byid "ata-ADATA_SSD_S599_64GB_10460000000000000039"; - auxDisk = byid "ata-HGST_HTS721010A9E630_JR10006PH3A02F"; - dataPartition = auxDisk + "-part1"; + rootDisk = byid "ata-INTEL_SSDSC2BW480H6_CVTR53120385480EGN"; + bootPart = rootDisk + "-part1"; + rootPart = rootDisk + "-part2"; allDisks = [ rootDisk ]; # auxDisk in { imports = [ - + + - + # - + + + + + # SIEM + # + # {services.tinc.networks.siem = { + # name = "sdarth"; + # extraConfig = "ConnectTo = sjump"; + # }; + # } + + # { + # makefu.forward-journal = { + # enable = true; + # src = "10.8.10.2"; + # dst = "10.8.10.6"; + # }; + # } + + ## Sharing + # + #{ + # services.samba.shares = { + # isos = { + # path = "/data/isos/"; + # "read only" = "yes"; + # browseable = "yes"; + # "guest ok" = "yes"; + # }; + # }; + #} + ]; - services.samba.shares = { - isos = { - path = "/data/isos/"; - "read only" = "yes"; - browseable = "yes"; - "guest ok" = "yes"; - }; - }; - services.tinc.networks.siem = { - name = "sdarth"; - extraConfig = "ConnectTo = sjump"; - }; - makefu.forward-journal = { - enable = true; - src = "10.8.10.2"; - dst = "10.8.10.6"; - }; - #networking.firewall.enable = false; + #networking.firewall.enable = false; + makefu.server.primary-itf = "enp0s25"; + krebs.hidden-ssh.enable = true; boot.kernelModules = [ "coretemp" "f71882fg" ]; hardware.enableAllFirmware = true; nixpkgs.config.allowUnfree = true; @@ -49,31 +67,28 @@ in { firewall = { allowPing = true; logRefusedConnections = false; - trustedInterfaces = [ "eno1" ]; + # trustedInterfaces = [ "eno1" ]; allowedUDPPorts = [ 80 655 1655 67 ]; allowedTCPPorts = [ 80 655 1655 ]; }; # fallback connection to the internal virtual network - interfaces.virbr3.ip4 = [{ - address = "10.8.8.2"; - prefixLength = 24; - }]; + # interfaces.virbr3.ip4 = [{ + # address = "10.8.8.2"; + # prefixLength = 24; + # }]; }; # TODO smartd omo darth gum all-in-one services.smartd.devices = builtins.map (x: { device = x; }) allDisks; - zramSwap.enable = true; - - #fileSystems."/data" = { - # device = dataPartition; - # fsType = "ext4"; - #}; boot.loader.grub.device = rootDisk; - - users.users.root.openssh.authorizedKeys.keys = [ - config.krebs.users.makefu-omo.pubkey - config.krebs.users.makefu-vbob.pubkey + boot.initrd.luks.devices = [ + { name = "luksroot"; + device = rootPart; + allowDiscards = true; + keyFileSize = 4096; + keyFile = "/dev/sdb"; + } ]; krebs.build.host = config.krebs.hosts.darth; -- cgit v1.2.3 From edb24e8d7ca7028217f4eebd0354e2f48ec2ef22 Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 16 Aug 2017 12:14:00 +0200 Subject: ma x: allow virtualbox firewall --- makefu/1systems/x/config.nix | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'makefu/1systems') diff --git a/makefu/1systems/x/config.nix b/makefu/1systems/x/config.nix index 368655575..8e8c8a736 100644 --- a/makefu/1systems/x/config.nix +++ b/makefu/1systems/x/config.nix @@ -42,6 +42,14 @@ with import ; + { + networking.firewall.allowedTCPPorts = [ 8080 ]; + networking.nat = { + enable = true; + externalInterface = "wlp3s0"; + internalInterfaces = [ "vboxnet0" ]; + }; + } # Services @@ -81,6 +89,7 @@ with import ; networking.firewall.enable = true; networking.firewall.allowedTCPPorts = [ 80 24800 26061 8000 3000 ]; networking.firewall.allowedUDPPorts = [ 665 26061 ]; + networking.firewall.trustedInterfaces = [ "vboxnet0" ]; krebs.build.host = config.krebs.hosts.x; -- cgit v1.2.3 From da17fa410386eb7aed50d3f9db61cb6e8c32582d Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 16 Aug 2017 12:09:18 +0200 Subject: ma gum: un-hardcode interface --- makefu/1systems/gum/config.nix | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'makefu/1systems') diff --git a/makefu/1systems/gum/config.nix b/makefu/1systems/gum/config.nix index bbb8cfe11..110edc130 100644 --- a/makefu/1systems/gum/config.nix +++ b/makefu/1systems/gum/config.nix @@ -9,6 +9,7 @@ let external-gw6 = "fe80::1"; external-netmask = 22; external-netmask6 = 64; + ext-if = "et0"; # gets renamed on the fly internal-ip = config.krebs.build.host.nets.retiolum.ip4.addr; main-disk = "/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi0-0-0-0"; in { @@ -41,6 +42,7 @@ in { + ## Web @@ -94,7 +96,7 @@ in { ]; }; - + makefu.server.primary-itf = ext-if; # access users.users = { @@ -120,7 +122,7 @@ in { # Network services.udev.extraRules = '' - SUBSYSTEM=="net", ATTR{address}=="${external-mac}", NAME="et0" + SUBSYSTEM=="net", ATTR{address}=="${external-mac}", NAME="${ext-if}" ''; boot.kernelParams = [ ]; networking = { @@ -152,14 +154,16 @@ in { 21032 ]; }; - interfaces.et0.ip4 = [{ - address = external-ip; - prefixLength = external-netmask; - }]; - interfaces.et0.ip6 = [{ - address = external-ip6; - prefixLength = external-netmask6; - }]; + interfaces."${ext-if}" = { + ip4 = [{ + address = external-ip; + prefixLength = external-netmask; + }]; + ip6 = [{ + address = external-ip6; + prefixLength = external-netmask6; + }]; + }; defaultGateway6 = external-gw6; defaultGateway = external-gw; nameservers = [ "8.8.8.8" ]; -- cgit v1.2.3