Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 1671019

Summary: Selinux AVC for /var/run/faillock/
Product: Red Hat Enterprise Linux 8 Reporter: philippe Maupertuis <philippe.maupertuis>
Component: selinux-policyAssignee: Zdenek Pytela <zpytela>
Status: CLOSED ERRATA QA Contact: Milos Malik <mmalik>
Severity: medium Docs Contact:
Priority: medium    
Version: 8.1CC: jjaburek, lvrabec, mmalik, philippe.maupertuis, plautrba, ssekidde, zpytela
Target Milestone: rcKeywords: Patch
Target Release: 8.2Flags: pm-rhel: mirror+
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-04-28 16:40:34 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1673107, 1682526    
Bug Blocks:    

Description philippe Maupertuis 2019-01-30 15:05:35 UTC
Description of problem:
At 23:16:07 01/25/2019 system, acting as root, unsuccessfully accessed-mac-policy-controlled-object /var/run/faillock/ using /usr/lib/systemd/systemd
At 16:52:02 01/29/2019 system, acting as root, unsuccessfully accessed-mac-policy-controlled-object /var/run/faillock/fr18358 using /usr/libexec/cockpit-session

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


How reproducible:


Steps to Reproduce:
1. Set up a rehl8 beta 1
2. Login with wrong password
3. Login successfully and launch cockpit

Actual results:
SELINUX AVC

Expected results:
Access granted

Additional info:

Comment 1 Milos Malik 2019-01-30 15:22:17 UTC
Please attach SELinux denials which appeared on your machine:

# ausearch -m avc -m user_avc -m selinux_err -m user_selinux_err -i -ts today

Thank you.

Comment 2 philippe Maupertuis 2019-01-30 19:06:56 UTC
Please find below the result of the command:
ausearch -m avc -m user_avc -m selinux_err -m user_selinux_err -i
----
type=PROCTITLE msg=audit(01/25/2019 23:16:07.157:347) : proctitle=(systemd)
type=PATH msg=audit(01/25/2019 23:16:07.157:347) : item=0 name=/var/run/faillock/ inode=24723 dev=00:17 mode=dir,755 ouid=root ogid=root rdev=00:00 obj=system_u:object_r:faillog_t:s0 nametype=PARENT cap_fp=none cap_fi=none cap_fe=0 cap_fver=0
type=CWD msg=audit(01/25/2019 23:16:07.157:347) : cwd=/
type=SYSCALL msg=audit(01/25/2019 23:16:07.157:347) : arch=x86_64 syscall=openat success=no exit=EACCES(Permission denied) a0=0xffffff9c a1=0x5626afa30f50 a2=O_RDWR|O_CREAT a3=0x180 items=1 ppid=1 pid=1988 auid=unset uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=(none) ses=unset comm=(systemd) exe=/usr/lib/systemd/systemd subj=system_u:system_r:init_t:s0 key=logins
type=AVC msg=audit(01/25/2019 23:16:07.157:347) : avc:  denied  { write } for  pid=1988 comm=(systemd) name=faillock dev="tmpfs" ino=24723 scontext=system_u:system_r:init_t:s0 tcontext=system_u:object_r:faillog_t:s0 tclass=dir permissive=0
----
type=PROCTITLE msg=audit(01/26/2019 00:39:07.829:283) : proctitle=(systemd)
type=PATH msg=audit(01/26/2019 00:39:07.829:283) : item=0 name=/var/run/faillock/ inode=24326 dev=00:17 mode=dir,755 ouid=root ogid=root rdev=00:00 obj=system_u:object_r:faillog_t:s0 nametype=PARENT cap_fp=none cap_fi=none cap_fe=0 cap_fver=0
type=CWD msg=audit(01/26/2019 00:39:07.829:283) : cwd=/
type=SYSCALL msg=audit(01/26/2019 00:39:07.829:283) : arch=x86_64 syscall=openat success=no exit=EACCES(Permission denied) a0=0xffffff9c a1=0x5617a91fce20 a2=O_RDWR|O_CREAT a3=0x180 items=1 ppid=1 pid=1166 auid=unset uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=(none) ses=unset comm=(systemd) exe=/usr/lib/systemd/systemd subj=system_u:system_r:init_t:s0 key=logins
type=AVC msg=audit(01/26/2019 00:39:07.829:283) : avc:  denied  { write } for  pid=1166 comm=(systemd) name=faillock dev="tmpfs" ino=24326 scontext=system_u:system_r:init_t:s0 tcontext=system_u:object_r:faillog_t:s0 tclass=dir permissive=0
----
type=PROCTITLE msg=audit(01/29/2019 13:38:31.856:299) : proctitle=(systemd)
type=PATH msg=audit(01/29/2019 13:38:31.856:299) : item=0 name=/var/run/faillock/ inode=24359 dev=00:17 mode=dir,755 ouid=root ogid=root rdev=00:00 obj=system_u:object_r:faillog_t:s0 nametype=PARENT cap_fp=none cap_fi=none cap_fe=0 cap_fver=0
type=CWD msg=audit(01/29/2019 13:38:31.856:299) : cwd=/
type=SYSCALL msg=audit(01/29/2019 13:38:31.856:299) : arch=x86_64 syscall=openat success=no exit=EACCES(Permission denied) a0=0xffffff9c a1=0x5599122f1d60 a2=O_RDWR|O_CREAT a3=0x180 items=1 ppid=1 pid=1295 auid=unset uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=(none) ses=unset comm=(systemd) exe=/usr/lib/systemd/systemd subj=system_u:system_r:init_t:s0 key=logins
type=AVC msg=audit(01/29/2019 13:38:31.856:299) : avc:  denied  { write } for  pid=1295 comm=(systemd) name=faillock dev="tmpfs" ino=24359 scontext=system_u:system_r:init_t:s0 tcontext=system_u:object_r:faillog_t:s0 tclass=dir permissive=0
----
type=PROCTITLE msg=audit(01/29/2019 16:52:02.528:1190) : proctitle=/usr/libexec/cockpit-session localhost
type=PATH msg=audit(01/29/2019 16:52:02.528:1190) : item=0 name=/var/run/faillock/fr18358 inode=46444 dev=00:17 mode=file,600 ouid=fr18358 ogid=root rdev=00:00 obj=system_u:object_r:faillog_t:s0 nametype=NORMAL cap_fp=none cap_fi=none cap_fe=0 cap_fver=0
type=CWD msg=audit(01/29/2019 16:52:02.528:1190) : cwd=/
type=SYSCALL msg=audit(01/29/2019 16:52:02.528:1190) : arch=x86_64 syscall=openat success=no exit=EACCES(Permission denied) a0=0xffffff9c a1=0x557cf58824a0 a2=O_RDWR a3=0x0 items=1 ppid=5892 pid=5912 auid=unset uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=(none) ses=unset comm=cockpit-session exe=/usr/libexec/cockpit-session subj=system_u:system_r:cockpit_session_t:s0 key=logins 
type=AVC msg=audit(01/29/2019 16:52:02.528:1190) : avc:  denied  { dac_override } for  pid=5912 comm=cockpit-session capability=dac_override  scontext=system_u:system_r:cockpit_session_t:s0 tcontext=system_u:system_r:cockpit_session_t:s0 tclass=capability permissive=0
----
type=PROCTITLE msg=audit(01/29/2019 16:52:02.558:1192) : proctitle=/usr/libexec/cockpit-session localhost
type=PATH msg=audit(01/29/2019 16:52:02.558:1192) : item=0 name=/var/run/faillock/fr18358 inode=46444 dev=00:17 mode=file,600 ouid=fr18358 ogid=root rdev=00:00 obj=system_u:object_r:faillog_t:s0 nametype=NORMAL cap_fp=none cap_fi=none cap_fe=0 cap_fver=0
type=CWD msg=audit(01/29/2019 16:52:02.558:1192) : cwd=/
type=SYSCALL msg=audit(01/29/2019 16:52:02.558:1192) : arch=x86_64 syscall=openat success=no exit=EACCES(Permission denied) a0=0xffffff9c a1=0x557cf5885990 a2=O_RDWR a3=0x0 items=1 ppid=5892 pid=5912 auid=unset uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=(none) ses=unset comm=cockpit-session exe=/usr/libexec/cockpit-session subj=system_u:system_r:cockpit_session_t:s0 key=logins 
type=AVC msg=audit(01/29/2019 16:52:02.558:1192) : avc:  denied  { dac_override } for  pid=5912 comm=cockpit-session capability=dac_override  scontext=system_u:system_r:cockpit_session_t:s0 tcontext=system_u:system_r:cockpit_session_t:s0 tclass=capability permissive=0
----

Comment 14 Zdenek Pytela 2019-12-09 15:15:32 UTC
In this audit record:
----
type=PROCTITLE msg=audit(01/29/2019 16:52:02.558:1192) : proctitle=/usr/libexec/cockpit-session localhost
type=PATH msg=audit(01/29/2019 16:52:02.558:1192) : item=0 name=/var/run/faillock/fr18358 inode=46444 dev=00:17 mode=file,600 ouid=fr18358 ogid=root rdev=00:00 obj=system_u:object_r:faillog_t:s0 nametype=NORMAL cap_fp=none cap_fi=none cap_fe=0 cap_fver=0
type=CWD msg=audit(01/29/2019 16:52:02.558:1192) : cwd=/
type=SYSCALL msg=audit(01/29/2019 16:52:02.558:1192) : arch=x86_64 syscall=openat success=no exit=EACCES(Permission denied) a0=0xffffff9c a1=0x557cf5885990 a2=O_RDWR a3=0x0 items=1 ppid=5892 pid=5912 auid=unset uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=(none) ses=unset comm=cockpit-session exe=/usr/libexec/cockpit-session subj=system_u:system_r:cockpit_session_t:s0 key=logins 
type=AVC msg=audit(01/29/2019 16:52:02.558:1192) : avc:  denied  { dac_override } for  pid=5912 comm=cockpit-session capability=dac_override  scontext=system_u:system_r:cockpit_session_t:s0 tcontext=system_u:system_r:cockpit_session_t:s0 tclass=capability permissive=0
----

it is reported the /var/run/faillock/fr18358 file is owned by user fr18358 and has mode 0600, but the cockpit session runs under user root. I suppose it should be fixed in faillog or cockpit. One of the options is mode 640 as the file's group is set to root.

Comment 22 errata-xmlrpc 2020-04-28 16:40:34 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-2020:1773