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

major code cleanup #8

Merged
merged 2 commits into from
Jun 25, 2018
Merged

major code cleanup #8

merged 2 commits into from
Jun 25, 2018

Conversation

paulfantom
Copy link
Collaborator

  • to increase security binary files should be owned by root not by user who executes that file
  • move user and group creation to server section as those aren't needed when only installing client
  • remove hacky installation of packages (do not use with_indexed_items)
  • rename ansible_support_packages to minio_ansible_support_packages as every variable starting from ansible_ should come from ansible itself, not from role.
  • remove python_sni_pip_dependencies and just list packages in task for better readability
  • remove systemd_units_dir and always use /etc/systemd/system value as is recommended by systemd
  • remove initd_conf_dir variable and only use its value for better readability

@paulfantom paulfantom requested review from SuperQ and atosatto and removed request for SuperQ June 25, 2018 09:37
@SuperQ
Copy link
Collaborator

SuperQ commented Jun 25, 2018

Do we want to add a cleanup for the old unit file location?

@paulfantom
Copy link
Collaborator Author

That's a good question. Adding this won't change anything in how it operates since files located in /etc/systemd/system takes priority over ones located in lib/systemd/system.
@atosatto WDYT?

@paulfantom paulfantom requested a review from SuperQ June 25, 2018 10:20
Copy link
Collaborator

@SuperQ SuperQ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@atosatto
Copy link
Owner

It's perfectly fine to stick with systemd unit files in /etc/systemd/system

@paulfantom paulfantom merged commit be351af into atosatto:master Jun 25, 2018
@paulfantom paulfantom deleted the code_cleanup branch June 25, 2018 11:38
- name: download minio client
get_url:
url: "{{ minio_client_download_url }}"
dest: "{{ minio_client_bin }}"
owner: "{{ minio_user }}"
group: "{{ minio_group }}"
owner: "root"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was done as a kind of "security measure".
Just not to download binaries from the internet as "root".
But I am not sure it still makes sense.
Thoughts?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It isn't good to run any binary as a user who can edit this binary. We have a sane default for minio_client_download_url which is an official source, and we are using HTTPS so there shouldn't be any problem with tampering the file while transmitting to server.
I would also consider downloading binary once to local machine, validating checksum and then propagating it to target hosts. This increases security and reduces needed network bandwidth when used with more than 1 target. We are doing the same with most of the roles in @cloudalchemy :)

akire0ne pushed a commit to akire0ne/ansible-minio that referenced this pull request Feb 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants