Manual Chapter : Local User Database

Applies To:

Show Versions Show Versions

BIG-IP APM

  • 11.5.10, 11.5.9, 11.5.8, 11.5.7, 11.5.6, 11.5.5, 11.5.4, 11.5.3, 11.5.2
Manual Chapter

Overview: Configuring and administering a local user database

You can create multiple local user databases to provide on-box authentication, to control user access, to segment your users, and to store user information.

During access policy operation, you can read from and write to a local user database.

  • You can read from a local user database to:

    • Determine whether a user is locked out of a local user database instance.
    • Check the number of failed login attempts for a user.
    • Check group membership for the user to determine which access policy branch to take.
      Note: Groups are text strings. You create them from the Configuration utility.
  • You can write to a local user database primarily to increment or reset the number of login failures for a user. You can also update the locked out status for the user; although this option provides flexibility, use it sparingly. Normally, locked out status is set programmatically.

About backing up and restoring users

You can export user data from a local user database instance to a comma-separated values (CSV) file. The purpose is to provide you with a way to back up user data, which you can import from the CSV file.

Note: Dynamically created users are not included in the CSV file that you export to back up user data. (You can configure the Local Database action to dynamically create users from an access policy.)

About local user database synchronization across devices

When BIG-IP systems are included in a Sync-only device group, configuration data is synchronized automatically or manually using ConfigSync. ConfigSync has no effect on local user databases, however. In a Sync-only device group, the active node provides the local user database data to the other nodes initially, and then provides updated data every five minutes.

Synchronization status

The date and time of the last high availability (HA) synchronization displays in the Configuration utility on the Local User List and Local Database Instance screens. If errors occur, they are logged and then available in Access Policy Manager reports.

About writing to a local user database from an access policy

Administrators using the Configuration utility to update user data need to know that user data can also be updated by access policies. When you include a Local Database action in an access policy and configure a write action in it, it can make these changes in a local user database instance.

Updates to local user databases in the Common partition

You can use the Local Database action to write to local user databases in the Common partition, in addition to the partition in which you create the access policy.

Note: Usually, you have read-only access to the Common partition from any other partition. The Local Database write action is an exception to this general rule.

Changes to individual user data

The Local Database action can change these types of information for a user:

  • Number of login failures
  • Locked out status - If you change the locked out status for a user, you could change the result of other access policy actions, such as a local database read action, or a local database authentication action.
Note: When you create a Local Database write action, although groups is on the list of destination DB properties, you cannot write to it. The groups that are entered using the Configuration utility are preserved.

Addition and deletion of dynamic users

The Allow User Creation option of the Local Database action creates a user when one does not already exist in a local user database. You can use this option to track login attempts by users who are not found in the local user database and to lock them out for a period of time. Dynamically created users are removed from the database after 20 minutes.

Task summary

Configuring a local user database instance

Configure a local user database instance so you can add users and user data to it.
  1. On the Main tab, select Access Policy > Local User DB > Manage Instances. The Manage Instances screen displays.
  2. Click Create New Instance. The Create New Local User DB Instance popup screen displays.
  3. In the Name field, type a unique name for the database instance.
  4. In the Lockout Interval (in seconds) field, type the number of seconds to keep a user account locked. The default setting is 600 seconds.
  5. In the Lockout Threshold field, type the maximum number of login failures to allow. The default setting is 3.
  6. Click OK.
You have created a local user database instance.

Adding a user to a local user database instance

Before you start this procedure, a local user database instance must already exist.
Add a user to a local user database instance for authentication or for determining a branching strategy in an access policy that is based on user group membership.
Note: The data in a local user database is not validated against external sources.
  1. On the Main tab, select Access Policy > Local User DB > Manage Users. The Manage Users screen displays.
  2. Click Create New User. The Create New Local User screen opens and displays User Information settings.
  3. In the User Name field, type the user name.
  4. In the Password and Confirm Password fields, type the user's password.
  5. Select the Force Password Change check box to force the user to change password the next time they log in. After the user successfully changes password, this check box is cleared. You can select this check box at any time to force the user to change password at their next log in.
  6. From the Instance list, select a local user database instance. You have completed the mandatory settings.
  7. Optional: Select Personal Information to specify First Name, Last Name, and Email. This information is not accessible to an access policy.
  8. Optional: Select User Groups to specify Group Memberships for the user. A group membership is a text string. A Local Database action can read groups from the database to determine branching strategy in an access policy.
  9. Click OK.
