URL: https://github.com/SSSD/sssd/pull/744 Author: thalman Title: #744: ssh: sssd_ssh fails completely on p11_child timeout Action: opened
PR body: """ When p11_child fails or timeout is reached, ssh login fails. With this patch sssd_ssh proceeds to ssh key and password login.
Resolves: https://pagure.io/SSSD/sssd/issue/3937 """
To pull the PR as Git branch: git remote add ghsssd https://github.com/SSSD/sssd git fetch ghsssd pull/744/head:pr744 git checkout pr744
URL: https://github.com/SSSD/sssd/pull/744 Title: #744: ssh: sssd_ssh fails completely on p11_child timeout
jhrozek commented: """ Currently both the timeout and e.g. a failure to set up child process handlers returns ERR_P11_CHILD. Would it make more sense to perhaps return a timeout error and then only ignore that error?
Or was the idea behind the path that since the output is just a public key, we can go on? But shouldn't the code fall through in that case instead of ending with success? """
See the full comment at https://github.com/SSSD/sssd/pull/744#issuecomment-460810878
URL: https://github.com/SSSD/sssd/pull/744 Title: #744: ssh: sssd_ssh fails completely on p11_child timeout
thalman commented: """
Or was the idea behind the path that since the output is just a public key, we can go on? But shouldn't the code fall through in that case instead of ending with success?
IMO we should ignore any error from p11_child. Just log it and continue. The idea comes from normal ssh behaviour - if there is any error in one authentication method, ssh continues with next one. """
See the full comment at https://github.com/SSSD/sssd/pull/744#issuecomment-460969821
URL: https://github.com/SSSD/sssd/pull/744 Title: #744: ssh: sssd_ssh fails completely on p11_child timeout
sumit-bose commented: """ Hi,
I was thinking back and forth but finally I think it is best to solve the issue this way.
Originally I thought that the timeout handling should be changed in the cert_to_ssh_key-request so that the timeout is treated as a failed validation and the next certificate in the list is send for validation. And that in ssh_get_output_keys_done() the cert_to_ssh_key-request is run with list of certificates from state->user_cert_override as well. With this we would try to get as much keys as possible from the available certificates.
But if there are still certificates left in the list there is a fair chance that the validation of those will run into a timeout as well if e.g. the system is offline and the time the user has to wait for ssh authentication to continue would increase quite a bit.
So I agree that it is a good idea to just stop and continue as the patch does.
I like the @jhrozek's suggestion to let the timeout handler return a dedicated timeout error. With this a more specific log message can be added saying that ssh-key from certificate are ignored due to a timeout while trying to validate the certificates. And that p11_child_timeout option can be increased if it is expect that validation is slow.
Finally I would change the comment to something like 'ignore ssh keys from certificates and return what we already have'. As you can see in ssh_get_output_keys_send() there might already be plain ssh keys from the user's LDAP object or from an override in the elements array which is later returned to the caller.
bye, Sumit """
See the full comment at https://github.com/SSSD/sssd/pull/744#issuecomment-461770132
URL: https://github.com/SSSD/sssd/pull/744 Title: #744: ssh: sssd_ssh fails completely on p11_child timeout
jhrozek commented: """ I finally got to testing this patch. It works fine, but I would just ask you to amend the debug message. Currently it just says "cert_to_ssh_key request failed.", I would like the message to be amended to something like "cert_to_ssh_key request failed, not fatal, but ssh keys derived from certificates will be skipped".
This is in addition to the time out error code Sumit requested. """
See the full comment at https://github.com/SSSD/sssd/pull/744#issuecomment-462909971
URL: https://github.com/SSSD/sssd/pull/744 Title: #744: ssh: sssd_ssh fails completely on p11_child timeout
Label: +Changes requested
URL: https://github.com/SSSD/sssd/pull/744 Author: thalman Title: #744: ssh: sssd_ssh fails completely on p11_child timeout Action: synchronized
To pull the PR as Git branch: git remote add ghsssd https://github.com/SSSD/sssd git fetch ghsssd pull/744/head:pr744 git checkout pr744
URL: https://github.com/SSSD/sssd/pull/744 Title: #744: ssh: sssd_ssh fails completely on p11_child timeout
Label: -Changes requested
URL: https://github.com/SSSD/sssd/pull/744 Title: #744: ssh: sssd_ssh fails completely on p11_child timeout
jhrozek commented: """ Thank you, do you plan on addressing Sumit's comments separately? """
See the full comment at https://github.com/SSSD/sssd/pull/744#issuecomment-463357498
URL: https://github.com/SSSD/sssd/pull/744 Author: thalman Title: #744: ssh: sssd_ssh fails completely on p11_child timeout Action: synchronized
To pull the PR as Git branch: git remote add ghsssd https://github.com/SSSD/sssd git fetch ghsssd pull/744/head:pr744 git checkout pr744
URL: https://github.com/SSSD/sssd/pull/744 Author: thalman Title: #744: ssh: sssd_ssh fails completely on p11_child timeout Action: synchronized
To pull the PR as Git branch: git remote add ghsssd https://github.com/SSSD/sssd git fetch ghsssd pull/744/head:pr744 git checkout pr744
URL: https://github.com/SSSD/sssd/pull/744 Title: #744: ssh: sssd_ssh fails completely on p11_child timeout
thalman commented: """ Added second commit with new ERR_P11_CHILD_TIMEOUT code """
See the full comment at https://github.com/SSSD/sssd/pull/744#issuecomment-463570037
URL: https://github.com/SSSD/sssd/pull/744 Title: #744: ssh: sssd_ssh fails completely on p11_child timeout
sumit-bose commented: """ Thanks for the new patches. They look good and I would ACK them code-wise.
@jhrozek, do you have the test environment for this patch still around or shall I run some functional tests?
bye, Sumit """
See the full comment at https://github.com/SSSD/sssd/pull/744#issuecomment-463621977
URL: https://github.com/SSSD/sssd/pull/744 Title: #744: ssh: sssd_ssh fails completely on p11_child timeout
Label: +Accepted
URL: https://github.com/SSSD/sssd/pull/744 Title: #744: ssh: sssd_ssh fails completely on p11_child timeout
jhrozek commented: """ * master: * 52c8336137a97af4843ff8074e7b3478f766f6d8 * e1755a00faf993e50db5dafa7671d88456a2a0ad * sssd-1-16: * 340de230e006a7120cbd989dab98f1c3d4594287 * 31637fdfa6f631d8d18392811253e6c8c8931eed
"""
See the full comment at https://github.com/SSSD/sssd/pull/744#issuecomment-464393537
URL: https://github.com/SSSD/sssd/pull/744 Author: thalman Title: #744: ssh: sssd_ssh fails completely on p11_child timeout Action: closed
To pull the PR as Git branch: git remote add ghsssd https://github.com/SSSD/sssd git fetch ghsssd pull/744/head:pr744 git checkout pr744
URL: https://github.com/SSSD/sssd/pull/744 Title: #744: ssh: sssd_ssh fails completely on p11_child timeout
Label: +Pushed
sssd-devel@lists.fedorahosted.org