-
Notifications
You must be signed in to change notification settings - Fork 153
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
Wip keep server host cert #712
base: develop
Are you sure you want to change the base?
Conversation
Can you say a little more about your use case here? When a server presents a certificate, the existing SSH client code in AsyncSSH already verifies that one of the principals in the certificate (if there are any) matches the hostname or IP of the server you requested to connect to. So, it shouldn't be necessary for you to do that check yourself. On the server side, a similar thing happens when accepting client certs over public key auth. In that case, the server verifies that the certificate presented has a principal which matches the user name that the client requested to authenticate as. Also, on the server side AsyncSSH already stores key/certificate options that you can query to check if particular features are enabled for that specific key used to authenticate (via directives in authorized_keys) or the certificate used to authenticate. You can use functions like |
I need to validate that there was no IP spoofing (in an environment where it is possible to have signed certificates, for a given fqdn). I had thought of 2 things, otherwise:
Edit : it's on an admin IP, not the one on the DNS record |
Sorry, I'm still not quite following what you're trying to do. How does your check differ from what AsyncSSH is already doing to validate the destination of the connect() call against the principals in the returned server certificate? Can you provide some example code of what the connect() call and your validation would look like, if you had a way to query the server cert? |
In my case, a machine does not boot with all the network layer, it has 2 IPs:
|
Thanks for the explanation - that helped. If the contain is going to IP X and that's not in the cert, you'll need more than just storing a copy of the certificate, as AsyncSSH's principal check will fail when the connection is opened. As you said, the only function which you can override here, though, is Perhaps you could use a host key alias here. If you know you are going to need to validate against hostname Y when you are connecting to IP X, you can add a |
What do you think about being able to keep and consult the certificate of the host server?
Personally, I use it to make sure that the host corresponds to the right IP (with several hosts having the same certificate authority)