Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
SELinux strict policy conflicts with net-proxy/squid-3.5.6
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
bamapookie
n00b
n00b


Joined: 25 Nov 2004
Posts: 19

PostPosted: Fri Aug 14, 2015 6:56 pm    Post subject: SELinux strict policy conflicts with net-proxy/squid-3.5.6 Reply with quote

I have a hardened gentoo system installed using a strict SELinux policy type and set to enforcing (temporarily permissive). I am getting avc denials trying to access and write to /var/lib/squid/netdb.state. That file and its directory is labeled var_lib_t, but squid can only write to a directory labeled squid_log_t, var_run_t, var_t, squid_var_run_t, tmp_t, squid_tmpfs_t, tmpfs_t, var_log_t, squid_tmp_t, or squid_cache_t.

Relevant messages from /var/log/messages:

Code:
Aug 14 11:33:24 hma2 kernel: audit: type=1400 audit(1439566404.199:28): avc:  denied  { write } for  pid=2241 comm="squid" name="squid" dev="sda3" ino=16199 scontext=system_u:system_r:squid_t tcontext=system_u:object_r:var_lib_t tclass=dir permissive=1
Aug 14 11:33:24 hma2 kernel: audit: type=1400 audit(1439566404.199:29): avc:  denied  { add_name } for  pid=2241 comm="squid" name="netdb.state" scontext=system_u:system_r:squid_t tcontext=system_u:object_r:var_lib_t tclass=dir permissive=1
Aug 14 11:33:24 hma2 kernel: audit: type=1400 audit(1439566404.199:30): avc:  denied  { create } for  pid=2241 comm="squid" name="netdb.state" scontext=system_u:system_r:squid_t tcontext=system_u:object_r:var_lib_t tclass=file permissive=1
Aug 14 11:33:24 hma2 kernel: audit: type=1400 audit(1439566404.199:31): avc:  denied  { append open } for  pid=2241 comm="squid" path="/var/lib/squid/netdb.state" dev="sda3" ino=7353 scontext=system_u:system_r:squid_t tcontext=system_u:object_r:var_lib_t tclass=file permissive=1


restorecon does not change the file's context. Here are the relevant entries from the file contexts:
Code:
squid # grep squid /etc/selinux/strict/contexts/files/file_contexts
/etc/squid(/.*)?   system_u:object_r:squid_conf_t
/var/log/squid(/.*)?   system_u:object_r:squid_log_t
/var/squidGuard(/.*)?   system_u:object_r:squid_cache_t
/usr/share/squid(/.*)?   system_u:object_r:squid_conf_t
/var/cache/squid(/.*)?   system_u:object_r:squid_cache_t
/var/spool/squid(/.*)?   system_u:object_r:squid_cache_t
/var/log/squidGuard(/.*)?   system_u:object_r:squid_log_t
/usr/sbin/squid   --   system_u:object_r:squid_exec_t
/var/run/squid\.pid   --   system_u:object_r:squid_var_run_t
/etc/rc\.d/init\.d/squid   --   system_u:object_r:squid_initrc_exec_t
/usr/lib/squid/cachemgr\.cgi   --   system_u:object_r:httpd_squid_script_exec_t


Is this a bug, or is there something I am missing? AFAIK, that is the default location of that file. I can look into relocating it in the configuration, but as of now, my config is a very paired down version of the stock config.
Back to top
View user's profile Send private message
bamapookie
n00b
n00b


Joined: 25 Nov 2004
Posts: 19

PostPosted: Fri Aug 14, 2015 8:20 pm    Post subject: Reply with quote

Opened a bug to track it, as it seems this is an issue in RedHat as well.

https://bugs.gentoo.org/show_bug.cgi?id=557614

https://bugzilla.redhat.com/show_bug.cgi?id=1195807
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum