Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1933164

Summary: Selinux blocks websockify, vnc console is blocked
Product: Red Hat Satellite Reporter: James Jeffers <jjeffers>
Component: SELinuxAssignee: Lukas Zapletal <lzap>
Status: CLOSED ERRATA QA Contact: Lukas Pramuk <lpramuk>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.7.0CC: ktordeur, lzap, zhunting
Target Milestone: 6.8.5Keywords: Triaged
Target Release: Unused   
Hardware: All   
OS: Unspecified   
Whiteboard:
Fixed In Version: foreman-selinux-2.1.2.4-1,foreman-selinux-2.1.2.5-1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1868005 Environment:
Last Closed: 2021-03-31 19:48:19 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Comment 3 Lukas Pramuk 2021-03-16 02:47:40 UTC
FailedQA.

@Satellite 6.8.5 Snap1
foreman-selinux-2.1.2.4-1.el7sat.noarch

by the reproducer described in comment#0

1) Select any provisioned host

2) Click [Console] button

(x) Failed to set console: Permission denied - /usr/share/foreman/extras/noVNC/websockify.py

# grep websockify /var/log/audit/audit.log
type=AVC msg=audit(1615862142.932:222): avc:  denied  { execute } for  pid=11591 comm="diagnostic_con*" name="websockify.py" dev="dm-0" ino=604173190 scontext=system_u:system_r:passenger_t:s0 tcontext=system_u:object_r:websockify_exec_t:s0 tclass=file permissive=0

# semodule -l | grep foreman
foreman	2.1.2.4

# grep -C3 'corecmd_exec_ls(websockify_t)' /usr/share/doc/foreman-selinux-2.1.2.4/foreman.te
read_files_pattern(websockify_t, puppet_var_lib_t, puppet_var_lib_t)
files_search_etc(websockify_t)
read_files_pattern(websockify_t, puppet_etc_t, puppet_etc_t)
corecmd_exec_ls(websockify_t)

tunable_policy(`websockify_can_connect_all',`
    corenet_tcp_connect_all_ports(websockify_t)

# audit2allow -a

#============= passenger_t ==============
allow passenger_t websockify_exec_t:file execute;


>>> the fix is present however there is another selinux denial (passenger 6.8  vs. puma 6.9)

Comment 4 Lukas Zapletal 2021-03-16 14:18:53 UTC
We need this patch:

https://projects.theforeman.org/issues/32110

Comment 7 Lukas Pramuk 2021-03-24 09:42:23 UTC
VERIFIED.

@Satellite 6.8.5 Snap2
foreman-selinux-2.1.2.5-1.el7sat.noarch

by the reproducer described in comment#0

1) Select any provisioned host

2) Click [Console] button

# semodule -l | grep foreman
foreman	2.1.2.5

# grep websockify /var/log/audit/audit.log
<empty>

>>> no selinux denials

Comment 11 errata-xmlrpc 2021-03-31 19:48:19 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Satellite 6.8.5 Async Bug Fix Update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2021:1057