ma darth: init full-disk-encryption

This commit is contained in:
makefu 2017-08-16 11:49:17 +02:00
parent 5b35e728d1
commit 8f14ff2f54
No known key found for this signature in database
GPG Key ID: 36F7711F3FC0F225

View File

@ -3,44 +3,62 @@
with import <stockholm/lib>; with import <stockholm/lib>;
let let
byid = dev: "/dev/disk/by-id/" + dev; byid = dev: "/dev/disk/by-id/" + dev;
rootDisk = byid "ata-ADATA_SSD_S599_64GB_10460000000000000039"; rootDisk = byid "ata-INTEL_SSDSC2BW480H6_CVTR53120385480EGN";
auxDisk = byid "ata-HGST_HTS721010A9E630_JR10006PH3A02F"; bootPart = rootDisk + "-part1";
dataPartition = auxDisk + "-part1"; rootPart = rootDisk + "-part2";
allDisks = [ rootDisk ]; # auxDisk allDisks = [ rootDisk ]; # auxDisk
in { in {
imports = [ imports = [
<stockholm/makefu> <stockholm/makefu>
<stockholm/makefu/2configs/fs/single-partition-ext4.nix> <stockholm/makefu/2configs/fs/sda-crypto-root.nix>
<stockholm/makefu/2configs/sshd-totp.nix>
<stockholm/makefu/2configs/zsh-user.nix> <stockholm/makefu/2configs/zsh-user.nix>
<stockholm/makefu/2configs/smart-monitor.nix> <stockholm/makefu/2configs/smart-monitor.nix>
<stockholm/makefu/2configs/exim-retiolum.nix> <stockholm/makefu/2configs/exim-retiolum.nix>
<stockholm/makefu/2configs/virtualisation/libvirt.nix> # <stockholm/makefu/2configs/virtualisation/libvirt.nix>
<stockholm/makefu/2configs/tinc/retiolum.nix> <stockholm/makefu/2configs/tinc/retiolum.nix>
<stockholm/makefu/2configs/share/temp-share-samba.nix> <stockholm/makefu/2configs/tools/core.nix>
]; <stockholm/makefu/2configs/stats/client.nix>
services.samba.shares = { <stockholm/makefu/2configs/nsupdate-data.nix>
isos = {
path = "/data/isos/"; # SIEM
"read only" = "yes"; #<stockholm/makefu/2configs/tinc/siem.nix>
browseable = "yes"; # {services.tinc.networks.siem = {
"guest ok" = "yes"; # name = "sdarth";
}; # extraConfig = "ConnectTo = sjump";
}; # };
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
# <stockholm/makefu/2configs/share/temp-share-samba.nix>
#{
# services.samba.shares = {
# isos = {
# path = "/data/isos/";
# "read only" = "yes";
# browseable = "yes";
# "guest ok" = "yes";
# };
# };
#}
<stockholm/makefu/2configs/share/anon-ftp.nix>
];
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" ]; boot.kernelModules = [ "coretemp" "f71882fg" ];
hardware.enableAllFirmware = true; hardware.enableAllFirmware = true;
nixpkgs.config.allowUnfree = true; nixpkgs.config.allowUnfree = true;
@ -49,31 +67,28 @@ in {
firewall = { firewall = {
allowPing = true; allowPing = true;
logRefusedConnections = false; logRefusedConnections = false;
trustedInterfaces = [ "eno1" ]; # trustedInterfaces = [ "eno1" ];
allowedUDPPorts = [ 80 655 1655 67 ]; allowedUDPPorts = [ 80 655 1655 67 ];
allowedTCPPorts = [ 80 655 1655 ]; allowedTCPPorts = [ 80 655 1655 ];
}; };
# fallback connection to the internal virtual network # fallback connection to the internal virtual network
interfaces.virbr3.ip4 = [{ # interfaces.virbr3.ip4 = [{
address = "10.8.8.2"; # address = "10.8.8.2";
prefixLength = 24; # prefixLength = 24;
}]; # }];
}; };
# TODO smartd omo darth gum all-in-one # TODO smartd omo darth gum all-in-one
services.smartd.devices = builtins.map (x: { device = x; }) allDisks; services.smartd.devices = builtins.map (x: { device = x; }) allDisks;
zramSwap.enable = true;
#fileSystems."/data" = {
# device = dataPartition;
# fsType = "ext4";
#};
boot.loader.grub.device = rootDisk; boot.loader.grub.device = rootDisk;
boot.initrd.luks.devices = [
users.users.root.openssh.authorizedKeys.keys = [ { name = "luksroot";
config.krebs.users.makefu-omo.pubkey device = rootPart;
config.krebs.users.makefu-vbob.pubkey allowDiscards = true;
keyFileSize = 4096;
keyFile = "/dev/sdb";
}
]; ];
krebs.build.host = config.krebs.hosts.darth; krebs.build.host = config.krebs.hosts.darth;