Bug 1857194

Summary: foreman_rails_t domain cannot search tftpdir_rw_t
Product: Red Hat Satellite Reporter: Lukas Pramuk <lpramuk>
Component: SELinuxAssignee: Lukas Zapletal <lzap>
Status: CLOSED DUPLICATE QA Contact: Lukas Pramuk <lpramuk>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.8.0CC: lzap
Target Milestone: 6.8.0Keywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-08-06 13:23:26 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Lukas Pramuk 2020-07-15 12:03:14 UTC
Description of problem:
Selinux denial for foreman_rails_t domain to search tftpdir_rw_t
 
Version-Release number of selected component (if applicable):
Satellite 6.8.0 Snap8
foreman-selinux-2.1.0-0.2.rc3.el7sat.noarch

How reproducible:
100%

Steps to Reproduce:
1. Install Sat6.8 with provisioning capsule (tftp+dhcp+dns) enabled

2. Check for SELinux denials

type=AVC msg=audit(1594681116.246:2842): avc:  denied  { search } for  pid=90007 comm="sidekiq" name="tftpboot" dev="dm-0" ino=503328373 scontext=system_u:system_r:foreman_rails_t:s0 tcontext=system_u:object_r:tftpdir_rw_t:s0 

Actual results:
denials

Expected results:
no denials

Additional info:

Comment 1 Lukas Zapletal 2020-08-06 12:27:34 UTC
Can you tell when this happens or how to reproduce? I don't see this denial on my install.

There is a similar BZ:

https://bugzilla.redhat.com/show_bug.cgi?id=1857184

type=AVC msg=audit(1594888202.436:193): avc: denied { search } for pid=10144 comm="ruby" name="tftpboot" dev="vda4" ino=188750462 scontext=system_u:system_r:foreman_rails_t:s0 tcontext=system_u:object_r:tftpdir_rw_t:s0 tclass=dir permissive=0

The difference is that the one is puma/ruby process and yours is sidekiq. So perhaps some background task, but what would touch TFTP?

The other BZ will fix the denial but I would like to know what caused this.

Comment 2 Lukas Zapletal 2020-08-06 13:23:26 UTC
Ok this is dupe, during Rails initialization Bootdisk plugin reads TFTP directory for file existence of grubx64.efi.

*** This bug has been marked as a duplicate of bug 1857184 ***