It seems there is a cron job that produce avc shipped with nsd, a dns server : type=AVC msg=audit(1375016461.763:348120): avc: denied { search } for pid=29878 comm="nsdc" name="root" dev="dm-1" ino=390153 scontext=system_u:system_r:nsd_crond_t:s0-s0:c0.c1023 tcontext=system_u:object_r:admin_home_t:s0 tclass=dir type=AVC msg=audit(1375016461.717:348113): avc: denied { getattr } for pid=29861 comm="nsdc" path="/root" dev="dm-1" ino=390153 scontext=system_u:system_r:nsd_crond_t:s0-s0:c0.c1023 tcontext=system_u:object_r:admin_home_t:s0 tclass=dir the cron job is /etc/cron.hourly/nsd But I do not know why it try to read anything there, as i cannot find why when running with strace. I am not sure that's a problem in the policy, or a problem in nsdc.
It looks like it is the shell script /usr/sbin/nsdc that's causing this. Perhaps add a "cd ~nsd" near the top of that script?
We can either fix a script or add dontuadit rules. I guess everything works correctly.
I would choose "fix the script". Let me give a test run, I will report if it worked.
It is probably looking at its homedir.
the homedir of nsd is not /etc/unbound but /etc/nsd/
So : cd ~nsd just after [ -r /etc/sysconfig/nsd ] && . /etc/sysconfig/nsd fix the issue. I can cook a proper patch tomorow
What I meant is it is probably looking at the homedir of UID=0, which would be /root.
michael: that would only work for RHEL 5/6 that uses initscripts. It would not fix the issue when using systemd that currently has: [Service] Type=simple PIDFile=/var/run/nsd/nsd.pid EnvironmentFile=-/etc/sysconfig/nsd ExecStartPre=/usr/sbin/nsdc -c /etc/nsd/nsd.conf rebuild ExecStart=/usr/sbin/nsd -D -c /etc/nsd/nsd.conf $OTHER_NSD_OPTS ExecReload=/usr/sbin/nsdc -c /etc/nsd/nsd.conf rebuild ExecReload=/usr/sbin/nsdc -c /etc/nsd/nsd.conf reload # notify blocks on misconfigurations - but does show it very loudly ExecReload=/usr/sbin/nsdc -c /etc/nsd/nsd.conf notify ExecStop=/usr/sbin/nsdc -c /etc/nsd/nsd.conf patch ExecStop=/usr/sbin/nsdc -c /etc/nsd/nsd.conf stop So I think it's better for this to get into /usr/sbin/nsdc
We are speaking of the cronjob, not of the initscript, see the patch I am gonna attach. I did test on Fedora 19 on my server, a,d I checked there is no AVC at all when systemd start, stop or restart nsd on Fedora 19. The only issue is the cronjob, and this is fixed with a change of directory. And adding cd ~nsd in the nsdc tool is gonna break people using relative path with -c.
Created attachment 780743 [details] patch fixing the issue
This message is a notice that Fedora 19 is now at end of life. Fedora has stopped maintaining and issuing updates for Fedora 19. It is Fedora's policy to close all bug reports from releases that are no longer maintained. Approximately 4 (four) weeks from now this bug will be closed as EOL if it remains open with a Fedora 'version' of '19'. 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. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 19 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 change the 'version' to a later Fedora version prior this bug is closed as described in the policy above. 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.
This bug appears to have been reported against 'rawhide' during the Fedora 22 development cycle. Changing version to '22'. More information and reason for this action is here: https://fedoraproject.org/wiki/Fedora_Program_Management/HouseKeeping/Fedora22
Fedora 22 changed to end-of-life (EOL) status on 2016-07-19. Fedora 22 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. If you are unable to reopen this bug, please file a new report against the current release. If you experience problems, please add a comment to this bug. Thank you for reporting this bug and we are sorry it could not be fixed.