-
Notifications
You must be signed in to change notification settings - Fork 183
fix(ipmi_exporter): Fix privilege escalation when running in local mode #616
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Kaloyan Kotlarski <[email protected]>
|
Would love to see this merged |
Add the selinus tag to all SELinux tasks to allow skipping/selecting them
| - "{{ ansible_parent_role_names | first | regex_replace(ansible_collection_name ~ '.', '') }}" | ||
| - configure | ||
| - "{{ ansible_parent_role_names | first | regex_replace(ansible_collection_name ~ '.', '') }}_configure" | ||
| - selinux |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are you adding this tag? It seems unrelated to the subject
| - name: Create sudoers file to allow passwordless IPMI commands | ||
| ansible.builtin.copy: | ||
| dest: "/etc/sudoers.d/{{ ipmi_exporter_system_user }}" | ||
| content: | | ||
| {{ ipmi_exporter_system_user }} ALL=(ALL) NOPASSWD: {{ ipmi_exporter_sudo_commands | join(', ') }} | ||
| owner: root | ||
| group: root | ||
| mode: '0440' | ||
| become: true | ||
| when: ipmi_exporter_system_user is defined |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use community.general.sudoers instead
| ipmi_exporter_sudo_commands: | ||
| - /usr/sbin/ipmimonitoring | ||
| - /usr/sbin/ipmi-sensors | ||
| - /usr/sbin/ipmi-dcmi | ||
| - /usr/sbin/ipmi-raw | ||
| - /usr/sbin/bmc-info | ||
| - /usr/sbin/ipmi-chassis | ||
| - /usr/sbin/ipmi-sel |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the user ever need to overwrite this? Perhaps it would be better to place this as a internal variable under vars/main.yml
|
The sudo policy should not be used for every installation of ipmi_exporter since it only applies to the local mode. |
Fixes #526