You have created a local user in a local user database instance.
To add this user to another local user database instance, repeat this procedure and select the other instance.

Forcing change of password for a local user database instance

You can force a user to change password for the local user database instance when you need to do so.
  1. On the Main tab, select Access Policy > Local User DB > Manage Users. The Manage Users screen displays.
  2. Select a user and click Edit. The Edit Local User screen opens and displays User Information settings.
  3. Select the Force Password Change check box. You can select this check box at any time to force the user to change a password at their next log in.
  4. Click OK. The screen closes.
The user is prompted to change a password the next time they log in. After the user successfully changes a password, the Force Password Change check box is cleared.

Overview: Using a local user database to control authentication

You can authenticate users directly against a local user database using the Local DB Auth action from an access policy.

Also, you can use the local user database to track login failures and lock a user out for a period of time. (This is possible whether authentication occurs against an external AAA server, or a local user database.) Furthermore, you can use the local database to count login failures by users that are not found in a user database, and locking them out for a period of time. You can accomplish these tasks by using Local Database actions to read and write information from an access policy.

About locking a user out of an AAA server using a local user database

A macro, AD auth and LocalDB lockout, is available in the visual policy editor that provides a good example of using the Local Database action to lock users out of an external AAA server.

macro in access policyAD auth and LocalDB lockout macro
  1. A local database action (LocalDB - Read) reads the locked_out database property and determines whether the user is locked out.
  2. Exiting the LocalDB - Read action on the User Locked Out branch leads to a logging action and a Failure terminal.
  3. If the login (AD Auth) fails, a local database write action (LocalDB - Write (Incr)) increments the number of login failures by 1.
    Note: To keep actual logon attempts aligned with the number recorded by the LocalDB - Write (Incr) action (incrementing by 1), the Max Logon Attempts Allowed property in the AD Auth action is set to 1. If it was set to another number, for example 2, you would need to configure the LocalDB - Write (Incr) action to increment login failures by the same number, 2.
  4. A Loop terminal in the macro causes the macro to loop through the AD Auth and LocalDB - Write (Incr) actions until authentication succeeds or until the maximum number of logon attempts is surpassed and the macro exits through the Loop terminal.
  5. If the login, AD Auth, succeeds, a Local Database write action, LocalDB - Write (Reset), resets the user's login failures to 0 (zero).
Example policyAD auth and LocalDB lockout macrocall in an access policy

In an access policy, three branches follow the macro:

  • Successful: The user logged in successfully.
  • Loop: The user failed to log in the maximum number of times and is locked out now.
  • Failure: The user is locked out and does not get another chance to try to log in.

About writing to a local user database from an access policy

Administrators using the Configuration utility to update user data need to know that user data can also be updated by access policies. When you include a Local Database action in an access policy and configure a write action in it, it can make these changes in a local user database instance.

Updates to local user databases in the Common partition

You can use the Local Database action to write to local user databases in the Common partition, in addition to the partition in which you create the access policy.

Note: Usually, you have read-only access to the Common partition from any other partition. The Local Database write action is an exception to this general rule.

Changes to individual user data

The Local Database action can change these types of information for a user:

  • Number of login failures
  • Locked out status - If you change the locked out status for a user, you could change the result of other access policy actions, such as a local database read action, or a local database authentication action.
Note: When you create a Local Database write action, although groups is on the list of destination DB properties, you cannot write to it. The groups that are entered using the Configuration utility are preserved.

Addition and deletion of dynamic users

The Allow User Creation option of the Local Database action creates a user when one does not already exist in a local user database. You can use this option to track login attempts by users who are not found in the local user database and to lock them out for a period of time. Dynamically created users are removed from the database after 20 minutes.

