mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-13 21:50:33 +03:00
nixos/sshd: add options for kexAlgorithms, ciphers and MACs
This commit is contained in:
parent
a9cd8ef23e
commit
ee3fd4ad53
1 changed files with 62 additions and 8 deletions
|
@ -213,6 +213,65 @@ in
|
||||||
description = "Files from which authorized keys are read.";
|
description = "Files from which authorized keys are read.";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
kexAlgorithms = mkOption {
|
||||||
|
type = types.listOf types.str;
|
||||||
|
default = [
|
||||||
|
"curve25519-sha256@libssh.org"
|
||||||
|
"diffie-hellman-group-exchange-sha256"
|
||||||
|
];
|
||||||
|
description = ''
|
||||||
|
Allowed key exchange algorithms
|
||||||
|
</para>
|
||||||
|
<para>
|
||||||
|
Defaults to recommended settings from both
|
||||||
|
<link xlink:href="https://stribika.github.io/2015/01/04/secure-secure-shell.html" />
|
||||||
|
and
|
||||||
|
<link xlink:href="https://wiki.mozilla.org/Security/Guidelines/OpenSSH#Modern_.28OpenSSH_6.7.2B.29" />
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
ciphers = mkOption {
|
||||||
|
type = types.listOf types.str;
|
||||||
|
default = [
|
||||||
|
"chacha20-poly1305@openssh.com"
|
||||||
|
"aes256-gcm@openssh.com"
|
||||||
|
"aes128-gcm@openssh.com"
|
||||||
|
"aes256-ctr"
|
||||||
|
"aes192-ctr"
|
||||||
|
"aes128-ctr"
|
||||||
|
];
|
||||||
|
description = ''
|
||||||
|
Allowed ciphers
|
||||||
|
</para>
|
||||||
|
<para>
|
||||||
|
Defaults to recommended settings from both
|
||||||
|
<link xlink:href="https://stribika.github.io/2015/01/04/secure-secure-shell.html" />
|
||||||
|
and
|
||||||
|
<link xlink:href="https://wiki.mozilla.org/Security/Guidelines/OpenSSH#Modern_.28OpenSSH_6.7.2B.29" />
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
macs = mkOption {
|
||||||
|
type = types.listOf types.str;
|
||||||
|
default = [
|
||||||
|
"hmac-sha2-512-etm@openssh.com"
|
||||||
|
"hmac-sha2-256-etm@openssh.com"
|
||||||
|
"umac-128-etm@openssh.com"
|
||||||
|
"hmac-sha2-512"
|
||||||
|
"hmac-sha2-256"
|
||||||
|
"umac-128@openssh.com"
|
||||||
|
];
|
||||||
|
description = ''
|
||||||
|
Allowed MACs
|
||||||
|
</para>
|
||||||
|
<para>
|
||||||
|
Defaults to recommended settings from both
|
||||||
|
<link xlink:href="https://stribika.github.io/2015/01/04/secure-secure-shell.html" />
|
||||||
|
and
|
||||||
|
<link xlink:href="https://wiki.mozilla.org/Security/Guidelines/OpenSSH#Modern_.28OpenSSH_6.7.2B.29" />
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
extraConfig = mkOption {
|
extraConfig = mkOption {
|
||||||
type = types.lines;
|
type = types.lines;
|
||||||
default = "";
|
default = "";
|
||||||
|
@ -363,14 +422,9 @@ in
|
||||||
HostKey ${k.path}
|
HostKey ${k.path}
|
||||||
'')}
|
'')}
|
||||||
|
|
||||||
### Recommended settings from both:
|
KexAlgorithms ${concatStringsSep "," cfg.kexAlgorithms}
|
||||||
# https://stribika.github.io/2015/01/04/secure-secure-shell.html
|
Ciphers ${concatStringsSep "," cfg.ciphers}
|
||||||
# and
|
MACs ${concatStringsSep "," cfg.macs}
|
||||||
# https://wiki.mozilla.org/Security/Guidelines/OpenSSH#Modern_.28OpenSSH_6.7.2B.29
|
|
||||||
|
|
||||||
KexAlgorithms curve25519-sha256@libssh.org,diffie-hellman-group-exchange-sha256
|
|
||||||
Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr
|
|
||||||
MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-512,hmac-sha2-256,umac-128@openssh.com
|
|
||||||
|
|
||||||
# LogLevel VERBOSE logs user's key fingerprint on login.
|
# LogLevel VERBOSE logs user's key fingerprint on login.
|
||||||
# Needed to have a clear audit track of which key was used to log in.
|
# Needed to have a clear audit track of which key was used to log in.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue