agnosticd icon indicating copy to clipboard operation
agnosticd copied to clipboard

bugfix for sshpass

Open YogiSoni-lazy opened this issue 2 years ago • 5 comments

Bugfix Pull Request

COMPONENT NAME

osp17-director-deployment fixed the sshpass plaintext password in test.yaml

YogiSoni-lazy avatar Mar 01 '23 13:03 YogiSoni-lazy

@fridim is this secure?

bbethell-1 avatar Mar 01 '23 13:03 bbethell-1

While it would be "secure", it would still be a static password, even if protected by gpg on this repo.

Best is to generate the password using ansible, when provisioning.

-   set_fact:
        undercloud_ssh_password: "{{ lookup('password', '/dev/null length=18 chars=ascii_letters,digits') }}"

and return it to user if needed using agnosticd_user_info

agnosticd_user_info:
    data:
       undercloud_ssh_password: "{{ undercloud_ssh_password }}"

Print it back to the user or not depends on the lab/demo.

fridim avatar Mar 01 '23 14:03 fridim

@YogiSoni-lazy
Please can you adjust it to fit into Guillaume's suggestion Thank you @fridim

bbethell-1 avatar Mar 01 '23 14:03 bbethell-1

@fridim in this specific lab, there are total 6 vms provided with static passwords i.e r3dh4t1! for internal connectivity. I would like to highlight that learner is not going to take access of these vms and login using workstation vm that would be having password generated dynamically.

So, do I need to generate all passwords dynamically? and if yes, then any reason why?

YogiSoni-lazy avatar Mar 03 '23 10:03 YogiSoni-lazy

If the VMs are accessed internally, the usual pattern to provide access to them is to automate the creation of an SSH key on the workstation (or bastion) and to add it as authorized_key on the other instances. That way, the student will not have to type passwords when SSH'ing from the workstation or bastion.

You can also re-use the provision SSH key for that purpose.

For example, it's done by the bastion-lite role: https://github.com/redhat-cop/agnosticd/blob/development/ansible/roles/bastion-lite/tasks/create_bastion_ssh_key_and_access.yml#L35

fridim avatar Mar 07 '23 08:03 fridim