Task summary

Authenticating users and locking them out with a local database

Before you start this task: create a local user database instance in Access Policy Manager, add users to the local database instance, and then create an access profile.
Authenticate a user against a local user database when an external AAA server is not available. Read and write to a local user database when you want to track failed login attempts and lock out users that repeatedly attempt and fail to log in.
Note: For enhanced security, F5 recommends that you place Local Database actions before and after a LocalDB Auth action to read and write user information. This enables you to track and block login attempts by any user. This process is demonstrated in the example access policy described here. (You can use this same process to lock users out of an AAA server by substituting another authentication action for the LocalDB Auth action.)
  1. On the Main tab, click Access Policy > Access Profiles. The Access Profiles List screen opens.
  2. In the Access Policy column, click the Edit link for the access profile you want to configure. The visual policy editor opens the access policy in a separate screen.
  3. On an access policy branch, click the (+) icon to add an item to the access policy. Repeat this action from the visual policy editor whenever you want to add an item to the access policy. A popup screen displays actions on tabs, such as General Purpose and Authentication, and provides a search field.
  4. On the selection screen, type logon in the search field, select Logon Page from the results, and select Add Item. A logon page should precede other actions in the access policy.
    Note: A locked out user is not presented with a logon page, regardless of how many authentication attempts are allowed.
  5. Make any changes that you require to the logon page properties and click Save. The properties screen closes and the visual policy editor displays.
  6. On the fallback branch after the previous action, click the (+) icon to add an item to the access policy. A popup screen opens.
  7. Add a Local Database action and configure it to read the user's locked out status, and create a branch for a locked out user.
    1. Type local in the search field. Search is not case-sensitive. A list of matching actions displays.
    2. Select Local Database and click Add Item. A properties screen opens.
    3. From the LocalDB Instance list, select a local user database.
    4. In the User Name field, retain the default session variable or type another variable name or a user name.
    5. Click Add new entry A new line is added to the list of entries with the Action set to Read, and with a Session Variable field and default value in the Destination column.
    6. In the Destination column Session Variable field, type session.localdb.locked_out (or type the name of another variable).
    7. In the Source column from the DB Property list, select locked_out. The entry is complete. A read action reads a value from the database into a session variable.
    8. Click the Branch Rules tab.
    9. Click the Add Branch Rule button. New Name and Expression settings are displayed.
    10. In the Name field, replace the default name by typing a new name. The default name is Branch Rule n where n is a number. The name appears on the branch in the access policy, so it should be descriptive.
    11. Click the change link next to the Expression setting. A popup screen opens.
    12. Click the Add Expression button. Settings are displayed.
    13. From the Agent Sel. list select LocalDB. The Condition list displays LocalDB Auth Passed. The LocalDB Auth Passed list displays Passed.
    14. From the LocalDB Auth Passed list, select Locked User Out. The branch rule is complete.
    15. Click Finished. The popup screen closes.
    16. Click Save. The properties screen closes and the visual policy editor is displayed.
  8. On the fallback branch after the previous action , add a LocalDB Auth action and configure properties for it. Valid values for the properties, LocalDB Instance and Max Logon Attempts Allowed, are available from lists.
    Note: A user that accumulates the maximum number of logon failures specified in the LocalDB Auth action is locked out of the local user database instance and exits the action on a Locked User Out branch. A user that is not found in the local user database exits the action to the fallback branch.
  9. On the fallback branch after the previous action, click the (+) icon to add an item to the access policy. A popup screen opens.
  10. Add a Local Database action to to increment and write login failures. Configure it to allow user creation.
    1. Set the LocalDB Instance and User Name fields to the same values you selected previously.
    2. From the Allow User Creation list, select Yes. At each subsequent login attempt, login failures increase until the user is eventually locked out.
    3. Add a new entry and configure it to read the login_failures DB property into a session variable.
    4. Add a new entry and configure it to write the value of an expression that increments the number of failures into the login_failures DB property.

      Here is an example of the expression:

      expr { [mcget {session.localdb.login_failures}] + 1 }.
  11. On the successful branch after the Local DB Auth action, add a Local Database action and configure it to reset login failures to 0 (zero).
    1. Set the LocalDB Instance and User Name fields to the same values you selected previously.
    2. Add a new entry and configure it to write the value of an expression that evaluates to zero into the login_failures DB property.

      Here is an example of the expression:

      expr { "0" }.
  12. Click Save. The properties screen closes and the visual policy editor displays.
  13. Click the Apply Access Policy link to apply and activate the changes to the access policy.
