Bug 1661822 - pam_faillock needs cap_dac_override
Summary: pam_faillock needs cap_dac_override
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: pam
Version: 32
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Iker Pedrosa
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: sync-to-jira
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-12-23 16:13 UTC by dac.override
Modified: 2020-07-28 15:00 UTC (History)
1 user (show)

Fixed In Version: pam-1.3.1-26.fc32 pam-1.3.1-25.fc31
Clone Of:
Environment:
Last Closed: 2020-06-27 02:06:48 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description dac.override 2018-12-23 16:13:46 UTC
Description of problem:
pam_faillock needs cap_dac_override because it creates the /run/faillock/USER files with USER.root and mode 0600.

pam_faillock then needs cap_dac_override to be able to write records to these files.

Maybe mode 0660 is more appropriate?

Version-Release number of selected component (if applicable):
pam-1.3.1-15.fc30.x86_64

How reproducible:
disallow cap_dac_override and see how pam_faillock breaks without any notice

Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 dac.override 2018-12-23 17:29:53 UTC
On a slightly unrelated note:  would it be possible to open these files for append only? Currently it opens it for write but is we can do with append only then we can use selinux to prevent erasing of records

Comment 2 Tomas Mraz 2019-01-03 09:18:12 UTC
Changing the mode to 0660 should work and it should probably still be safe, I'll need to think about it though.

The files are not 'append only' the records are overwritten when successful login happens. So the comment 1 does not make sense.

Comment 3 dac.override 2019-01-03 19:58:15 UTC
Oh, right. I did not realize that records were being removed after success. I though only the faillock command would remove records.

About the dac_override: I noticed this issue when i tried pam_faillock, my openssh-server does not have access to cap_dac_override and so pam_faillock did not work.

I would prefer to not give daemons like openssh-server dac_override capability unless strictly necessary.

Comment 4 Ben Cotton 2019-08-13 17:04:46 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 31 development cycle.
Changing version to '31'.

Comment 5 Ben Cotton 2019-08-13 19:38:16 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 31 development cycle.
Changing version to 31.

Comment 6 Ben Cotton 2020-02-11 15:49:30 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 32 development cycle.
Changing version to 32.

Comment 7 Iker Pedrosa 2020-06-11 15:54:38 UTC
I've fixed the problem by changing the permissions of the file to 0660, so nowadays you shouldn't have any problem. Can you test it? I've done a build for Fedora 32: https://koji.fedoraproject.org/koji/taskinfo?taskID=45597282

Comment 8 dac.override 2020-06-11 16:27:06 UTC
This fixes it for me (sshd no longer needs cap_dac_override just for pam_faillock)

Comment 9 Iker Pedrosa 2020-06-15 07:48:40 UTC
Thank you for the test!

Comment 10 Iker Pedrosa 2020-06-17 13:07:30 UTC
* master
    395915dae1571e10e2766c999974de864655ea3a - pam_faillock: change /run/faillock/$USER permissions to 0660

Comment 11 Fedora Update System 2020-06-24 13:43:10 UTC
FEDORA-2020-de9a616c38 has been submitted as an update to Fedora 32. https://bodhi.fedoraproject.org/updates/FEDORA-2020-de9a616c38

Comment 12 Fedora Update System 2020-06-25 01:03:48 UTC
FEDORA-2020-de9a616c38 has been pushed to the Fedora 32 testing repository.
In short time you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2020-de9a616c38`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-de9a616c38

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 13 Fedora Update System 2020-06-27 02:06:48 UTC
FEDORA-2020-de9a616c38 has been pushed to the Fedora 32 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 14 Fedora Update System 2020-07-10 07:46:09 UTC
FEDORA-2020-025ab83d69 has been submitted as an update to Fedora 31. https://bodhi.fedoraproject.org/updates/FEDORA-2020-025ab83d69

Comment 15 Fedora Update System 2020-07-11 02:06:11 UTC
FEDORA-2020-025ab83d69 has been pushed to the Fedora 31 testing repository.
In short time you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2020-025ab83d69`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-025ab83d69

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 16 Fedora Update System 2020-07-28 15:00:59 UTC
FEDORA-2020-025ab83d69 has been pushed to the Fedora 31 stable repository.
If problem still persists, please make note of it in this bug report.


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