Skip to content

Commit 6de7ea7

Browse files
committed
secrets: switch to layer02
1 parent 2b70cc0 commit 6de7ea7

File tree

7 files changed

+32
-19
lines changed

7 files changed

+32
-19
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ your needs. Installing is then as simple as running
3838
sudo nixos-install
3939
```
4040

41+
Don't forget to change your initial hashed password at boot for headfull, they
42+
are written to the world readable nix store! Someone could try to LPE by
43+
brute-forcing them.
44+
4145
## Contributing
4246

4347
Do not forget to run `pre-commit install` to get the formatting hooks running

profiles/headfull.nix

Lines changed: 28 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@ with lib;
3737

3838
# headfull main user is essentially an admin, reflect that by giving it the
3939
# wheel group
40-
# TODO, XXX, TOFIX: the shadows are probably written in the nix store, do we
41-
# care about that?
4240
users.users.${config.navi.username} = {
4341
extraGroups = [ "wheel" ];
4442
hashedPassword = fileContents ./../secrets/headfull/assets/shadow/main;
@@ -58,11 +56,37 @@ with lib;
5856
jack.enable = true;
5957
};
6058

59+
60+
age.secrets.gpg-key = {
61+
path = "/home/${config.navi.username}/.config/gnupg/key.gpg";
62+
owner = config.navi.username;
63+
};
64+
65+
# store our distbuild key so we can login to our infra
66+
age.secrets.ssh-distbuild = {
67+
path = "/etc/distbuild_ssh";
68+
owner = "0";
69+
group = "0";
70+
mode = "0400";
71+
};
72+
73+
age.secrets.ssh-navi = {
74+
path = "/etc/navi_ssh";
75+
owner = "0";
76+
group = "0";
77+
mode = "0400";
78+
};
79+
80+
age.secrets.ssh-navi-2 = {
81+
path = "/home/${config.navi.username}/.ssh/id_ed25519";
82+
owner = config.navi.username;
83+
mode = "0400";
84+
};
85+
86+
6187
# we setup the personal ssh and gpg key of our headfull user
6288
home-manager.users.${config.navi.username} = {
63-
home.file.".config/gnupg/key.gpg".source = ./../secrets/headfull/assets/gpg/key.gpg;
6489
home.file.".config/gnupg/trust.txt".source = ./../secrets/headfull/assets/gpg/gpg-trust.txt;
65-
home.file.".ssh/id_ed25519".source = ./../secrets/headfull/assets/ssh/navi;
6690
home.file.".ssh/id_ed25519.pub".source = ./../secrets/common/assets/ssh/navi.pub;
6791

6892
home.file.".config/gnupg/gpg.conf".text = ''
@@ -71,21 +95,6 @@ with lib;
7195
'';
7296
};
7397

74-
environment.etc."navi_ssh" = {
75-
text = builtins.readFile ./../secrets/headfull/assets/ssh/navi;
76-
mode = "0400";
77-
uid = 0;
78-
gid = 0;
79-
};
80-
81-
# store our distbuild key so we can login to our infra
82-
environment.etc."distbuild_ssh" = {
83-
text = builtins.readFile ./../secrets/headfull/assets/ssh/distbuild;
84-
mode = "0400";
85-
uid = 0;
86-
gid = 0;
87-
};
88-
8998
# setup the distbuild account; while this might look like a backdoor for
9099
# lesser privilege devices the distbuild access key is only given to at
91100
# least headfull devices, thus headless devices cannot ssh into headfull.

secrets/headfull/assets/gpg/key.gpg

389 Bytes
Binary file not shown.

secrets/headfull/assets/ssh/distbuild

451 Bytes
Binary file not shown.

secrets/headfull/assets/ssh/navi

376 Bytes
Binary file not shown.

secrets/headfull/default.nix

-20 Bytes
Binary file not shown.

secrets/headfull/girls.nix

626 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)