Bug 35088 - Deny logins if user account expiration date has been reached
Deny logins if user account expiration date has been reached
Status: RESOLVED WONTFIX
Product: UCS
Classification: Unclassified
Component: LDAP
UCS 4.1
Other Linux
: P5 normal (vote)
: UCS 4.0-x
Assigned To: UCS maintainers
:
Depends on: 35329
Blocks:
  Show dependency treegraph
 
Reported: 2014-06-10 16:35 CEST by Sönke Schwardt-Krummrich
Modified: 2022-05-21 08:08 CEST (History)
3 users (show)

See Also:
What kind of report is it?: ---
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sönke Schwardt-Krummrich univentionstaff 2014-06-10 16:35:09 CEST
Currently a LDAP bind is possible if a user account has expired/reached the expiration date. This also affects 3rd party products which rely on LDAP bind as authentication method.

Possible solution:
A cronjob is looking for expired user accounts (*not* expired user passwords!) and disables at least the POSIX/LDAP login for these accounts.
Comment 1 Sönke Schwardt-Krummrich univentionstaff 2014-07-09 21:20:25 CEST
The cronjob script has to search for objects whose shadowExpire values are in a specific range. This is only possible if the LDAP server is able to compare/sort those values. Patching the LDAP schema "nis.schema" has been outsourced to 
Bug 35329.
Comment 2 Sönke Schwardt-Krummrich univentionstaff 2014-10-17 16:31:02 CEST
The package univention-ldap now adds the attributes shadowMax and shadowExpire to the LDAP indices:
- shadowMax → pres
- shadowExpire → eq
This way, the object lookup will much faster is large environments. The shadowMax attribute is required for Bug #36215 that has been also fixed.

YAML: 2014-10-17-univention-ldap.yaml

In univention-server-master (src pkg: univention-server) a new cron job has been added that calls the new script
/usr/share/univention-directory-manager-tools/lock_expired_accounts on a daily basis.
The cron job is called every night at 03:17 (this may be changed via UCR but is undocumented on purpose; if unset 03:17 is used).
The cron job may be disabled via directory/manager/user/lock_expired_accounts/cron/enabled. By default, the cron job is enabled.

YAML: 2014-10-17-univention-server.yaml

The script looks for user accounts that have expired (shadowExpire <= today). For all accounts found, the POSIX account will be locked so a simple LDAP bind will be no longer possible.
The windows/kerberos login is handled correctly by Windows/kerberos, so no action is required here.

YAML: 2014-10-15-univention-directory-manager-modules.yaml
Comment 4 Sönke Schwardt-Krummrich univentionstaff 2014-10-21 09:44:07 CEST
Changes have been also merged to UCS 4.

(In reply to Stefan Gohmann from comment #3)
> The latest Jenkins test failed:

Disabled some checks due to bug #36210 → FIXED ucs-test
Comment 5 Felix Botner univentionstaff 2014-10-29 18:04:04 CET
OK - ldap indices (shadowExpire in eq, shadowMax in pres)
OK - cron job (activated by default, configurable)
OK - lock_expired_accounts (last week, dry run, ...)

S3:

OK - User with shadowExpire < today 
     -> lock_expired_accounts
     -> account is locked (no UMC, no ldap bind, no kinit, no pam)

S4:

OK - User with shadowExpire < today 
     -> lock_expired_accounts
     -> account is locked (no UMC, no ldap bind, no kinit, no pam, no smbclient)

FYI:

If "Account deactivation" is set to "POSIX disabled" or "all" shadowExpire is set to 1 and lock_expired_accounts then disables the POSIX login method (no more ldapbind). But that should be OK.
In a s4 env the users quest and krbtgt have "All disabled" and lock_expired_accounts locks the POSIX login method. Should be OK too.

OK - 2014-10-17-univention-ldap.yaml
OK - 2014-10-17-univention-server.yaml
OK - 2014-10-15-univention-directory-manager-modules.yaml
Comment 6 Felix Botner univentionstaff 2014-11-06 12:31:59 CET
Please revert the changes, we move this to errata4.0-0.
Comment 7 Stefan Gohmann univentionstaff 2014-11-07 07:11:14 CET
(In reply to Felix Botner from comment #6)
> Please revert the changes, we move this to errata4.0-0.

done, see Bug #36215
Comment 8 Florian Best univentionstaff 2017-02-09 17:49:54 CET
Is this a duplicate of Bug #36215 ?
Comment 9 Stefan Gohmann univentionstaff 2019-01-03 07:22:17 CET
This issue has been filled against UCS 4.1. The maintenance with bug and security fixes for UCS 4.1 has ended on 5st of April 2018.

Customers still on UCS 4.1 are encouraged to update to UCS 4.3. Please contact
your partner or Univention for any questions.

If this issue still occurs in newer UCS versions, please use "Clone this bug" or simply reopen the issue. In this case please provide detailed information on how this issue is affecting you.