Bug 1886661

Summary: SSH public key authentication keeps working after keys are removed from ID view (due to being cached by SSSD locally)
Product: Red Hat Enterprise Linux 8 Reporter: Ding-Yi Chen <dchen>
Component: sssdAssignee: Paweł Poławski <ppolawsk>
Status: CLOSED WONTFIX QA Contact: sssd-qe <sssd-qe>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 8.3CC: atikhono, bthekkep, grajaiya, jhrozek, lslebodn, mzidek, pbrezina, ppolawsk, sbose, tscherf
Target Milestone: rcKeywords: Triaged
Target Release: ---Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: sync-to-jira
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-04-16 02:13:04 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:

Description Ding-Yi Chen 2020-10-09 05:14:29 UTC
Description of problem:
This bug is a regression of Bug 1537272 - SSH public key authentication keeps working after keys are removed from ID view
https://bugzilla.redhat.com/show_bug.cgi?id=1537272

This happened in RHEL 7.8


Version-Release number of selected component (if applicable):
ipa-client-4.6.6-11.el7.x86_64 
ipa-server-4.6.6-11.el7.x86_64
sssd-1.16.4-37.el7_8.4.x86_64

How reproducible:
Always

Steps to Reproduce:
1. ipa idoverrideuser-add 'Default Trust View' aduser1 --sshpubkey=some-public-key
2. systemctl stop sssd; rm -fr /var/lib/sss/{db,mc}/*; systemctl start sssd
3. ssh -i ~/.ssh/id_rsa -vvv aduser1@localhost
   (Should be able to login with public key)
4. ipa idoverrideuser-del 'Default Trust View' aduser1
5. ssh -i ~/.ssh/id_rsa -vvv aduser1@localhost


Actual results:

Still be able to ssh with public key

Expected results:

No public key, Password prompt should be shown


Additional info:

Workaround: Stop SSSD, clean SSSD db and mc, and start sssd fix the problem

sss_cache -E however does not fix the problem.

Comment 3 Alexey Tikhonov 2020-10-14 15:13:34 UTC
Hi,

(In reply to Ding-Yi Chen from comment #0)
> 
> Workaround: Stop SSSD, clean SSSD db and mc, and start sssd fix the problem

Does this happen on server, client or both? I guess both.


Anyway, I don't think this is a regression.
Comments https://github.com/SSSD/sssd/pull/472#discussion_r160399768 from Sumit says: "I think it might be better to postpone this patch and document that ssh-key will not be deleted immediately in the cache"
So IIUC bz 1537272 resolved issue that ssh-key wasn't removed even during cache update, but didn't address issue of outdated data cached locally.

Comment 5 Ding-Yi Chen 2020-10-16 05:53:32 UTC
> Does this happen on server, client or both? I guess both.

Yes, you are right.

> What are the expectations here: local cache entry being invalidated as soon as `ipa idoverrideuser-del` executed or merely `sss_cache -E` to destroy this attribute?

The customer expects the `ipa idoverrideuser-del` should remove the ssh-key immediately.
Customer does not mention `sss_cache -E`. I just provide it as additional information.

> So IIUC bz 1537272 resolved issue that ssh-key wasn't removed even during cache update, but didn't address issue of outdated data cached locally.

Customer would like to know how often the cache update? 
What option control the frequency of cache update?
So they might not need to manually restart thousands of computers.

Comment 6 Alexey Tikhonov 2020-10-16 10:08:03 UTC
(In reply to Ding-Yi Chen from comment #5)
>
> > So IIUC bz 1537272 resolved issue that ssh-key wasn't removed even during cache update, but didn't address issue of outdated data cached locally.
> 
> Customer would like to know how often the cache update? 
> What option control the frequency of cache update?


`entry_cache_timeout` or, I think, more specifically `entry_cache_user_timeout`.


But please take a note having those value very low can result in significant performance impact.

Comment 13 Ding-Yi Chen 2021-04-16 02:13:04 UTC
Customer has confirmed "entry_cache_timeout" in sssd.conf is working as expected. The corresponding case is closed as the request is fulfilled.

Thanks for your help!

Comment 14 Alexey Tikhonov 2021-04-16 07:32:03 UTC
I'm changing resolution because problem with cache invalidation is a real issue, but it's not something that can be easily addressed/fixed.