Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEAT] - please support signed host keys #2277

Open
harridu opened this issue Jul 29, 2023 · 6 comments
Open

[FEAT] - please support signed host keys #2277

harridu opened this issue Jul 29, 2023 · 6 comments
Labels

Comments

@harridu
Copy link

harridu commented Jul 29, 2023

Is this feature for paramiko acting as a client or a server?

Client

What functionality does this feature request relate to?

known_hosts

For client-side features, does this relate to a specific type of SSH server?

No response

If you're using paramiko as part of another tool, which tool/version?

No response

Desired behavior

Host keys are very hard to verify. I would guess that nobody really does. To mitigate the problem openssh supports signed host keys. Apparently paramiko throws an internal error if the peers host key is signed. At least dput-ng (the Debian package based upon paramiko) does.

It would be very nice if paramiko could support signed host keys as well.

Anything else?

No response

@bskinn
Copy link
Contributor

bskinn commented Aug 15, 2023

#771 and the associated #2270 should allow paramiko to at least parse entries in known_hosts that have the @cert-authority marker.

Are you also requesting that paramiko implement the ability to verify the host cert against a CA?

Or will the "it will at least parse ok" functionality of #2270 suffice for your needs?

@smammy
Copy link

smammy commented Aug 17, 2023

No idea what @harridu's intent was, but I'd like to request that Paramiko implement the ability to verify the host cert against a CA. 😁

@bskinn
Copy link
Contributor

bskinn commented Aug 17, 2023

No idea what @harridu's intent was, but I'd like to request that Paramiko implement the ability to verify the host cert against a CA. 😁

Noted. You may consider the feature requested. 😄

@bskinn bskinn added Feature request eval needed Triage -> maintainer signal Keys labels Aug 17, 2023
@harridu
Copy link
Author

harridu commented Aug 17, 2023

Sorry, I should have provided more information right from the start. Paramiko throws an exception, if the host key is signed:

SFTP error uploading to myhost.example.com: BadHostKeyException('myhost.example.com', <paramiko.ed25519key.Ed25519Key object at 0x7f5d06ba3f10>, <paramiko.rsakey.RSAKey object at 0x7f5d07539390>)

To create a signed host key using openssh, please check the various guidelines on the net, eg. https://www.lorier.net/docs/ssh-ca.html. I have to admit, I have no idea whether this signed host key thing is a standard feature supported by other ssh implementations as well.

Paramiko is version 2.12.0, as included in Debian 12. Python is version 3.11.2

Hope this helps.

@bskinn
Copy link
Contributor

bskinn commented Aug 17, 2023

Hm... as best I understand, signed key creation would be yet another feature... so, a third:

  1. Don't explode when a key is signed; use it successfully, but without verification (Add markers to known_hosts parser re paramiko#771 #2270)
  2. Actually CA-verify a signed key, beyond just using it (this feature request ticket)
  3. Provide functionality to create signed host keys

To make sure I understand - are you requesting that paramiko support (3), @harridu? Or were you only describing key creation for context?


My two cents... I'm skeptical of whether bitprophet would consider (3) as in-scope for paramiko. I don't think the project is aiming to be a Python interface for the totality of the OpenSSH tool/suite, just the parts dealing with connecting to and communicating with clients/servers.

@harridu
Copy link
Author

harridu commented Aug 20, 2023

I would be happy with (2)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants