RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1423361 - /bin/bash: /etc/cron.hourly/man-db.cron: Permission denied
Summary: /bin/bash: /etc/cron.hourly/man-db.cron: Permission denied
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: selinux-policy
Version: 7.5-Alt
Hardware: All
OS: Linux
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Lukas Vrabec
QA Contact: Milos Malik
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-02-17 05:59 UTC by Karl Latiss
Modified: 2018-10-30 10:01 UTC (History)
6 users (show)

Fixed In Version: selinux-policy-3.13.1-203.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-10-30 10:00:04 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:3111 0 None None None 2018-10-30 10:01:02 UTC

Description Karl Latiss 2017-02-17 05:59:14 UTC
Description of problem:
man-db.cron fails to to run with selinux set to enforcing and CIS hardening applied

Version-Release number of selected component (if applicable):
$ rpm -qa | egrep '(selinux|cron)'
cronie-anacron-1.4.11-14.el7_2.1.x86_64
cronie-1.4.11-14.el7_2.1.x86_64
libselinux-utils-2.5-6.el7.x86_64
selinux-policy-3.13.1-102.el7_3.7.noarch
selinux-policy-targeted-3.13.1-102.el7_3.7.noarch
libselinux-2.5-6.el7.x86_64
libselinux-python-2.5-6.el7.x86_64
crontabs-1.11-6.20121102git.el7.noarch


How reproducible:
Always

Steps to Reproduce:
1. Apply CIS hardening rules (specifically around /etc/cron.* directory permissions)
2.Wait for cron to run
3.

Actual results:
Email stating

/bin/bash: /etc/cron.hourly/man-db.cron: Permission denied

Expected results:
man-db.cron runs without output

Additional info:

node=ip-172-33-0-107.eu-west-1.compute.internal type=PATH msg=audit(17/02/17 03:29:01.403:1958) : item=0 name=/etc/cron.daily/man-db.cron objtype=UNKNOWN 
node=ip-172-33-0-107.eu-west-1.compute.internal type=CWD msg=audit(17/02/17 03:29:01.403:1958) :  cwd=/ 
node=ip-172-33-0-107.eu-west-1.compute.internal type=SYSCALL msg=audit(17/02/17 03:29:01.403:1958) : arch=x86_64 syscall=open success=no exit=EACCES(Permission denied) a0=0x254a1a0 a1=O_RDONLY a2=0x6e6f72 a3=0x3 items=1 ppid=18338 pid=18348 auid=root uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=(none) ses=36 comm=man-db.cron exe=/usr/bin/bash subj=system_u:system_r:mandb_t:s0-s0:c0.c1023 key=(null) 
node=ip-172-33-0-107.eu-west-1.compute.internal type=AVC msg=audit(17/02/17 03:29:01.403:1958) : avc:  denied  { dac_read_search } for  pid=18348 comm=man-db.cron capability=dac_read_search  scontext=system_u:system_r:mandb_t:s0-s0:c0.c1023 tcontext=system_u:system_r:mandb_t:s0-s0:c0.c1023 tclass=capability 
node=ip-172-33-0-107.eu-west-1.compute.internal type=AVC msg=audit(17/02/17 03:29:01.403:1958) : avc:  denied  { dac_override } for  pid=18348 comm=man-db.cron capability=dac_override  scontext=system_u:system_r:mandb_t:s0-s0:c0.c1023 tcontext=system_u:system_r:mandb_t:s0-s0:c0.c1023 tclass=capability 


NOTE: Applying 

$ sudo chcon system_u:object_r:bin_t:s0 /etc/cron.hourly/man-db.cron

as per the other entries in /etc/cron.hourly seems to fix this for me.

Comment 7 errata-xmlrpc 2018-10-30 10:00:04 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2018:3111


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