27.10.2014 Views

LDAP User Authentication in Sybase Adaptive Server Enterprise

LDAP User Authentication in Sybase Adaptive Server Enterprise

LDAP User Authentication in Sybase Adaptive Server Enterprise

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>LDAP</strong> <strong>User</strong> <strong>Authentication</strong> <strong>in</strong><br />

<strong>Sybase</strong> <strong>Adaptive</strong> <strong>Server</strong> <strong>Enterprise</strong><br />

A <strong>Sybase</strong> Technical White Paper<br />

Beta Draft<br />

Information Anywhere


Summary............................................................................................................................ 3<br />

Simplified Adm<strong>in</strong>istration Means Reduced Costs ......................................................... 3<br />

Centralized Log<strong>in</strong> Authority and Policies ...................................................................... 3<br />

Separation of Roles for Privileged <strong>User</strong>s ........................................................................ 3<br />

One Password to Remember............................................................................................ 4<br />

Technical Details ............................................................................................................... 4<br />

Enabl<strong>in</strong>g <strong>LDAP</strong> <strong>User</strong> <strong>Authentication</strong> <strong>in</strong> ASE.................................................................. 5<br />

ASE Log<strong>in</strong> and <strong>LDAP</strong> <strong>User</strong> Account .............................................................................. 7<br />

Conclusion ......................................................................................................................... 9<br />

2


Summary<br />

Lightweight Directory Access Protocol (<strong>LDAP</strong>) is an <strong>in</strong>dustry standard for access<strong>in</strong>g<br />

directory services over a network. New for <strong>Adaptive</strong> <strong>Server</strong> <strong>Enterprise</strong> (ASE) version<br />

12.5.1, user authentication can now be done with an <strong>LDAP</strong> <strong>Server</strong>. The primary benefits<br />

of us<strong>in</strong>g <strong>LDAP</strong> to manage users are:<br />

Centralized password security policies <strong>in</strong> one authority<br />

Simplified creation and deletion of users<br />

Simplified user password for both the operat<strong>in</strong>g system and application<br />

Reduced overall cost of ownership<br />

Simplified Adm<strong>in</strong>istration Means Reduced Costs<br />

While the number of users access<strong>in</strong>g ASE databases may <strong>in</strong>crease, there are fewer IT<br />

resources available to adm<strong>in</strong>ister database servers. For this reason, it is important to<br />

simplify and centralize adm<strong>in</strong>istration – m<strong>in</strong>imiz<strong>in</strong>g the amount of work to keep users<br />

productive and the server runn<strong>in</strong>g and secure.<br />

Centralized Log<strong>in</strong> Authority and Policies<br />

With a centralized log<strong>in</strong> authority, there is one set of policies for a security officer to<br />

focus on, one set of password criteria for users to learn and conform to, and one location<br />

for upgrades and fixes related to passwords. <strong>LDAP</strong> Directory <strong>Server</strong>s are an established<br />

way to accomplish this centralization, especially <strong>in</strong> a heterogeneous environment that<br />

may <strong>in</strong>clude W<strong>in</strong>dows and Unix variants.<br />

When a new person is added to a company roster without a central directory server, it<br />

could take many <strong>in</strong>dependent actions by tra<strong>in</strong>ed IT professionals to add accounts for the<br />

person on all the operat<strong>in</strong>g systems and applications that the new person needs to be<br />

productive. Consider large populations with tens or hundreds of millions of users. It is<br />

unfeasible to adm<strong>in</strong>ister this population without some automation. Of course, the IT<br />

department can create a custom tool to add or ma<strong>in</strong>ta<strong>in</strong> the accounts, but this would be<br />

yet another tool that an already overwhelmed IT department would need to cont<strong>in</strong>ually<br />

modify and support. Either by hand or by custom tools, expertise is required to<br />

accomplish a fundamentally simple adm<strong>in</strong>istration chore. <strong>LDAP</strong> solves this with one<br />

central mechanism, a set of tools, and an <strong>in</strong>dustry standard protocol for access<strong>in</strong>g the<br />

services provided.<br />

Separation of Roles for Privileged <strong>User</strong>s<br />

