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

SELINUX, labels #15

Closed
kennethgillen opened this issue Apr 2, 2018 · 2 comments · Fixed by #21
Closed

SELINUX, labels #15

kennethgillen opened this issue Apr 2, 2018 · 2 comments · Fixed by #21

Comments

@kennethgillen
Copy link
Member

kennethgillen commented Apr 2, 2018

Upon using the ansible-role-omero-web on a RHEL system with SELINUX set to enforcing, the static files served up by NGINX are not loading after a fresh installation, or an upgrade of an existing running server.

Note: in the case of the output here, this was already done for the existing server at first deployment, and these steps were re-ran for an upgrade to the existing server.

[root@pub-omero ~]# audit2why < /var/log/audit/audit.log shows:

type=AVC msg=audit(1522679845.947:375427): avc:  denied  { read } for  pid=20627 comm="nginx" name="OMERO.web" dev="dm-7" ino=726 scontext=system_u:system_r:httpd_t:s0 tcontext=unconfined_u:object_r:unlabeled_
t:s0 tclass=lnk_file

        Was caused by:
                Missing type enforcement (TE) allow rule.

                You can use audit2allow to generate a loadable module to allow this access.

after creating an audit2allow rule as it suggests, the following is generated:

[root@ ~]# audit2allow < /var/log/audit/audit.log


#============= abrt_t ==============
allow abrt_t inetd_child_t:dbus send_msg;

#============= httpd_t ==============

#!!!! WARNING: 'unlabeled_t' is a base type.
#!!!! The file '/opt/omero/web/OMERO.web' is mislabeled on your system.
#!!!! Fix with $ restorecon -R -v /opt/omero/web/OMERO.web
allow httpd_t unlabeled_t:lnk_file read;

After running restorecon -R -v /opt/omero/web/OMERO.web, the statics are happily served without a restart of NGINX.

@joshmoore
Copy link
Member

Just ran into this again on pub-omero.

@sbesson sbesson mentioned this issue Oct 9, 2018
@sbesson
Copy link
Member

sbesson commented Oct 9, 2018

#19 contains a proposal to address this issue with a conditional included playbook executing the command above for SELinux-hardened systems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants