security_sasl_cram-md5.xml revision e75c2484bff064fbbf51e92aed4f37b08e6427b7
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE stax SYSTEM "/shared/stax.dtd">
<!--
! CDDL HEADER START
!
! The contents of this file are subject to the terms of the
! Common Development and Distribution License, Version 1.0 only
! (the "License"). You may not use this file except in compliance
! with the License.
!
! You can obtain a copy of the license at
! trunk/opends/resource/legal-notices/OpenDS.LICENSE
! or https://OpenDS.dev.java.net/OpenDS.LICENSE.
! See the License for the specific language governing permissions
! and limitations under the License.
!
! When distributing Covered Code, include this CDDL HEADER in each
! file and include the License file at
! trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
! add the following below this CDDL HEADER, with the fields enclosed
! by brackets "[]" replaced with your own identifying information:
! Portions Copyright [yyyy] [name of copyright owner]
!
! CDDL HEADER END
!
! Copyright 2008 Sun Microsystems, Inc.
! Portions Copyright 2013 ForgeRock AS
! -->
<stax>
<defaultcall function="sasl_cram-md5"/>
<function name="sasl_cram-md5">
<!---
Place suite-specific test information here.
#@TestSuiteName SASL CRAM-MD5 Tests
#@TestSuitePurpose Test the SASL CRAM-MD5 functionality.
#@TestSuiteGroup SASL CRAM-MD5 Tests
#@TestScript security_sasl_cram-md5.xml
-->
<sequence>
<!--- Test case: CRAM-MD5 SASL Mechanism -->
<!---
Place test-specific test information here.
The tag, TestMarker, must be the same as the tag, TestSuiteName.
#@TestMarker SASL CRAM-MD5 Tests
#@TestName SASL CRAM-MD5 Preamble
#@TestIssue none
#@TestPurpose Prepare for SASL CRAM-MD5 tests.
#@TestPreamble none
#@TestStep Admin change password storage scheme to CLEAR.
#@TestStep User change his password.
#@TestPostamble none
#@TestResult Success if OpenDS returns 0
for all ldap operations.
-->
<testcase name="getTestCaseName('CRAM-MD5 - Preamble')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'Security: SASL CRAM-MD5: Preamble Step 1 - Admin Changing Pwd Storage to CLEAR'
</message>
<call function="'modifyPwdPolicy'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'propertyName' : 'Default Password Policy' ,
'attributeName' : 'default-password-storage-scheme' ,
'attributeValue' : 'Clear' }
</call>
<message>
'Security: SASL CRAM-MD5: Preamble Step 2 - Admin Changing User Password'
</message>
<call function="'modifyAnAttribute'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'DNToModify' : 'uid=jrunner, ou=People, o=SASL Tests, dc=example,dc=com' ,
'attributeName' : 'userpassword' ,
'newAttributeValue' : 'frogleg' ,
'changetype' : 'replace' }
</call>
<call function="'modifyAnAttribute'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'DNToModify' : 'uid=jcrawler, ou=People, o=SASL Tests, dc=example,dc=com' ,
'attributeName' : 'userpassword' ,
'newAttributeValue' : 'frogleg' ,
'changetype' : 'replace' }
</call>
<call function="'modifyAnAttribute'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'DNToModify' : 'uid=jcrawler, ou=People, ou=Level One, o=SASL Tests, dc=example,dc=com' ,
'attributeName' : 'userpassword' ,
'newAttributeValue' : 'frogleg' ,
'changetype' : 'replace' }
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
<!--- Test Case : User Bind With CRAM-MD5 SASL Mechanism-->
<!---
Place test-specific test information here.
The tag, TestMarker, must be the same as the tag, TestSuiteName.
#@TestMarker SASL CRAM-MD5 Tests
#@TestName uid (u:) Bind
#@TestIssue none
#@TestPurpose Test bind using an authorization ID that could be mapped to a single DN.
#@TestPreamble none
#@TestStep User bind with authid=u:[name] format.
#@TestPostamble none
#@TestResult Success if OpenDS returns 0.
-->
<testcase name="getTestCaseName('CRAM-MD5 - User (u:) Binding With CRAM-MD5 SASL Mech')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'Security: SASL CRAM-MD5: User (u:) Binding With CRAM-MD5 SASL Mechanism'
</message>
<call function="'AnonSearchObject'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsBaseDN' : 'dc=example,dc=com' ,
'dsFilter' : 'objectclass=*' ,
'extraParams' : '-o mech=CRAM-MD5 -o authid=u:jrunner -w frogleg' }
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
<!--- Test Case : User Bind With CRAM-MD5 SASL Mechanism-->
<!---
Place test-specific test information here.
The tag, TestMarker, must be the same as the tag, TestSuiteName.
#@TestMarker SASL CRAM-MD5 Tests
#@TestName uid (dn:) Bind
#@TestIssue none
#@TestPurpose Test bind using a DN that has an authorization ID that could be mapped to a single DN.
#@TestPreamble none
#@TestStep User bind with authid=dn:[name] format.
#@TestPostamble none
#@TestResult Success if OpenDS returns 0.
-->
<testcase name="getTestCaseName('CRAM-MD5 - User (dn:) Binding With CRAM-MD5 SASL Mech')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'Security: SASL CRAM-MD5: User (dn:) Binding With CRAM-MD5 SASL Mechanism'
</message>
<call function="'AnonSearchObject'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsBaseDN' : 'dc=example,dc=com' ,
'dsFilter' : 'objectclass=*' ,
'extraParams' : '-o mech=CRAM-MD5 -o "authid=dn:uid=jrunner,ou=People,o=SASL Tests,dc=example,dc=com" -w frogleg' }
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
<!--- Test Case : User Bind With CRAM-MD5 SASL Mechanism-->
<!---
Place test-specific test information here.
The tag, TestMarker, must be the same as the tag, TestSuiteName.
#@TestMarker SASL CRAM-MD5 Tests
#@TestName Dupe uid (u:) Bind
#@TestIssue none
#@TestPurpose Test bind using an authorization ID that could be mapped to multiple DNs.
#@TestPreamble none
#@TestStep User bind with authid=u:[name] format.
#@TestPostamble none
#@TestResult Success if OpenDS returns 49.
-->
<testcase name="getTestCaseName('CRAM-MD5 - User With Duplicate uid (u:) Binding')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'Security: SASL CRAM-MD5: User With Duplicate uid (u:) Binding With CRAM-MD5 SASL Mechanism'
</message>
<call function="'AnonSearchObject'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsBaseDN' : 'dc=example,dc=com' ,
'dsFilter' : 'objectclass=*' ,
'extraParams' : '-o mech=CRAM-MD5 -o authid=u:jcrawler -w frogleg' ,
'expectedRC' : 49 }
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
<!--- Test Case : User Bind With CRAM-MD5 SASL Mechanism-->
<!---
Place test-specific test information here.
The tag, TestMarker, must be the same as the tag, TestSuiteName.
#@TestMarker SASL CRAM-MD5 Tests
#@TestName Dupe uid (dn:) Bind
#@TestIssue none
#@TestPurpose Test bind using a user DN whose authorization ID could be mapped to muliple DNs.
#@TestPreamble none
#@TestStep User bind with authid=dn:[DN] format.
#@TestPostamble none
#@TestResult Success if OpenDS returns 0.
-->
<testcase name="getTestCaseName('CRAM-MD5 - User With Duplicate uid (dn:) Binding')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'Security: SASL CRAM-MD5: User With Duplicate uid (dn:) Binding With CRAM-MD5 SASL Mechanism'
</message>
<call function="'AnonSearchObject'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsBaseDN' : 'dc=example,dc=com' ,
'dsFilter' : 'objectclass=*' ,
'extraParams' : '-o mech=CRAM-MD5 -o "authid=dn:uid=jcrawler,ou=People,o=SASL Tests,dc=example,dc=com" -w frogleg' }
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
<!--- Test Case : User Bind With CRAM-MD5 SASL Mechanism-->
<!---
Place test-specific test information here.
The tag, TestMarker, must be the same as the tag, TestSuiteName.
#@TestMarker SASL CRAM-MD5 Tests
#@TestName Dupe uid (u:) Bind 2
#@TestIssue none
#@TestPurpose Test bind using an authorization ID that could be mapped to multiple DNs. Mutiple DNs are deleted.
#@TestPreamble none
#@TestStep Admin deletes the entry whose authorization ID matches another DN.
#@TestStep User bind with authid=u:[name] format.
#@TestPostamble none
#@TestResult Success if OpenDS returns 0
for all ldap operations.
-->
<testcase name="getTestCaseName('CRAM-MD5 - User With Duplicate uid (u:) Binding 2')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'Security: SASL CRAM-MD5: User With Duplicate uid (u:) Binding With CRAM-MD5 SASL Mechanism After Deleting Dupe Entry'
</message>
<call function="'DeleteEntry'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'dsBaseDN' : 'uid=jcrawler,ou=People,ou=Level One,o=SASL Tests,dc=example,dc=com' }
</call>
<message>
'Security: SASL CRAM-MD5: User With Duplicate uid (u:) Binding With CRAM-MD5 SASL Mechanism'
</message>
<call function="'AnonSearchObject'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsBaseDN' : 'dc=example,dc=com' ,
'dsFilter' : 'objectclass=*' ,
'extraParams' : '-o mech=CRAM-MD5 -o authid=u:jcrawler -w frogleg' }
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
<!--- Test case: CRAM-MD5 SASL Mechanism -->
<!---
Place test-specific test information here.
The tag, TestMarker, must be the same as the tag, TestSuiteName.
#@TestMarker SASL CRAM-MD5 Tests
#@TestName SASL CRAM-MD5 Postamble
#@TestIssue none
#@TestPurpose Reset configuration.
#@TestPreamble none
#@TestStep Admin change pasword storage scheme to SSHA.
#@TestStep User change his password.
#@TestStep User bind with SASL CRAM-MD5.
#@TestPostamble none
#@TestResult Success if OpenDS returns 0
for all ldap operations except step 3.
In step 3, the ldap operation should return 49
because the password is no longer stored as CLEAR.
-->
<testcase name="getTestCaseName('CRAM-MD5 - Postamble')">
<sequence>
<call function="'testCase_Preamble'"/>
<message>
'Security: SASL CRAM-MD5: Postamble Step 1 - Admin Changing Pwd Storage to SSHA'
</message>
<call function="'modifyPwdPolicy'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'propertyName' : 'Default Password Policy' ,
'attributeName' : 'default-password-storage-scheme' ,
'attributeValue' : 'Salted SHA-1' }
</call>
<message>
'Security: SASL CRAM-MD5: Postamble Step 2 - Admin Changing User Password'
</message>
<call function="'modifyAnAttribute'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsInstanceDn' : DIRECTORY_INSTANCE_DN ,
'dsInstancePswd' : DIRECTORY_INSTANCE_PSWD ,
'DNToModify' : 'uid=jrunner, ou=People, o=SASL Tests, dc=example,dc=com' ,
'attributeName' : 'userpassword' ,
'newAttributeValue' : 'catleg' ,
'changetype' : 'replace' }
</call>
<message>
'Security: SASL CRAM-MD5: Postamble Step 3 - User (dn:) Binding With CRAM-MD5 SASL Mechanism'
</message>
<call function="'AnonSearchObject'">
{ 'dsInstanceHost' : DIRECTORY_INSTANCE_HOST ,
'dsInstancePort' : DIRECTORY_INSTANCE_PORT ,
'dsBaseDN' : 'dc=example,dc=com' ,
'dsFilter' : 'objectclass=*' ,
'extraParams' : '-o mech=CRAM-MD5 -o "authid=dn:uid=jrunner,ou=People,o=SASL Tests,dc=example,dc=com" -w catleg' ,
'expectedRC' : 49 }
</call>
<call function="'testCase_Postamble'"/>
</sequence>
</testcase>
</sequence>
</function>
</stax>