-
Notifications
You must be signed in to change notification settings - Fork 15
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
Become root #50
Become root #50
Conversation
tasks/web-nginx.yml
Outdated
@@ -42,4 +42,7 @@ | |||
name: nginx | |||
state: started | |||
|
|||
# SELinux should be handled by openmicroscopy.omero-web-runtime |
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.
I think we may not need this change as it is already there
name: omero web | selinux ports
But I think the issue comes from the selinux_utils
role as I think the selinux_enabled
variable value does not reflect the SeLinux
status so this task has been never run.
I think it is better to check the SELinux
status on this task using the ansible facts
, i.e.
when: ansible_facts.selinux.status == 'enabled'
instead of
when: selinux_enabled
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.
So should httpd_can_network_connect
be added to the booleans set in
ansible-role-omero-web/tasks/web-dependencies.yml
Lines 3 to 12 in 500e9ef
- name: omero web | selinux booleans | |
become: true | |
seboolean: | |
name: "{{ item }}" | |
state: true | |
persistent: true | |
with_items: | |
- httpd_read_user_content | |
- httpd_enable_homedirs | |
when: selinux_enabled |
This might also fix the idempotence failure
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.
I think what is needed is deleting the added task, and checking the SeLinux
status using ansible facts. I have made these changes in this local branch . It has passed the molecule tests, I think Dom should apply these changes to his branch and test on a Rocky Linux deployment.
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.
👍 Sounds good, thanks @khaledk2 !
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.
Happy to test the latest commit with the upcoming prod121
deployment but as a data point some of the SELinux booleans have been set in the logs:
[root@pilot-rocky9-omeroreadwrite audit]# grep httpd audit.log.2
type=MAC_CONFIG_CHANGE msg=audit(1709807975.836:7503): bool=httpd_read_user_content val=1 old_val=0 auid=1000 ses=1AUID="rocky"
type=MAC_CONFIG_CHANGE msg=audit(1709807981.584:7540): bool=httpd_enable_homedirs val=1 old_val=0 auid=1000 ses=1AUID="rocky"
so I am not convinced that the selinux_enabled
conditional logic was really skipped and we might still be missing a SElinux boolean on Rocky Linux 9. This would also match the findings of @pwalczysko while working on the UoD deployments.
On the usage of ansible_facts
, no objection to replacing the usage of selinux_enabled
by ansible_facts.selinux.status == 'enabled'
. Note there are several roles and playbooks that should be reviewed - see https://github.com/search?q=org%3Aome%20selinux_enabled&type=code so we might need to decide how to rollout this change across the board.
Let's discuss at the weekly infrastructure call
As an update on this front, using the latest commit on this role for the deployment of
was sufficient to fix the proxying of the OMERO.web application through Nginx |
I have checked the issue of having the When turning on Turning on I think the only change needed is adding a new item, i.e. I think we should keep using the |
I have tested adding |
I agree with the discussion and the proposal above. In the typical deployment scenario where OMERO.web is served via Nginx, my understanding is that @pwalczysko it is probably worth testing that setting this SELinux boolean is sufficient to fix the OMERO.web issues in the context of th UoD RHEL9 OMERO systems by running
|
@sbesson - is it a typo ? See below please
|
Yes, it was a typo. Updated my comment |
@sbesson Yes, after I have adjusted your two suggested cmds as
Then I have a Bad Gateway after running the first cmd ( |
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.
Coming back to this and checking the status.
- should we merge this with only the
become: true
fix and open a follow-up PR fixing the SELinux boolean? - are we happy about using
when: ansible_facts.selinux.status == 'enabled'
or should that be reverted and/or handled separately?
We should revert the change and keep using the selinux_enabled variable from the |
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.
We should revert the change and keep using the selinux_enabled variable from the ome.selinux_utils role as ome/ansible-role-selinux-utils#15 uses ansible facts to check the Selinux status.
I extracted all the relevant SELinux changes to #51. @dominikl could you force push away all last commits to this PR and restore it to the state of 8f50390 ?
Fixes the issue on rocky9:
Also added selinux command to allow nginx to serve omero.web, based on https://github.com/openmicroscopy/management_tools/pull/1710/files#r1516332291 (thanks @pwalczysko !)
There was a comment saying "SELinux should be handled by openmicroscopy.omero-web-runtime" but omero-web-runtime: "This repository has been archived by the owner on Jan 8, 2021. It is now read-only. ", so maybe shouldn't rely on that.