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

Remove passlib as a dependency #67

Open
CharlieParker opened this issue Jul 28, 2023 · 0 comments
Open

Remove passlib as a dependency #67

CharlieParker opened this issue Jul 28, 2023 · 0 comments
Labels
wave 3 Will be addressed after the completion of wave 2 issues

Comments

@CharlieParker
Copy link
Collaborator

passlib was an annoying thing for me to install.

It should just be pip install but when I ran this, I realised Ansible, VS Code, and the command python were all pointing to different versions/envs of python.

To avoid headaches like this, I think it's better to include dependency installation (if not installed) as part of the automation.

I've had a look at where passlib is used and I don't think it's necessary.

Consider the code:

- name: Add the user 'app' with a specific UID
  become: true
  vars:
    apppassword: Passw0rd
  user:
    name: app
    password: "{{ 'apppassword' | password_hash('sha512', 65534 | random(seed=inventory_hostname) | string) }}"
    uid: "{{ app_uid }}"
    group: mqclient

A few thoughts:

  • 'apppassword' != apppassword, one is a var name, the other a literal string. apppassword is never used, 'apppassword' is. This means this default password has been named three times. 'Passw0rd' != 'apppassword' != apppassword
  • There is no point hashing a default password hardcoded into the repository, I think it's obvious it's not a secure/good password.
  • A simpler solution is surely more amenable to varied users who likely have different security strategies.
@bimsara-yasitha01 bimsara-yasitha01 added the wave 3 Will be addressed after the completion of wave 2 issues label Nov 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wave 3 Will be addressed after the completion of wave 2 issues
Projects
None yet
Development

No branches or pull requests

2 participants