Sample access policy (with logging action on the User Locked Out branch)
You must add the access profile to a virtual server in order for this access policy to take effect.

Unlocking a user who is locked out of a local user database instance

You can unlock a user who is locked out of a local user database instance if you do not want to wait the for lockout interval to elapse.
Note: The lockout interval is configurable and can be different for each local user database instance.
  1. On the Main tab, select Access Policy > Local User DB > Manage Users. The Manage Users screen displays.
  2. Select a user for whom the Locked Out column specifies yes.
  3. Click Unlock User.
The account is unlocked in the local user database instance.

Overview: Branching in an access policy based on local user database groups

You can store user group membership strings in a local user database instance. You can add one or more strings for a user to the database. The strings can reflect any grouping strategy that you want to apply. You can make user group-based branching decisions in an access policy by reading the group information for the user from the database, and creating rules for branching based on it.

Before you can perform this task, you need users and user group membership strings configured in a local user database instance. You also need an access profile.

Creating an access policy to branch based on local DB group membership

You can use an access policy to retrieve user group membership from a local user database instance and configure branch rules to provide different actions for users in different groups.
  1. On the Main tab, click Access Policy > Access Profiles. The Access Profiles List screen opens.
  2. In the Access Policy column, click the Edit link for the access profile you want to configure. The visual policy editor opens the access policy in a separate screen.
  3. On an access policy branch, click the (+) icon to add an item to the access policy. Repeat this action from the visual policy editor whenever you want to add an item to the access policy. A popup screen displays actions on tabs, such as General Purpose and Authentication, and provides a search field.
  4. Type local in the search field. Search is not case-sensitive. A list of matching actions is displayed.
  5. Select Local Database and click Add Item. A properties screen displays.
  6. From the LocalDB Instance list, select a local user database.
  7. In the User Name field, retain the default session variable or type another variable name or a user name.
  8. From the Allow User Creation list, retain the default value (No).
  9. Click Add new entry. A new line is added to the list of entries.
  10. Configure the entry to read the groups from the database and store them in a variable:
    1. From the Action list, select Read.
    2. In the Source column from the DB Property list, select groups.
    3. In the Destination column Session Variable field, retain the default value, session.localdb.groups or type the name of a variable.
    4. In the Source column from the DB Property list, select groups. You have configured an action that reads the user's groups into a variable.
  11. Click the Branch Rules tab to edit a branch rule.
  12. Click the Add Branch Rule button. New Name and Expression settings display.
  13. In the Name field, replace the default name by typing a new name over it. The default name is Branch Rule n where n is a number. The name appears on the branch in the access policy and so should be descriptive.
  14. Click the change link in the Expression section. A popup screen opens.
  15. Click the Advanced tab. Use this tab to enter Tcl expressions. A text input field displays.
  16. Type an expression into the text input field. If you expect groups to include only one entry, you can type an expression similar to this one.

    expr { [mcget {session.localdb.groups}] eq "eng" }

    If you expect groups to include multiple entries, you can type an expression similar to this one

    expr { [mcget {session.localdb.groups}] contains "sales" }

  17. Click Finished. The popup screen closes.
  18. Add more branch rules to provide branches for different user groups.
  19. Click Save. The properties screen closes and the visual policy editor displays.
  20. Optional: Add any other branches and actions that you need to complete the access policy.
When the access policy runs and takes the branch with the Local Database read action, additional branching is done based on group membership.
Local Database action with branches based on groupsSample access policy that uses local user DB groups in a branching strategy