More than just mak<strong>in</strong>g adm<strong>in</strong>istration easier, <strong>LDAP</strong> recognizes that separation of roles is<br />

an important aspect of any secure comput<strong>in</strong>g environment. It is often the case that the<br />

skill set and security privileges needed to add a new user to the operat<strong>in</strong>g system differ<br />

from the skill set and privileges needed to add a new database user. It makes good sense<br />

3


to keep an operat<strong>in</strong>g system super-user from hav<strong>in</strong>g the ASE roles needed to access<br />

sensitive database data.<br />

One Password to Remember<br />

A user with one password to remember for operat<strong>in</strong>g system and application access is<br />

less likely to do unsecured th<strong>in</strong>gs like write their password down, choose an easy<br />

password to crack, or bother IT with requests to reset a seldom used and therefore<br />

forgotten password. <strong>User</strong>s will appreciate a centralized password authority to deal with<br />

the complexities of today's comput<strong>in</strong>g environments.<br />

Technical Details<br />

The <strong>LDAP</strong> <strong>User</strong> <strong>Authentication</strong> feature is available with the “Security and Directory<br />

Services” option. This feature requires configuration changes to be performed on the<br />

ASE. There are no changes required <strong>in</strong> the client applications to take advantage of this<br />

feature. Exist<strong>in</strong>g client applications cont<strong>in</strong>ue to send the username/password <strong>in</strong>formation<br />

to ASE. ASE authenticates the username/password with the <strong>LDAP</strong> server <strong>in</strong>stead of<br />

syslog<strong>in</strong>s.<br />

Log<strong>in</strong> Sequence with <strong>LDAP</strong> <strong>User</strong> <strong>Authentication</strong><br />

ASE will authenticate with passwords kept on an <strong>LDAP</strong> <strong>Server</strong> <strong>in</strong>stead of the password<br />

kept <strong>in</strong> the syslog<strong>in</strong>s catalog. This important step will allow the use of enterprise-wide<br />

passwords. The password will cont<strong>in</strong>ue to be supplied by the connect<strong>in</strong>g client, but there<br />

will be a centralized location for the current user password.<br />

4


The follow<strong>in</strong>g table describes changes to the log<strong>in</strong> sequence:<br />

Client ASE <strong>LDAP</strong> <strong>Server</strong><br />

1) OpenClient connects to<br />

ASE listener port<br />

3) OpenClient sends TDS<br />

log<strong>in</strong> record<br />

2) ASE listener accepts<br />

connection<br />

4) ASE reads log<strong>in</strong> record<br />

5) ASE b<strong>in</strong>ds to <strong>LDAP</strong><br />

<strong>Server</strong> with<br />

username/password<br />

7) ASE allows or denies<br />

log<strong>in</strong>, depend<strong>in</strong>g on <strong>LDAP</strong><br />

results.<br />

6) <strong>LDAP</strong> <strong>Server</strong><br />

authenticates<br />

username/password,<br />

return<strong>in</strong>g success/failure<br />

Table 1 – Log<strong>in</strong> Sequence with <strong>LDAP</strong> <strong>User</strong> <strong>Authentication</strong><br />

The ma<strong>in</strong> difference with exist<strong>in</strong>g functionality occurs <strong>in</strong> Steps 5-6, where ASE connects<br />

to the <strong>LDAP</strong> <strong>Server</strong> with the user password <strong>in</strong>stead of do<strong>in</strong>g lookups from the syslog<strong>in</strong>s<br />

table.<br />

<strong>Adaptive</strong> <strong>Server</strong> uses the follow<strong>in</strong>g criteria to authenticate a log<strong>in</strong> with an <strong>LDAP</strong><br />

Directory <strong>Server</strong>:<br />

1. <strong>LDAP</strong> b<strong>in</strong>d operation returns error code <strong>LDAP</strong>_SUCCESS (value 0)<br />

2. <strong>LDAP</strong> search operation returns at least one object<br />

<strong>Adaptive</strong> <strong>Server</strong> reports a generic log<strong>in</strong> failure to the client if any of these authentication<br />

criteria are not met.<br />

Enabl<strong>in</strong>g <strong>LDAP</strong> <strong>User</strong> <strong>Authentication</strong> <strong>in</strong> ASE<br />

<strong>LDAP</strong> <strong>User</strong> <strong>Authentication</strong> can be enabled by:<br />

1. Sett<strong>in</strong>g the configuration parameter “enable ldap user auth”<br />

2. Specify<strong>in</strong>g the <strong>LDAP</strong> url str<strong>in</strong>g which identifies the <strong>LDAP</strong> server to be used<br />

5


Sett<strong>in</strong>g Configuration Parameter<br />

A new ASE configuration parameter “enable ldap user auth” is added for this feature.<br />

Role SSO_AUTH is needed to change the value of this configuration parameter. This<br />

configuration parameter is dynamic; it will take effect upon completion of the<br />

sp_configure command. Valid values for this parameter are:<br />

Value Description<br />

0 This is the default sett<strong>in</strong>g. Indicates <strong>LDAP</strong> <strong>User</strong> <strong>Authentication</strong> is not enabled.<br />

1 ASE searches the <strong>LDAP</strong> server to verify existence of a user account and will<br />

authenticate a user log<strong>in</strong> with the results. In the event that <strong>LDAP</strong> authentication<br />

fails, ASE will fail back to use of syslog<strong>in</strong>s to verify existence of the user<br />

account and to authenticate passwords. This level is used to aid with migration<br />

of users from ASE authentication to <strong>LDAP</strong> authentication.<br />

2 ASE searches the <strong>LDAP</strong> server to verify existence of a user account and will<br />

authenticate a user log<strong>in</strong> with the results. Existence of the user <strong>in</strong> the <strong>LDAP</strong><br />

<strong>Server</strong> is required. This sett<strong>in</strong>g is required to allow the <strong>LDAP</strong> server to prevent<br />

exist<strong>in</strong>g users from authenticat<strong>in</strong>g with ASE when they do not have valid <strong>LDAP</strong><br />

accounts. In security conscious <strong>in</strong>stallations, this should be the level used, s<strong>in</strong>ce<br />

it prevents an ASE adm<strong>in</strong>istrator from creat<strong>in</strong>g a new account with sp_addlog<strong>in</strong>.<br />

Table 2 – Valid values for configuration parameter “enable ldap user auth”<br />

Specify<strong>in</strong>g <strong>LDAP</strong> URL Str<strong>in</strong>g<br />

In order to create and ma<strong>in</strong>ta<strong>in</strong> an <strong>LDAP</strong> URL search str<strong>in</strong>g for ASE user authentication,<br />

a new stored procedure sp_ldapadm<strong>in</strong> is added. The ASE role ‘sso_role’ is required to<br />

execute the sp_ldapadm<strong>in</strong> stored procedure. The syntax for this procedure is:<br />

sp_ldapadm<strong>in</strong> set_primary_url, ldapurl<br />

sp_ldapadm<strong>in</strong> set_secondary_url, ldapurl<br />

where ldapurl is a quoted str<strong>in</strong>g follow<strong>in</strong>g the <strong>LDAP</strong> URL syntax. The set_primary_url<br />

and set_secondary_url sub-commands add the specified <strong>LDAP</strong> URL search str<strong>in</strong>gs as the<br />

primary and secondary <strong>LDAP</strong> servers to authenticate users. These two <strong>LDAP</strong> URL<br />

search str<strong>in</strong>gs can be set to provide fail over abilities to ASE <strong>in</strong> the event that the primary<br />

does not work.<br />

The filter must be specified with the attribute name that uniquely identifies the user to be<br />

authenticated and must be <strong>in</strong> the form attribute=*. The * is the wildcard. For example,<br />

‘uid=*’ is used as a filter <strong>in</strong> the iPlanet example below. ASE replaces the ‘*’ wildcard<br />

with the ASE log<strong>in</strong> name to be authenticated.<br />

1> sp_ldapadm<strong>in</strong> set_primary_url,<br />

‘ldap://myhost:389/ou=People,dc=mycompany,dc=com??s<br />

ub?uid=*’<br />

2> go<br />

