Bug 699759 - SElinux Policy Blocking BIND 9.7 Zone File Write
Summary: SElinux Policy Blocking BIND 9.7 Zone File Write
Keywords:
Status: CLOSED WORKSFORME
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: selinux-policy
Version: 5.6
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: rc
: ---
Assignee: Miroslav Grepl
QA Contact: BaseOS QE Security Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-04-26 14:48 UTC by Jonathan Loeffler
Modified: 2011-04-27 06:17 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-04-27 06:17:47 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Selinux debug (3.46 KB, text/plain)
2011-04-26 14:48 UTC, Jonathan Loeffler
no flags Details

Description Jonathan Loeffler 2011-04-26 14:48:26 UTC
Created attachment 494934 [details]
Selinux debug

Description of problem:

When trying to reload zones on a freshly configured bind name server it appears that when a zone file is being downloaded from the master server selinux denies the write to the zones directory.

Version-Release number of selected component (if applicable):

bind version 9.7.0-p2-redhat-9.7.0-6.p2.e15
rhel 5.6 kernel 2.6.18-238.9.1.e15

How reproducible:

This appears to happen every time my master DNS server sends a notify to the secondary (slave) server and the secondary attempts to download the changed zone file.

Steps to Reproduce:
1. Change zone on primary server
2. Reload changed zone on primary
3. tail -f /var/log/messages
  
Actual results:

Zones are not transferred from the master.

Expected results:

Zone files should be written to my zones folder within /etc/named

Additional info:

SELinux is preventing named (named_t) "write" to ./zones (etc_t).

I have already tried the suggested fix action that SELinux recommends and it doesn't appear to be working. This may be a bug. Both machines have been fully patched and are running the latest bind available.

Please see attached debug output.

Comment 1 Daniel Walsh 2011-04-26 15:34:28 UTC
This looks like you have some files mislabelled?

# restorecon -R -v /var/named



You probably need to turn on the named_write_master_zones boolean also.

# setsebool -P named_write_master_zones 1

Comment 2 Jonathan Loeffler 2011-04-26 20:21:43 UTC
(In reply to comment #1)
> This looks like you have some files mislabelled?
> 
> # restorecon -R -v /var/named
> 
> 
> 
> You probably need to turn on the named_write_master_zones boolean also.
> 
> # setsebool -P named_write_master_zones 1

I changed all of my zones file locations over to the /var/named folder and then issued the selinux boolean command and all appears to be well. This is not a bug. Bind was trying to write to the etc directory when it should have been writing to the /var/named directory.

This is not a bug just a misunderstanding to selinux and how bind works as a slave.

problem solved.

Thanks,
-Jon


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