Bug 732699 - SELinux policy for glance
SELinux policy for glance
Status: CLOSED WONTFIX
Product: Fedora
Classification: Fedora
Component: selinux-policy (Show other bugs)
16
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Miroslav Grepl
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2011-08-23 06:27 EDT by Mark McLoughlin
Modified: 2013-02-13 22:00 EST (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-02-13 22:00:50 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Mark McLoughlin 2011-08-23 06:27:01 EDT
glance has two daemons which run as the glance user - glance-registry and glance-api

We surely need SELinux policy to constrain these two daemons

(This is vague, I know - I'm just filing the bug to track that it needs looking into)
Comment 1 Daniel Walsh 2011-08-29 13:46:51 EDT
I just added policy to F15 for glance-api and glance-registry.

I do have a concern about api using /tmp and creating a file which it later executes.  The policy allows this but I would like to know why?  

Policy should show up in selinux-policy-3.10.0-23.fc16

I am sure there will be a decent amount of AVC's.
Comment 2 Mark McLoughlin 2011-08-29 17:12:57 EDT
Thanks Dan! I'll try it out
Comment 3 Mark McLoughlin 2011-08-30 16:56:15 EDT
Note, as of openstack-glance-2011.3-0.6.d4.fc16 we've switched to systemd

Should have done this beforehand Dan, sorry!
Comment 4 Daniel Walsh 2011-08-31 10:17:02 EDT
No problem the policy should still work.
Comment 5 Mark McLoughlin 2011-09-05 14:19:49 EDT
Okay, I've just tested selinux-policy-3.10.0-23.fc16.noarch out by following our howto here:

  https://fedoraproject.org/wiki/Getting_started_with_OpenStack_Nova

The daemons are confined to the correct domains and I'm not seeing any AVC denials.

(In reply to comment #1)
> I do have a concern about api using /tmp and creating a file which it later
> executes.  The policy allows this but I would like to know why?

I don't see anything obvious in strace at first glance, but I'll look into it further. Filed bug #735855 about it

(In reply to comment #4)
> No problem the policy should still work.

There's probably initscripts policy you can now remove, though? There's no backwards compat concerns - the initscripts only existed in Fedora 16 for a week or so

Thanks Dan!
Comment 6 Mark McLoughlin 2011-09-06 08:44:38 EDT
My embarrassingly bad bad ... I was looking for denials in the wrong place :)


On API startup, I think down to ffi stat-ing /selinux - see bug #735855:

avc:  denied  { getattr } for  pid=24385 comm="glance-api" name="/" dev=dm-1 ino=2 scontext=system_u:system_r:glance_api_t:s0 tcontext=system_u:object_r:fs_t:s0 tclass=filesystem

Doing 'glance index', when the API connects to the registry:

avc:  denied  { getattr } for  pid=24385 comm="glance-api" name="/" dev=dm-1 ino=2 scontext=system_u:system_r:glance_api_t:s0 tcontext=system_u:object_r:fs_t:s0 tclass=filesystem

Doing 'glance delete N', there are some registry denials caused by sqlite (see 'etilqs') creating tmp files:

avc:  denied  { read write } for  pid=25290 comm="glance-registry" name="tmp" dev=dm-1 ino=2752567 scontext=system_u:system_r:glance_registry_t:s0 tcontext=system_u:object_r:tmp_t:s0 tclass=dir
avc:  denied  { add_name } for  pid=25290 comm="glance-registry" name="etilqs_LyEeZvDKk72iFs7" scontext=system_u:system_r:glance_registry_t:s0 tcontext=system_u:object_r:tmp_t:s0 tclass=dir
avc:  denied  { create } for  pid=25290 comm="glance-registry" name="etilqs_LyEeZvDKk72iFs7" scontext=system_u:system_r:glance_registry_t:s0 tcontext=system_u:object_r:tmp_t:s0 tclass=file
avc:  denied  { read write open } for  pid=25290 comm="glance-registry" name="etilqs_LyEeZvDKk72iFs7" dev=dm-1 ino=2755020 scontext=system_u:system_r:glance_registry_t:s0 tcontext=system_u:object_r:tmp_t:s0 tclass=file
avc:  denied  { remove_name } for  pid=25290 comm="glance-registry" name="etilqs_LyEeZvDKk72iFs7" dev=dm-1 ino=2755020 scontext=system_u:system_r:glance_registry_t:s0 tcontext=system_u:object_r:tmp_t:s0 tclass=dir
avc:  denied  { unlink } for  pid=25290 comm="glance-registry" name="etilqs_LyEeZvDKk72iFs7" dev=dm-1 ino=2755020 scontext=system_u:system_r:glance_registry_t:s0 tcontext=system_u:object_r:tmp_t:s0 tclass=file
Comment 7 Miroslav Grepl 2011-09-06 08:52:47 EDT
I am adding fixes.
Comment 8 Miroslav Grepl 2011-09-06 08:56:18 EDT
Fixed in selinux-policy-3.10.0-25.fc16
Comment 9 Mark McLoughlin 2011-09-06 09:52:09 EDT
I only see selinux-policy-3.10.0-24.fc16 and it doesn't contain any glance related changes compared to selinux-policy-3.10.0-23.fc16

Am I missing something?
Comment 10 Miroslav Grepl 2011-09-08 08:05:15 EDT
selinux-policy-3.10.0-25.fc16 is now available.

yum update selinux-policy --enablerepo=updates-testing
Comment 11 Fedora End Of Life 2013-01-16 21:07:51 EST
This message is a reminder that Fedora 16 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 16. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '16'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 16's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 16 is end of life. If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora, you are encouraged to click on 
"Clone This Bug" and open it against that version of Fedora.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 12 Fedora End Of Life 2013-02-13 22:00:53 EST
Fedora 16 changed to end-of-life (EOL) status on 2013-02-12. Fedora 16 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.

Note You need to log in before you can comment on or make changes to this bug.