Access 301: Ephemeral Authentication > Class - Access 301: Ephemeral Authentication > Module 2 - Implement Priviledged User Access Authentication Source |
Lab 2.5 - Creating an APM Policy - LDAP¶
PUA requires a Directory Service to authenticate users. In this section you will build an LDAP macro to perform the authentication function.
Task - Build an LDAP macro¶
Note
This lab makes use of APM macros to make policies easy to view and manage.
The LDAP macro will verify that the requesting user has a valid account and the appropriate group permission.
Click the Add New Macro button

Give the macro a name and click Save

Open the newly created macro by clicking the plus sign by the name: Macro: LDAP_Query

Modify the macro by clicking the plus sign

Select the Authentication tab, select the LDAP Query agent, and then click Add Item

Update the Properties tab by modifying the Server, SearchDN, SearchFilter, and Fetch Groups settings
- Server = /Common/prebuilt-f5lab.local
- SearchDN = DC=f5lab,DC=local
- SearchFilter = UserPrincipalName=%{session.custom.ephemeral.upn}
- Fetch groups to which the user or group belong = Direct

Click on the Branch Rules tab. Next, delete the branch rule by clicking X button beside User Group Membership

Click Add Branch Rule

Enter LDAP Passed in the Name field and click the Change link

Click the Add Expression button

Change the Context setting to LDAP Query and the Condition setting to LDAP Query Passed. Ensure that LDAP Query has is set to Passed. Then click Add Expression

Click Finish, and then click Save

Now add a Message Box agent to alert when the LDAP query fails. Click on the plus sign on the fallback branch (between the LDAP Query and the Out terminal)

Select the General Purpose tab, then select Message Box in the main section, and click the Add Item button

Enter the following values for the message box agent, then click Save
Name: LDAP Failure Message: LDAP Failure for user %{UserPrincipalName}

Click the Edit Terminals button to change the terminals to report Success and Failure

Change the Name from Out to Success, and then click the Add Terminal button

Change the name from Terminal 1 to Failure, and then click on Save

Click the Success terminal beside the LDAP Failure action branch

Change the setting from Success to Failure, and click Save

Note
Here is the completed macro.
