pterodactyl / panel

Pterodactyl® is a free, open-source game server management panel built with PHP, React, and Go. Designed with security in mind, Pterodactyl runs all game servers in isolated Docker containers while exposing a beautiful and intuitive UI to end users.
https://pterodactyl.io
Other
6.65k stars 1.68k forks source link

Option to force SSH Key auth for SFTP #4130

Open mathitux opened 2 years ago

mathitux commented 2 years ago

Is there an existing feature request for this?

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 !

DaneEveritt commented 2 years ago

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.

mathitux commented 2 years ago

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

jorisguffens commented 2 years ago

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.

matthewpi commented 2 years ago

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.

realkarmakun commented 1 year ago

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.

mathitux commented 11 months ago

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.