SELinux is preventing cockpit-session from create access on the file .google_authenticator~Dg1YSq. ***** Plugin catchall (100. confidence) suggests ************************** If you believe that cockpit-session should be allowed create access on the .google_authenticator~Dg1YSq file by default. Then you should report this as a bug. You can generate a local policy module to allow this access. Do allow this access for now by executing: # ausearch -c 'cockpit-session' --raw | audit2allow -M my-cockpitsession # semodule -X 300 -i my-cockpitsession.pp Additional Information: Source Context system_u:system_r:cockpit_session_t:s0 Target Context system_u:object_r:user_home_dir_t:s0 Target Objects .google_authenticator~Dg1YSq [ file ] Source cockpit-session Source Path cockpit-session Port <Unknown> Host bamboo Source RPM Packages Target RPM Packages Policy RPM selinux-policy-3.14.4-39.fc31.noarch Selinux Enabled True Policy Type targeted Enforcing Mode Enforcing Host Name bamboo Platform Linux bamboo 5.3.7-301.fc31.x86_64 #1 SMP Mon Oct 21 19:18:58 UTC 2019 x86_64 x86_64 Alert Count 2 First Seen 2019-10-31 13:59:33 CDT Last Seen 2019-10-31 14:08:14 CDT Local ID f939b7d9-da40-4d65-9ef1-662662711c0f Raw Audit Messages type=AVC msg=audit(1572548894.119:959): avc: denied { create } for pid=15317 comm="cockpit-session" name=".google_authenticator~Dg1YSq" scontext=system_u:system_r:cockpit_session_t:s0 tcontext=system_u:object_r:user_home_dir_t:s0 tclass=file permissive=0 Hash: cockpit-session,cockpit_session_t,user_home_dir_t,file,create
Hi Cockpit maintainers, Could you please put SELinux to permissive and test this feature and collect all SELinux denials? Then we could fix it in SELinux policy, but I would like to get approval what should be added to cockpit policy first. Thanks, Lukas.
@Gwyn, are you in a position to do that? If not, can you please describe how you set up your system, so that we can replicate? I. e. this certainly requires changes to the PAM config and such. Thanks!
I can, just let me know specifically the commands you want me to use. The only change other than package installation is this in /etc/pam.d/cockpit: auth required pam_google_authenticator.so
Martin, If you can reproduce it and give me list of SELinux denials, I can add these rules as SELinux boolean to the distribution policy. Thanks, Lukas.
@Lukas: Sorry for the delay! Here we are. I set up google-authenticator with Cockpit on current Fedora 31 (selinux-policy-3.14.4-39.fc31.noarch). After "setenforce 0", 2FA works (yay!), and I get these four violations: AVC avc: denied { create } for pid=8358 comm="cockpit-session" name=".google_authenticator~CeLwZc" scontext=system_u:system_r:cockpit_session_t:s0 tcontext=system_u:object_r:user_home_dir_t:s0 tclass=file permissive=1 AVC avc: denied { read write open } for pid=8358 comm="cockpit-session" path="/home/admin/.google_authenticator~CeLwZc" dev="dm-0" ino=395796 scontext=system_u:system_r:cockpit_session_t:s0 tcontext=system_u:object_r:user_home_dir_t:s0 tclass=file permissive=1 AVC avc: denied { setattr } for pid=8358 comm="cockpit-session" name=".google_authenticator~CeLwZc" dev="dm-0" ino=395796 scontext=system_u:system_r:cockpit_session_t:s0 tcontext=system_u:object_r:user_home_dir_t:s0 tclass=file permissive=1 AVC avc: denied { rename } for pid=8358 comm="cockpit-session" name=".google_authenticator~CeLwZc" dev="dm-0" ino=395796 scontext=system_u:system_r:cockpit_session_t:s0 tcontext=system_u:object_r:user_home_dir_t:s0 tclass=file permissive=1 Allowing these sounds perfectly sensible to me -- This is just doing "by the book" updating of a file, and by design 2FA needs to update the file to update its time stamps and such. As these changes need to be done in selinux-policy, I'm reassigning if you don't mind?
Hi Martin, Ok this should be fixed on our side. Martin, would it be possible to provide some VM for testing purposes? @Patrik, We need SELinux boolean for cockpit to allow access user homedirs ( allow google-authenticator for cockpit), which will be turned off by default. THanks, Lukas.
*** Bug 1771041 has been marked as a duplicate of this bug. ***
@Patrik, We need to make it more generic and allow it also for sshd domain via boolean.
Do we have any updates on when this bug is likely to be closed?
Hi Aimery de Malet Roquefort, Patrik is working on the fix: https://github.com/fedora-selinux/selinux-policy/pull/293 Thanks, Lukas.
Any further updates on when this will be pulled into the main active branch of Fedora? Seems we have been waiting for this relatively simple fix forever.
Hi Aimery, fix is still in progress. Thanks, Patrik.
Hello. Any progress on that fix? Or at least a workaround? Thanks, Michał
Hi Michal, we almost finished this fix, but this fix not depend only on selinux component. So it also depend on agreement with maintainers of google authenticator.
This message is a reminder that Fedora 31 is nearing its end of life. Fedora will stop maintaining and issuing updates for Fedora 31 on 2020-11-24. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a Fedora 'version' of '31'. 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 31 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.
Fedora 31 changed to end-of-life (EOL) status on 2020-11-24. Fedora 31 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.