Bug 503143

Summary: selinux-policy: racoon may run as unconfined_t
Product: [Fedora] Fedora Reporter: Tomas Hoger <thoger>
Component: selinux-policyAssignee: Daniel Walsh <dwalsh>
Status: CLOSED INSUFFICIENT_DATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: 11CC: dwalsh, jkubin, mgrepl, notting, tmraz
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 500395 Environment:
Last Closed: 2009-08-21 21:55:10 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:
Bug Depends On: 500395    
Bug Blocks:    

Description Tomas Hoger 2009-05-29 08:56:42 UTC
+++ This bug was initially created as a clone of Bug #500395 +++

Description of problem:
Red Hat Enterprise Linux 5 Deployment Guide describes how to do a basic IPSec config using ipsec-tools and networking init scripts:

http://www.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/5/html/Deployment_Guide/s2-ipsec-host2host-cfg.html

When ifup is used manually to activate first ipsec interface (which triggers racoon daemon start), racoon is run as unconfined_t, instead of expected raccon_t.  This does not happen when ipsec network interface is ONBOOT=yes and hence racoon is started during the system boot.

Steps to Reproduce:
1. create minimal ipsec setup as described by Deployment Guide
2. ifup ipsecX
3. check racoon's type
  
Actual results:
unconfined_t

Expected results:
racoon_t

Additional info:
This is initially filed against ipsec-tools, but it'll probably get addressed via a fix in either initscripts (some runcon hack; addition of init script to get called by if{up,down}-ipsec), or selinux-policy (unconfined_t -> racoon_t type_transition besides initrc_t -> racoon_t one).

Comment 1 Tomas Hoger 2009-05-29 09:07:54 UTC
See bug #500395 for further discussion about this.  Current options for fixing seem to be:

1) Change type of if{up,down}-ipsec or if{up,down} to initrc_exec_t, so the transition to initrc_t happens when ifup/ifdown is run directly from the command line.

Pros: Consistency with situations when if{up,down} is run during boot / shutdown, or when admin calls /etc/init.d/network.  Currently, running /etc/init.d/network will run up/down scripts as initrc_t, while directly calling ifup/ifdown will run them as unconfined_t in most cases.

Cons: Higher risk for scripts that may not be commonly (at all?) from during boot shutdown, and may not work when run as initrc_t (they should though, imo).

2) Change if{up,down}-ipsec to call racoon's init script instead of running daemon directly.

Pros: Smaller change, less risk.

Cons: Does not deal with inconsistency mentioned above (and which is not specific to this bug).  Depends on bug #500571.

Comment 2 Tomas Hoger 2009-05-29 12:33:33 UTC
To correct / extend my 1) Cons:.

No up/down script besides -ipsec one is currently known to have problems running as initrc_t.

Additional risk was pointed out by Daniel in bug #500395#c11 - it's currently unclear if any domain executing ifup / ifdown may be disallowed to execute initrc_exec_t files.

Comment 3 Daniel Walsh 2009-06-01 17:05:19 UTC
Well mostly ifup and ifdown are run under the domain that starts them,  So if they are run by a user they will run in the users domain, (unconfined_t)  If they are run at startup they will be run in initrc_t, if they are run by NetworkManager then NetworkManager_t

Comment 4 Bug Zapper 2009-06-09 16:45:27 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 11 development cycle.
Changing version to '11'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 5 Daniel Walsh 2009-08-21 21:55:10 UTC
I am not sure we came to closure on this, but I will close as insufficient data, reopen if you have more requests.