Skip to content
This repository has been archived by the owner on Dec 26, 2020. It is now read-only.

Possibility for customising host key algorithms? #243

Closed
aodj opened this issue Oct 2, 2019 · 2 comments
Closed

Possibility for customising host key algorithms? #243

aodj opened this issue Oct 2, 2019 · 2 comments
Assignees

Comments

@aodj
Copy link

aodj commented Oct 2, 2019

Is your feature request related to a problem? Please describe.
I was using ssh-audit to inspect my ssh configurations, and after applying the ansible-ssh-hardening role it suggests removing the ecdsa-sha2-nistp256 algorithm from the permitted host key algorithms due to a potential for revealing the key with a weak RNG.

Describe the solution you'd like
Allow customization of host key algorithms.

Describe alternatives you've considered
Manual intervention

Additional context
Here's the output from running ssh-audit:

$ ssh-audit -24 mysshserver.local
# general
(gen) banner: SSH-2.0-OpenSSH_7.4
(gen) software: OpenSSH 7.4
(gen) compatibility: OpenSSH 7.2+, Dropbear SSH 2013.62+
(gen) compression: enabled ([email protected])

# key exchange algorithms
(kex) [email protected]          -- [info] available since OpenSSH 6.5, Dropbear SSH 2013.62
(kex) diffie-hellman-group-exchange-sha256 (2048-bit) -- [info] available since OpenSSH 4.4

# host-key algorithms
(key) ssh-rsa (2048-bit)                    -- [info] available since OpenSSH 2.5.0, Dropbear SSH 0.28
(key) rsa-sha2-512 (2048-bit)               -- [info] available since OpenSSH 7.2
(key) rsa-sha2-256 (2048-bit)               -- [info] available since OpenSSH 7.2
(key) ecdsa-sha2-nistp256                   -- [fail] using weak elliptic curves
                                            `- [warn] using weak random number generator could reveal the key
                                            `- [info] available since OpenSSH 5.7, Dropbear SSH 2013.62
(key) ssh-ed25519                           -- [info] available since OpenSSH 6.5

# encryption algorithms (ciphers)
(enc) [email protected]         -- [info] available since OpenSSH 6.5
                                            `- [info] default cipher since OpenSSH 6.9.
(enc) [email protected]                -- [info] available since OpenSSH 6.2
(enc) [email protected]                -- [info] available since OpenSSH 6.2
(enc) aes256-ctr                            -- [info] available since OpenSSH 3.7, Dropbear SSH 0.52
(enc) aes192-ctr                            -- [info] available since OpenSSH 3.7
(enc) aes128-ctr                            -- [info] available since OpenSSH 3.7, Dropbear SSH 0.52

# message authentication code algorithms
(mac) [email protected]              -- [info] available since OpenSSH 6.2
(mac) [email protected]         -- [info] available since OpenSSH 6.2
(mac) [email protected]         -- [info] available since OpenSSH 6.2

# fingerprints
(fin) ssh-ed25519: SHA256:xxxx
(fin) ssh-rsa: SHA256:xxxx

# algorithm recommendations (for OpenSSH 7.4)
(rec) -ecdsa-sha2-nistp256                  -- key algorithm to remove
(rec) +curve25519-sha256                    -- kex algorithm to append
(rec) +diffie-hellman-group14-sha256        -- kex algorithm to append
(rec) +diffie-hellman-group16-sha512        -- kex algorithm to append
(rec) +diffie-hellman-group18-sha512        -- kex algorithm to append

Of note are the recommendations at the bottom.

@rndmh3ro
Copy link
Member

rndmh3ro commented Oct 5, 2019

Hey @aodj,

right now we do not have the possibility to manage HostKeyAlgorithms. If you want to implement this feature, feel free to submit a PR!

@schurzi
Copy link
Contributor

schurzi commented Jul 8, 2020

Hey @aodj,

with #278 merged this should be possible since release 8.1.0. Can you test this in your environment and confirm that it is working for you?

@schurzi schurzi closed this as completed Jul 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants