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 1422000 - SELinux is preventing /usr/bin/certwatch from using the dac_override capability
Summary: SELinux is preventing /usr/bin/certwatch from using the dac_override capability
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: selinux-policy
Version: 7.4
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Lukas Vrabec
QA Contact: Milos Malik
URL:
Whiteboard:
: 1465185 (view as bug list)
Depends On:
Blocks: 1381083 1420851 1486258
TreeView+ depends on / blocked
 
Reported: 2017-02-14 09:55 UTC by Petr Sklenar
Modified: 2021-06-10 11:55 UTC (History)
11 users (show)

Fixed In Version: selinux-policy-3.13.1-170.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1486258 (view as bug list)
Environment:
Last Closed: 2018-04-10 12:26:56 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:0763 0 normal SHIPPED_LIVE selinux-policy bug fix and enhancement update 2018-04-10 12:08:10 UTC

Description Petr Sklenar 2017-02-14 09:55:54 UTC
Description of problem:
there are many denial

Version-Release number of selected component (if applicable):
crypto-utils-2.4.1-42.el7.x86_64
selinux-policy-3.13.1-117.el7.noarch

How reproducible:
tried once only

Steps to Reproduce:
1.reboot the machine
2.
3.

Actual results:
/varlog/message:

Feb 13 15:30:02 localhost certwatch: ObjectStore.cpp(59): Failed to enumerate object store in /var/lib/softhsm/tokens/
Feb 13 15:30:02 localhost certwatch: SoftHSM.cpp(476): Could not load the object store
Feb 13 15:30:02 localhost certwatch: ObjectStore.cpp(59): Failed to enumerate object store in /var/lib/softhsm/tokens/
Feb 13 15:30:02 localhost certwatch: SoftHSM.cpp(476): Could not load the object store
Feb 13 15:30:02 localhost dbus-daemon: dbus[710]: [system] Activating service name='org.fedoraproject.Setroubleshootd' (using servicehelper)
Feb 13 15:30:02 localhost dbus[710]: [system] Activating service name='org.fedoraproject.Setroubleshootd' (using servicehelper)
Feb 13 15:30:02 localhost certwatch: ObjectStore.cpp(59): Failed to enumerate object store in /var/lib/softhsm/tokens/
Feb 13 15:30:02 localhost certwatch: SoftHSM.cpp(476): Could not load the object store
Feb 13 15:30:02 localhost certwatch: ObjectStore.cpp(59): Failed to enumerate object store in /var/lib/softhsm/tokens/
Feb 13 15:30:02 localhost certwatch: SoftHSM.cpp(476): Could not load the object store
Feb 13 15:30:02 localhost certwatch: ObjectStore.cpp(59): Failed to enumerate object store in /var/lib/softhsm/tokens/
Feb 13 15:30:02 localhost certwatch: SoftHSM.cpp(476): Could not load the object store
Feb 13 15:30:02 localhost certwatch: ObjectStore.cpp(59): Failed to enumerate object store in /var/lib/softhsm/tokens/
Feb 13 15:30:02 localhost certwatch: SoftHSM.cpp(476): Could not load the object store
Feb 13 15:30:02 localhost dbus[710]: [system] Successfully activated service 'org.fedoraproject.Setroubleshootd'
Feb 13 15:30:02 localhost dbus-daemon: dbus[710]: [system] Successfully activated service 'org.fedoraproject.Setroubleshootd'
Feb 13 15:30:03 localhost setroubleshoot: SELinux is preventing /usr/bin/certwatch from using the dac_override capability. For complete SELinux messages. run sealert -l 62b6dfbb-62e0-449b-86df-b073cd038129
Feb 13 15:30:03 localhost python: SELinux is preventing /usr/bin/certwatch from using the dac_override capability.#012#012*****  Plugin dac_override (91.4 confidence) suggests   **********************#012#012If you want to help identify if domain needs this access or you have a file with the wrong permissions on your system#012Then turn on full auditing to get path information about the offending file and generate the error again.#012Do#012#012Turn on full auditing#012# auditctl -w /etc/shadow -p w#012Try to recreate AVC. Then execute#012# ausearch -m avc -ts recent#012If you see PATH record check ownership/permissions on file, and fix it,#012otherwise report as a bugzilla.#012#012*****  Plugin catchall (9.59 confidence) suggests   **************************#012#012If you believe that certwatch should have the dac_override capability by default.#012Then you should report this as a bug.#012You can generate a local policy module to allow this access.#012Do#012allow this access for now by executing:#012# ausearch -c 'certwatch' --raw | audit2allow -M my-certwatch#012# semodule -i my-certwatch.pp#012
Feb 13 15:30:03 localhost setroubleshoot: SELinux is preventing /usr/bin/certwatch from using the dac_override capability. For complete SELinux messages. run sealert -l 62b6dfbb-62e0-449b-86df-b073cd038129


/var/log/audit/audit.log
type=AVC msg=audit(1486996202.302:395): avc:  denied  { dac_override } for  pid=17404 comm="certwatch" capability=1  scontext=system_u:system_r:certwatch_t:s0-s0:c0.c1023 tcontext=system_u:system_r:certwatch_t:s0-s0:c0.c1023 tclass=capability
type=AVC msg=audit(1486996202.302:395): avc:  denied  { dac_read_search } for  pid=17404 comm="certwatch" capability=2  scontext=system_u:system_r:certwatch_t:s0-s0:c0.c1023 tcontext=system_u:system_r:certwatch_t:s0-s0:c0.c1023 tclass=capability
type=AVC msg=audit(1486996202.303:396): avc:  denied  { dac_override } for  pid=17404 comm="certwatch" capability=1  scontext=system_u:system_r:certwatch_t:s0-s0:c0.c1023 tcontext=system_u:system_r:certwatch_t:s0-s0:c0.c1023 tclass=capability
type=AVC msg=audit(1486996202.303:396): avc:  denied  { dac_read_search } for  pid=17404 comm="certwatch" capability=2  scontext=system_u:system_r:certwatch_t:s0-s0:c0.c1023 tcontext=system_u:system_r:certwatch_t:s0-s0:c0.c1023 tclass=capability
type=AVC msg=audit(1486996202.327:397): avc:  denied  { dac_override } for  pid=17405 comm="certwatch" capability=1  scontext=system_u:system_r:certwatch_t:s0-s0:c0.c1023 tcontext=system_u:system_r:certwatch_t:s0-s0:c0.c1023 tclass=capability
type=AVC msg=audit(1486996202.327:397): avc:  denied  { dac_read_search } for  pid=17405 comm="certwatch" capability=2  scontext=system_u:system_r:certwatch_t:s0-s0:c0.c1023 tcontext=system_u:system_r:certwatch_t:s0-s0:c0.c1023 tclass=capability

Expected results:
no denial?

Additional info:

Comment 1 Milos Malik 2017-02-14 10:02:41 UTC
Could you paste here the output of following command?

# ls -lR /var/lib/softhsm

Comment 2 Petr Sklenar 2017-02-14 10:18:34 UTC
[root@localhost ~]# ls -lR /var/lib/softhsm
/var/lib/softhsm:
total 0
drwxrwx---. 2 ods ods 6 Jun 23  2016 tokens

/var/lib/softhsm/tokens:
total 0

Comment 7 Jonathan Larmour 2017-04-26 01:23:47 UTC
I have also experienced this AVC denial. Based on for example bug 1389945, I ran the following:

auditctl -w /var/lib/softhsm/tokens -p r

I then manually reproduced the problem with:
runcon -t certwatch_t -u system_u -r system_r /etc/cron.daily/certwatch 

After that, running "ausearch -m avc -ts recent" returns:

time->Wed Apr 26 02:05:38 2017
type=PATH msg=audit(1493168738.149:36388): item=0 name="/var/lib/softhsm/tokens/" objtype=UNKNOWN
type=CWD msg=audit(1493168738.149:36388):  cwd="/root"
type=SYSCALL msg=audit(1493168738.149:36388): arch=c000003e syscall=257 success=no exit=-13 a0=ffffffffffffff9c a1=88d358 a2=90800 a3=0 items=1 ppid=6391 pid=6395 auid=1000 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=pts1 ses=1 comm="certwatch" exe="/usr/bin/certwatch" subj=system_u:system_r:certwatch_t:s0-s0:c0.c1023 key=(null)
type=AVC msg=audit(1493168738.149:36388): avc:  denied  { dac_read_search } for  pid=6395 comm="certwatch" capability=2  scontext=system_u:system_r:certwatch_t:s0-s0:c0.c1023 tcontext=system_u:system_r:certwatch_t:s0-s0:c0.c1023 tclass=capability
type=AVC msg=audit(1493168738.149:36388): avc:  denied  { dac_override } for  pid=6395 comm="certwatch" capability=1  scontext=system_u:system_r:certwatch_t:s0-s0:c0.c1023 tcontext=system_u:system_r:certwatch_t:s0-s0:c0.c1023 tclass=capability
----
time->Wed Apr 26 02:05:38 2017
type=PATH msg=audit(1493168738.150:36389): item=0 name="/var/lib/softhsm/tokens/" objtype=UNKNOWN
type=CWD msg=audit(1493168738.150:36389):  cwd="/root"
type=SYSCALL msg=audit(1493168738.150:36389): arch=c000003e syscall=257 success=no exit=-13 a0=ffffffffffffff9c a1=88d318 a2=90800 a3=0 items=1 ppid=6391 pid=6395 auid=1000 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=pts1 ses=1 comm="certwatch" exe="/usr/bin/certwatch" subj=system_u:system_r:certwatch_t:s0-s0:c0.c1023 key=(null)
type=AVC msg=audit(1493168738.150:36389): avc:  denied  { dac_read_search } for  pid=6395 comm="certwatch" capability=2  scontext=system_u:system_r:certwatch_t:s0-s0:c0.c1023 tcontext=system_u:system_r:certwatch_t:s0-s0:c0.c1023 tclass=capability
type=AVC msg=audit(1493168738.150:36389): avc:  denied  { dac_override } for  pid=6395 comm="certwatch" capability=1  scontext=system_u:system_r:certwatch_t:s0-s0:c0.c1023 tcontext=system_u:system_r:certwatch_t:s0-s0:c0.c1023 tclass=capability
----

(and more)
Perhaps this info will be useful for those with more selinux-fu than I.

Jifl

Comment 8 Lukas Vrabec 2017-06-27 10:57:10 UTC
*** Bug 1465185 has been marked as a duplicate of this bug. ***

Comment 12 errata-xmlrpc 2018-04-10 12:26:56 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:0763


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