Created attachment 1453783 [details] Screenshot Description of problem: RHV SSH Credentials file input takes any file format (.pdf, .jpeg, etc.), we should add some kind of validation around it. Version-Release number of selected component (if applicable): master.20180621230811_8e109d6 How reproducible: 100% Steps to Reproduce: 1.Navigate to Add infra provider form 2.Select Red hat Virtualization 3.Select RSA Key Pair tab 4.Upload any kind of file to New Private key Input Actual results: I can upload anything, see screenshot Expected results: Should have some validation to make sure only key file can be uploaded Additional info:
For Openstack, there is no validation for the "RSA key pair" too (Not for the key structure, and not for the connection). In openstack the "RSA key pair" is used for nodes SmartStateAnalysis - after SSA task is finished, in the Node summary page, under Authentication, it is mentioned that "ssh key pair validated".
This issue is present on 5.10.0.2 as well
https://github.com/ManageIQ/manageiq-v2v/issues/679
This is not a bug. SSH keys do not have any file type. That prevents us from filtering the upload options to specific file types (like you can do when uploading images). You can even store your shh key into file with .jpeg extension without any problem. Another issue is that there is many formats of ssh keys across all the providers we support. And these can change. Public keys have specific prefix in the file content (ssh-rsa the rest of the key goes here) so we could technically read the file content, but that only applies for public keys not private keys. Also UI is no the only place where user can add credentials. You can also do it via API so we would have to duplicate the code which would not even cover all of the use cases. So if this is a bug, UI should not be the place where we start fixing it. Because of this we have to allow upload of any file type. So to prevent storage of invalid file types user have to first validate the credentials. That is the most effective validation you can have for this use case. I will close this one but if you have different opinion, please provide more arguments why it should be done and re-open this issue.