The follow<strong>in</strong>g example uses the default user classes def<strong>in</strong>ed <strong>in</strong> Open<strong>LDAP</strong> 2.0.25:<br />

6


1> sp_ldapadm<strong>in</strong> set_primary_url,<br />

'ldap://myhost:389/dc=mycompany,dc=com??sub?cn=*'<br />

2> go<br />

<strong>LDAP</strong> vendors do not use the same objects, schema, and attributes. Sites may extend<br />

them locally or use them <strong>in</strong> ways different from each other; there are many <strong>LDAP</strong> URL<br />

search str<strong>in</strong>gs that are possible and valid.<br />

ASE Log<strong>in</strong> and <strong>LDAP</strong> <strong>User</strong> Account<br />

Once <strong>LDAP</strong> <strong>User</strong> <strong>Authentication</strong> is enabled, a user account is primarily managed <strong>in</strong> the<br />

<strong>LDAP</strong> <strong>Server</strong> where existence, password and password policies are def<strong>in</strong>ed. A DBA,<br />

however, cont<strong>in</strong>ues to adm<strong>in</strong>ister the account’s roles, default database, default language,<br />

and other log<strong>in</strong>-specific attributes us<strong>in</strong>g traditional commands and procedures.<br />

ASE creates a row <strong>in</strong> syslog<strong>in</strong>s for a user account when first log<strong>in</strong> occurs. The follow<strong>in</strong>g<br />

table describes the various actions ASE takes at log<strong>in</strong>:<br />

Row exists <strong>in</strong> ASE<br />

syslog<strong>in</strong>s<br />

<strong>LDAP</strong> server<br />

authentication succeeds<br />

Result<strong>in</strong>g changes <strong>in</strong><br />

syslog<strong>in</strong>s<br />

NO YES Add row<br />

NO NO No change<br />

YES YES Update row if password<br />

has changed<br />

YES NO No change<br />

Table 3 – Update Actions to syslog<strong>in</strong>s<br />

Special log<strong>in</strong>s like “sa” cont<strong>in</strong>ue to be validated aga<strong>in</strong>st the syslog<strong>in</strong>s catalog.<br />

Restrict<strong>in</strong>g Log<strong>in</strong>s to ASE<br />

Enabl<strong>in</strong>g <strong>LDAP</strong> <strong>User</strong> <strong>Authentication</strong> comes with a caveat. Any user who is a valid user<br />

<strong>in</strong> the <strong>LDAP</strong> server can log<strong>in</strong> to any ASE that has the <strong>LDAP</strong> UA functionality enabled.<br />

To restrict log<strong>in</strong>s to desired ASE servers, specify compound filters <strong>in</strong> the <strong>LDAP</strong> URL<br />

str<strong>in</strong>g.<br />

For example, to restrict log<strong>in</strong>s to users that are only <strong>in</strong> group=account<strong>in</strong>g, the <strong>LDAP</strong><br />

URL str<strong>in</strong>g for an iPlanet server would be:<br />

1> sp_ldapadm<strong>in</strong> set_primary_url,<br />

ldap://myhost:389/ou=People,dc=mycompany,<br />

dc=com??sub?(&(uid=*)(group=account<strong>in</strong>g))<br />

2> go<br />

ASE will b<strong>in</strong>d with DN "uid=mylog<strong>in</strong>,ou=People,dc=mycompany,dc=com".<br />

Then, after successfully b<strong>in</strong>d<strong>in</strong>g with this identity, it will search for<br />

7


"ou=People,dc=mycompany,dc=com??sub?(&(uid=mylog<strong>in</strong>)(group=account<strong>in</strong>g))”.<br />

If this search returns more than 0 objects, then authentication succeeds.<br />

Below are a few more examples of <strong>LDAP</strong> URL str<strong>in</strong>gs conta<strong>in</strong><strong>in</strong>g compound filters.<br />

1> sp_ldapadm<strong>in</strong> set_primary_url,<br />

"ldap://myhost:389/ou=people,dc=mycompany,dc=com??s<br />

ub?(&(uid=*)(ou=account<strong>in</strong>g) (l=Santa Clara))"<br />

2> go<br />

1> sp_ldapadm<strong>in</strong>, set_primary_url,<br />

