Cached authentication

QA Handover session

Problem statement

  1. Identity lookups

    • Shell commands: id, getent but also ls
    • Common call such as:
      ls -l
      can generate huge number of queries SSSD has to handle
    • SSSD already uses cache to optimize performance of identity lookups

  2. Authentication

    • Shell commands: su, ssh
    • Authentication is always performed against server
    • Requests generally happen less frequently than identity lookups
    • Growing number of users and servers running under high workload (e.g. when many users log in simultaneously)
    • Logging might take too long

Solution

In plain English it means that if cached_auth_timeout=900, then after successful on-line authentication all subsequent authentication attempts for next 15 minutes will be served from cache (at least all succesfull attempts; see special cases for details)

Configuration

It is simple!

  1. Add cached_auth_timeout to the domain section in sssd.conf
  2. Check that option cache_credentials is set to true in the domain section
  3. Restart SSSD

Example of sssd.conf

[domain/domain.dev]
cache_credentials = True
krb5_store_password_if_offline = True
ipa_domain = domain.dev
id_provider = ipa
auth_provider = ipa
access_provider = ipa
ipa_hostname = client.domain.dev
chpass_provider = ipa
dyndns_update = True
ipa_server = ipa.domain.dev
ldap_tls_cacert = /etc/ipa/ca.crt
realmd_tags = manages-system
default_shell = /bin/bash
use_fully_qualified_names = True
fallback_homedir = /home/%d/%u
cached_auth_timeout = 150

[sssd]
services = nss, sudo, pam, ssh
config_file_version = 2
domains = domain.dev

[nss]
homedir_substring = /home

[pam]
# you might consider to uncomment this option to see more verbose output while authenticating
#pam_verbosity = 2
          

Special cases

Further sources of information

Thanks

Questions?

/