Use-Case: Certificate Authentication followed by Group Extraction for 401 enabled LoadBalanced/TrafficManagement virtual server.
This document describes following scenario:
It can be added as:
add authentication loginSchema <name> -authenticationSchema <XML-Blob> -userExpression <Expression> -passwordExpression <Expression>where authenticationSchema is a well-structured XML that defines the way login form is rendered. UserExpression is used to extract username from login attempt. Likewise passwordExpression is used to extract password.
When we bind an authentication policy to authentication vserver, we specify nextFactor, which represents a policylabel/factor that would be taken if the policy succeeds. Likewise, when policies are bound to policylabels, nextFactor specifies the next policylabel to continue if the policy succeeds.
It can be added as:
add authentication policylabel <name> -loginSchema <loginSchemaName>Where, loginSchemaName will be the login schema that we want to associate with this authentication factor.
We can bind authentication policies to this label.
Bind authentication policylabel <name> -policy LDAP –priority 10 –nextfactor <nextFactorLabelName>User accesses TM vserver and he is redirected to Authentication vserver.
If User Certificate is present in the client device, it will be presented to the user as below.
After user certificate is submitted, authentication proceeds to next factor. This factor is configured as “passthrough”. Pass-through implies that Netscaler would continue authentication with existing credentials without asking user for new set of credentials. In the current use-case, this “passthrough” factor is configured with ldap group extraction with authentication disabled. User Administrator can check for the groups extracted in ns.log as shown in the ns.log output section.
TM and Auth vserver configuration:
add lb vserver lbssl SSL 10.102.42.32 443 -persistenceType NONE -cltTimeout 180 -AuthenticationHost auth1.aaatm-test.com -authn401 ON -authnVsName auth1
set ssl vserver lbssl -clientAuth ENABLED -clientCert Mandatory
or
set ssl parameter –denysslrenegotiation NO
add authentication vserver auth1 SSL 10.102.42.30 443 -AuthenticationDomain aaatm-test.com
Cert policy in first factor bound to Auth vserver:
add authentication certAction cact -userNameField SubjectAltName:PrincipalName
add authentication Policy certadvpol -rule true -action cact
bind authentication vserver auth1 -policy certadvpol -priority 1 -nextFactor certldaplabel -gotoPriorityExpression NEXT
2nd factor configuration:
The second factor is configured for ldap group extraction for the username field extracted from certificate. In the example configuration, it is extracted from UserprincipalName field of the certificate. This factor will be a passthrough with loginschema as “noschema”.
add authentication ldapAction ldapgrp -serverIP 10.102.221.22 –secType SSL -serverPort 636 -ldapBase "dc=aaatm-test,dc=com" -ldapBindDn administrator@aaatm-test.com -ldapBindDnPassword freebsd -ldapLoginName userprincipalName -groupAttrName memberOf -subAttributeName CN -authentication DISABLED
add authentication Policy <ldapgrpol> -rule true -action ldapgrp
add authentication policylabel certldaplabel -loginSchema noschema
bind authentication policylabel certldaplabel -policyName ldapgrpol -priority 1 -gotoPriorityExpression NEXT
Above configuration describes adding a TM vserver for resource access, adding Authentication vserver for securing TM vserver, and relevant policies for this use-case. Portions in “red” describe the proposed rules to pick a particular authentication policy for next factor selection
Jul 31 04:37:59 <local0.debug> 127.0.0.2 07/31/2015:04:37:59 GMT 0-PPE-0 : default SSLLOG SSL_HANDSHAKE_SUBJECTNAME 785 0 : SPCBId 519 - SubjectName " DC=com,DC=aaatm-test,CN=Users,CN=user1" Jul 31 04:37:59 <local0.debug> 127.0.0.2 07/31/2015:04:37:59 GMT 0-PPE-0 : default AAATM Message 786 0 : "nFactor: CERTAUTH: auth complete; next factor configured is certldaplabel" Jul 31 04:37:59 <local0.debug> 127.0.0.2 07/31/2015:04:37:59 GMT 0-PPE-0 : default AAATM Message 787 0 : "nFactor: certauth complete; next factor configured is certldaplabel is passthrough for user1@aaatm-test.com, ignoring authorization header" Jul 31 04:37:59 <local0.debug> 127.0.0.2 07/31/2015:04:37:59 GMT 0-PPE-0 : default SSLVPN Message 788 0 : "aaad_authenticate_req: copying policylabel name certldaplabel to aaa info, type 65 for auth " Jul 31 04:37:59 <local0.info> 127.0.0.2 07/31/2015:04:37:59 GMT 0-PPE-0 : default AAA EXTRACTED_GROUPS 789 0 : Extracted_groups "grp10" Jul 31 04:37:59 <local0.info> 127.0.0.2 07/31/2015:04:37:59 GMT 0-PPE-0 : default AAATM LOGIN 790 0 : Context user1@aaatm-test.com@10.102.229.222 - SessionId: 4- User user1@aaatm-test.com - Client_ip 10.102.229.222 - Nat_ip "Mapped Ip" - Vserver 10.102.42.32:443 - Browser_type "Mozilla/5.0 (Windows NT 6.0; rv:39.0) Gecko/20100101 Firefox/39.0" - Group(s) "N/A"