panel icon indicating copy to clipboard operation
panel copied to clipboard

Option to force SSH Key auth for SFTP

Open mathitux opened this issue 2 years ago • 4 comments

Is there an existing feature request for this?

  • [X] I have searched the existing issues before opening this feature request.

Describe the feature you would like to see.

Adding an option to force key authentication and thus block password authentication on SFTP would be a way to gain security.

With this option and a strong security policy, the only way to SFTP connect is with the key et to connect to the panel is with password + 2FA. So even if someone had the password, he can't login in panel or SFTP.

Describe the solution you'd like.

Add an option in the config.yml of wings to disable password auth on SFTP and force the usage of SSH Key. Like the "prohibit password" in SSHD configuration on Linux.

Additional context to this request.

Thank you for your time in considering this idea !

mathitux avatar Jun 08 '22 12:06 mathitux

Do you want this per-node, or just applied at the account level in the Panel, e.g. no one can login using your account without using an SSH key for SFTP.

DaneEveritt avatar Jun 08 '22 13:06 DaneEveritt

I was thinking of per-node but the idea of letting the user choose seems better :)

Moreover what would be even better is to do both, and that the node's setting bypass the user's one

mathitux avatar Jun 08 '22 13:06 mathitux

Allowing password login even when you've added an ssh key defeats the whole purpose of using ssh keys to improve security.

Disabling password login when adding an ssh key should be default or at least there should be an option in the user settings to disable it.

Bonus would be to have a global policy like the one for 2fa that can be enabled in the panel settings which disables password login for all users and thus forces ssh key login.

jorisguffens avatar Sep 21 '22 16:09 jorisguffens

Allowing password login even when you've added an ssh key defeats the whole purpose of using ssh keys to improve security.

Disabling password login when adding an ssh key should be default or at least there should be an option in the user settings to disable it.

Bonus would be to have a global policy like the one for 2fa that can be enabled in the panel settings which disables password login for all users and thus forces ssh key login.

While I agree with your point, SSH keys weren't added directly for the purpose of improving security, they were added to simplify the SFTP process by not requiring a working (and properly configured) system keyring to store your SFTP password or prompting the user for their password every time they decide to upload/download something.

I do still see this as being an important option to add, and luckily it isn't very complicated to implement.

matthewpi avatar Sep 21 '22 16:09 matthewpi

Any progress on this?

Also:

they were added to simplify the SFTP process

And yet they do provide security benefits, right? SSH key is not sent over network, more resistence to bruteforce attacks and etc.

realkarmakun avatar Mar 06 '23 20:03 realkarmakun

Any progress on this?

Also:

they were added to simplify the SFTP process

And yet they do provide security benefits, right? SSH key is not sent over network, more resistence to bruteforce attacks and etc.

Hello,

Yes they do !

The real problem today is that you can't use 2FA / MFA with SFTP (logically, this is not provided for in the protocol).

As a result, forcing the use of a key (which is much safer than a simple password) almost completely eliminates the risks of a password (if you also enable 2FA on the panel).

This means a huge gain in security.

mathitux avatar Oct 20 '23 22:10 mathitux