Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 785875

Summary: [RFE] honor eDirectory account lockout
Product: Red Hat Enterprise Linux 7 Reporter: Stephen Gallagher <sgallagh>
Component: sssdAssignee: Jakub Hrozek <jhrozek>
Status: CLOSED WONTFIX QA Contact: Kaushik Banerjee <kbanerje>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.0CC: dpal, grajaiya, jgalipea, jhrozek, prc
Target Milestone: rcKeywords: FutureFeature
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-05-09 13:51:32 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Stephen Gallagher 2012-01-30 20:14:14 UTC
This bug is created as a clone of upstream ticket:
https://fedorahosted.org/sssd/ticket/673

This is similar to #672 but about using the Novell NDS/eDirectory fields instead of the NIS ones.

Relevant ones are:

loginDisabled: boolean

loginExpirationTime: Unix timestamp (UTC)

loginAllowedTimeMap: binary blob

The last one is a bit magical and indicates when during a day an account is allowed to log in. Some details here:

http://developer.novell.com/documentation/ndslib/schm_enu/data/sdk1588.html

Might be overkill supporting that one and the first two are probably more essential.

Comment 3 Jenny Severance 2013-03-13 18:38:05 UTC
please add steps to reproduce and verify with RHDS or openLDAP

Comment 4 Jakub Hrozek 2013-03-19 09:54:18 UTC
Veifying the loginDisabled and loginExpiration time should be easy, they are well documented and as far as LDAP goes they are just strings. 

In both cases, you can either extend the schema to really contain the new attributes or, which may be simpler, use another attribute (say, gecos, or description) and simply set an override on the config option, like this:

ldap_user_nds_login_disabled = gecos

the above would fetch the loginDisabled data from the gecos attribute.

The loginDisabled attribute is just a string that contains a boolean true/false value. So when you set it to "true", access should be denied. In the logs you should see messages from sdap_account_expired_nds().

The loginExpirationTime is a date-and-time field (UTC) representing when will be the account expired, If you're past this date, you shouldn't be allowed to login.
The format is YYYYMMDDHHMMSS, for instance 20130319194530 would mean that a user can only login until 2013-Mar-19 19:45:30.

As stated in the opening ticket, the loginAllowedTimeMap is harder and actually supporting it might be a nice-to-have. The attribute is a binary one. It is a bitmap that consists of 42 bytes (336 bits) representing 30-minutes intervals in a week. A good start would be to make sure that all zeroes always deny access and all ones always allow access. You should use base64 -d to encode the binary blob into base64 format and then load the attribute with a double-colon (loginAllowedTimeMap:: blob).

If either of these attributes is missing completely, access is granted.