Bug 732699 - SELinux policy for glance
Summary: SELinux policy for glance
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 16
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Miroslav Grepl
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-08-23 10:27 UTC by Mark McLoughlin
Modified: 2013-02-14 03:00 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2013-02-14 03:00:50 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Mark McLoughlin 2011-08-23 10:27:01 UTC
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 17:46:51 UTC
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 21:12:57 UTC
Thanks Dan! I'll try it out

Comment 3 Mark McLoughlin 2011-08-30 20:56:15 UTC
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 14:17:02 UTC
No problem the policy should still work.

Comment 5 Mark McLoughlin 2011-09-05 18:19:49 UTC
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 12:44:38 UTC
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 12:52:47 UTC
I am adding fixes.

Comment 8 Miroslav Grepl 2011-09-06 12:56:18 UTC
Fixed in selinux-policy-3.10.0-25.fc16

Comment 9 Mark McLoughlin 2011-09-06 13:52:09 UTC
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 12:05:15 UTC
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-17 02:07:51 UTC
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-14 03:00:53 UTC
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.