LDAP: Difference between revisions

From NURDspace
No edit summary
mNo edit summary
Line 131: Line 131:
* Maintain [http://nurdspace.nl/Category:Members Members] page from LDAP ([http://www.mediawiki.org/wiki/Extension:External_Data#.23get_ldap_data_-_retrieve_data_from_LDAP_directory Like so], but this only displays 1 entry. Could be fixed [http://www.mediawiki.org/wiki/Extension_talk:External_Data/Archive_2012#.23for_external_table_support_for_.23get_ldap_data like so].)
* Maintain [http://nurdspace.nl/Category:Members Members] page from LDAP ([http://www.mediawiki.org/wiki/Extension:External_Data#.23get_ldap_data_-_retrieve_data_from_LDAP_directory Like so], but this only displays 1 entry. Could be fixed [http://www.mediawiki.org/wiki/Extension_talk:External_Data/Archive_2012#.23for_external_table_support_for_.23get_ldap_data like so].)
* Check if the passwordmailer on FusionDirectory works
* Check if the passwordmailer on FusionDirectory works
* Check out [http://www.lichteblau.com/ldapvi/manual/ ldapvi]

Revision as of 20:24, 17 June 2013

NURDspace Project
link=File:{{{Name}}}.jpg
Participants Fwd
Skills
Status
Niche
Purpose
Tool
Location
Cost
Tool category

{{{Name}}}Property "Tool Name" (as page type) with input value "{{{Name}}}" contains invalid characters or is incomplete and therefore can cause unexpected results during a query or annotation process. Property "Tool Image" (as page type) with input value "File:{{{Picture}}}" contains invalid characters or is incomplete and therefore can cause unexpected results during a query or annotation process. {{{Picture}}} {{#if:{{{Tool}}} | [[Tool Owner::{{{ProjectParticipants}}} | }} {{#if:{{{Tool}}} | [[Tool Cost::{{{Cost}}} | }}


For use with Spacenet we've installed OpenLDAP on NURDServer. On the new NURDServices we're going serious with LDAP.

Status

Slapd and FusionDirectory are running on NURDServices. FusionDirectory can be accessed on https://ldap.nurdspace.nl.

Connected machines and services

Workstations

The workstations listed above are set up as follows:

  • Homedirs mounted over NFS from Proxmox1 (except user 'printer' on PrinterPC)
  • Users in the LDAP 'sudo' group can sudo.
  • Homedirs are created on the NFS-export when adding a user to LDAP (like this)

Setting up other workstations in this way

To get this to work you need to:

  • create all local users in LDAP (if they don't exist already)
  • delete local users (optional)
  • move homedirs to nurdservices (fix ownership because LDAP-users have a different UID)
  • delete local homedirs
  • mount /home from proxmox1:/mnt/md0/homedirs over nfs (put it in /etc/fstab)
  • put https://www.sslcertificaten.nl/files/PositiveSSLCA2.crt in /etc/ssl/certs/ with permissions 644
  • install libnss-ldapd (see below for settings asked during installation, in the selection list check passwd, group and shadow)
  • install libpam-ldapd (see below for settings asked during installation)
  • the installation of libnss-ldap and libpam-ldap don't offer all required settings, so fix nslcd.conf and pam_ldap.conf to mention at least the following:
uri ldaps://ldap.nurdspace.nl/
base dc=nurdspace,dc=lan
binddn cn=read-user,ou=systems,dc=nurdspace,dc=lan
bindpw (obtain from other machine)
ssl on
tls_reqcert demand
tls_cacertfile /etc/ssl/certs/PositiveSSLCA2.crt
  • restart nslcd
  • check if ldap users are listed when you run "getent passwd"
  • sudo might not work until you type 'id' which is kind of a mystery

Useful reading: http://www.debian-administration.org/article/OpenLDAP_installation_on_Debian

In certain cases sudo can break. This can be fixed with a patch while it's not fixed properly.

Wiki

require_once( "$IP/extensions/LdapAuthentication/LdapAuthentication.php" );
$wgAuth = new LdapAuthenticationPlugin();

$wgLDAPDomainNames = array( 'nurdspace.lan', );
$wgLDAPServerNames = array( 'nurdspace.lan' => 'ldap.nurdspace.nl', );
$wgLDAPUseLocal = false;
$wgLDAPEncryptionType = array( 'nurdspace.lan' => 'ssl', );
$wgLDAPSearchStrings = array( 'nurdspace.lan' => 'uid=USER-NAME,ou=people,dc=nurdspace,dc=lan', );
$wgLDAPLowerCaseUsername = array( 'nurdspace.lan' => true );
$wgLDAPRequiredGroups = array( 'nurdspace.lan' => array( 'cn=wikiusers,ou=groups,dc=nurdspace,dc=lan', ) );
$wgLDAPGroupUseFullDN = array( "nurdspace.lan"=>false );
$wgLDAPGroupObjectclass = array( "nurdspace.lan"=>"posixGroup" );
$wgLDAPGroupAttribute = array( "nurdspace.lan"=>"memberUid" );
$wgLDAPGroupSearchNestedGroups = array( "nurdspace.lan"=>false );
$wgLDAPGroupNameAttribute = array( "nurdspace.lan"=>"cn" );
$wgLDAPBaseDNs = array( "nurdspace.lan"=>"dc=nurdspace,dc=lan" );
$wgLDAPUseLDAPGroups = array( "nurdspace.lan"=>true );
$wgGroupPermissions['wikiusers']['edit'] = true;
$wgGroupPermissions['admins'] = $wgGroupPermissions['sysop'];

# This hook is called by the LdapAuthentication plugin. It is a configuration hook. Here we
# are specifying what attibute we want to use for a username in the wiki.
# Note that this hook is NOT called on a straight bind.
# The hook calls the function defined below.
$wgHooks['SetUsernameAttributeFromLDAP'][] = 'SetUsernameAttribute';

Some settings might not be necessary, such as the wgGroupPermissions and wgHooks. I'll do some experimenting to see if it can be cleaned up.

Limitations

  • The mediawiki login system converts the first character of usernames to uppercase due to restrictions on usernames. To get around this we've enabled $wgLDAPLowercaseUsernameScheme. This requires usernames to be all lowercase in the LDAP.
  • Users are maintained through the LDAP, so creating a user on the Wiki is no longer possible. It could be enabled, but that would require adding a user with write-access in the LDAP. That seems a little scary for now. It would however offer the possibility of changing your LDAP password through the Wiki.

Wifi

The LDAP serves as a userdb for Spacenet, which is connected via FreeRADIUS. For full details see the Spacenet-page.

Future plans

The most important machines and services are now hooked up to the LDAP. However, there's always room for more.

More groups for different purposes

We should create more groups for specific purposes, such as:

  • Workstation users (now only sudo'ers are treated separately)
  • Separate group per workstation? Or some sort of hierarchy of groups, so members need only be in 1 group?
  • Spacenet users done

(Un)locking the front door

See Spacelock.

Member registration

Currently the users in group "members" are maintained by hand. A little more automation would be appropriate. Hooking it up to actual money transactions might be far-fetched, but maybe something else is possible.

E-mail and contacts services

We could install Zimbra or Zarafa, or maybe some smaller services to provide e-mail accounts, mailinglist functionality and maybe a CardDAV services for members.

Make use of more of FusionDirectory's features

FusionDirectory has features/plugins for applications, mime-types, workstations, object groups, public key authentication. Maybe some of these could be useful?

SAML

There's already a SpaceSAML project, but until this is fully operational we can set up our own construction. This would require setting up an Identity Provider service (such as Shibboleth IdP) and hooking up the Wiki to that.

Wiki

  • Create ACL for a wiki service account that can create (and edit?) users
  • Config said account in the wiki so it's used for creating users

Misc

  • Investigate possibility of moving to a different database back-end ([back-sql])
  • Exclude weak ciphers from olcTLSCipherSuite in cn=config
  • Setting "change password on first login" in FusionDirectory doesn't get enforced through PAM
  • Upgrade FusionDirectory from 1.0.5 to 1.0.6
  • Maintain Members page from LDAP (Like so, but this only displays 1 entry. Could be fixed like so.)
  • Check if the passwordmailer on FusionDirectory works
  • Check out ldapvi