Skip to content

Commit

Permalink
Include test Yubikeys only in debug mode
Browse files Browse the repository at this point in the history
Signed-off-by: Samuli Leivo <[email protected]>
  • Loading branch information
leivos-unikie authored and brianmcgillion committed Aug 6, 2024
1 parent 6219563 commit 3e31099
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 0 deletions.
15 changes: 15 additions & 0 deletions modules/common/development/authorized_yubikeys.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright 2022-2024 TII (SSRC) and the Ghaf contributors
# SPDX-License-Identifier: Apache-2.0
{
authorizedYubikeys = [
# Yubikey public keys for testing team, enabled only in debug mode
#1
"ghaf:3HbulvTWYKkZEX6VaFX/EWLUp2FwHMUQQvhi8dGjOd1U+5gUxarLyqGcVzeAte5wpvTGkcRckcfN3Ce9iK0smA==,/j1T0Z4vNv72218WkRemtSMaqv4ysw6Oa6Db8KnLFczv5DxzBhHj+e3kinNX89wvwJWe9XlxPQqE54jmzi227w==,es256,+presence"
#2
"ghaf:fkBGKisgW8B1AAQDe6l6QWMbvaM3vfIahYwnlWcyKoI0aM62hPBL3l1x5IUyQy41kpe1+nbR4K6KX43utDz7kA==,nEVF0RHTNpzRvem1Ng3KnHhlXXj28tvQvbA+YF39p6fzJpq0t9czGb85kmPms9pGquQiOFTDrEURUmdC6PA8Ng==,es256,+presence"
#3
"ghaf:zQlVob4+w3DcvtN6BPjBPaEssJ3PYNSQVlWLk/Uq/Qlbqk9D0IjPjZDm5XwTuKhropVR1hVA4XdZKsSs9BlUEQ==,G3qgBAhmCwANuCdCZzo68QLFFQ4aud/a3X5r1m8UeUpMh5BlDHrHAR0sE0H/d4v7RiScex2TZaHrgYV507BFRA==,es256,+presence"
#4
"ghaf:QaA1B4u1GzLt+HSwXpMxmdCOKiBN4WZSUAuEXZahNSpcv8xiYagp0ntVsl8TOx4K+sKls3gTn37Uso/dmncwdA==,mr0Nhwkok7VLUtkBMryOA0lZghU23SCYtU3CZeW5P4WVtnPax3N/6GkfuAv6Zw5ejC4BDvov3oKHTQT/F8eYqA==,es256,+presence"
];
}
1 change: 1 addition & 0 deletions modules/common/development/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@
./usb-serial.nix
./nix.nix
./ssh.nix
./yubikey.nix
];
}
19 changes: 19 additions & 0 deletions modules/common/development/yubikey.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright 2022-2024 TII (SSRC) and the Ghaf contributors
# SPDX-License-Identifier: Apache-2.0
{
config,
lib,
...
}: let
cfg = config.ghaf.development.yubikey;
inherit ((import ./authorized_yubikeys.nix)) authorizedYubikeys;
inherit (lib) mkEnableOption mkIf concatStrings mkForce;
in {
options.ghaf.development.yubikey = {
enable = mkEnableOption "Yubikey test";
};

config = mkIf cfg.enable {
ghaf.services.yubikey.u2fKeys = mkForce (concatStrings authorizedYubikeys);
};
}
1 change: 1 addition & 0 deletions modules/common/profiles/debug.nix
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ in {
debug.tools.enable = true;
# Let us in.
ssh.daemon.enable = true;
yubikey.enable = true;
usb-serial.enable = true;
};
};
Expand Down

0 comments on commit 3e31099

Please sign in to comment.