“ldap://myhost:389/ou=people,dc=mycompany,dc=com??s<br />

ub?(&(uid=*)(ou=Human%20Resources))"<br />

2> go<br />

However, even if the user is able to log<strong>in</strong> to the server based on authentication with the<br />

<strong>LDAP</strong> server, the user still needs to be added as a valid user <strong>in</strong>to the correspond<strong>in</strong>g<br />

database and have permissions at the appropriate level to get access to objects with<strong>in</strong> the<br />

database.<br />

Configuration Tips<br />

Configur<strong>in</strong>g <strong>LDAP</strong> <strong>User</strong> <strong>Authentication</strong> <strong>in</strong> New ASE Installations<br />

New server <strong>in</strong>stallations need to:<br />

1. Specify an <strong>LDAP</strong> URL search str<strong>in</strong>g to ASE<br />

2. Set the configuration parameter “enable ldap user auth” to 2<br />

3. Add users <strong>in</strong> the <strong>LDAP</strong> directory server us<strong>in</strong>g <strong>LDAP</strong> vendor supplied tools<br />

Migrat<strong>in</strong>g Exist<strong>in</strong>g ASE Installations to <strong>LDAP</strong> <strong>User</strong> <strong>Authentication</strong><br />

In order to avoid disruption of service <strong>in</strong> exist<strong>in</strong>g server <strong>in</strong>stallations, the follow<strong>in</strong>g<br />

procedure may be followed:<br />

1. Specify an <strong>LDAP</strong> URL search str<strong>in</strong>g to ASE<br />

2. Set the configuration parameter “enable ldap user auth” to 1<br />

3. Add users <strong>in</strong> the <strong>LDAP</strong> directory server<br />

4. When all users are added to the <strong>LDAP</strong> server, set the configuration parameter<br />

“enable ldap user auth” to 2<br />

Failover Support<br />

When a major failure occurs <strong>in</strong> the <strong>LDAP</strong> Directory <strong>Server</strong> specified by the primary URL<br />

and it no longer responds to network requests, ASE attempts to connect to the secondary<br />

<strong>LDAP</strong> Directory <strong>Server</strong> specified by the secondary URL. <strong>Adaptive</strong> <strong>Server</strong> uses the<br />

<strong>LDAP</strong> protocol function ldap_<strong>in</strong>it() to determ<strong>in</strong>e if a connection to the <strong>LDAP</strong> Directory<br />

<strong>Server</strong> can be opened. A NULL URL str<strong>in</strong>g, or otherwise syntactically <strong>in</strong>valid primary<br />

URL str<strong>in</strong>g, will also cause <strong>Adaptive</strong> <strong>Server</strong> to attempt failover to a secondary URL.<br />

8


<strong>Adaptive</strong> <strong>Server</strong> does not failover to the secondary for failures returned by the <strong>LDAP</strong><br />

protocol b<strong>in</strong>d or search operations.<br />

Secondary <strong>LDAP</strong> URL may be specified us<strong>in</strong>g the sp_ldapadm<strong>in</strong> command.<br />

1> sp_ldapadm<strong>in</strong>, set_secondary_url,<br />

ldap://backuphost:389/ou=people,dc=mycompany,dc=com?<br />

?sub?uid=*"<br />

2> go<br />

Conclusion<br />

<strong>LDAP</strong> <strong>User</strong> <strong>Authentication</strong> is ideal <strong>in</strong> an exist<strong>in</strong>g comput<strong>in</strong>g environment that wants to<br />

simplify and centralize user adm<strong>in</strong>istration, or <strong>in</strong> a new comput<strong>in</strong>g environment that just<br />

wants to avoid unnecessary complexities for adm<strong>in</strong>ister<strong>in</strong>g users.<br />

<strong>LDAP</strong> <strong>User</strong> <strong>Authentication</strong> works with Directory <strong>Server</strong>s that meet <strong>LDAP</strong> Version 3 of<br />

the protocol standard, <strong>in</strong>clud<strong>in</strong>g iPlanet and Open<strong>LDAP</strong> Directory <strong>Server</strong>.<br />

9

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!