Deployment Example: Single Sign-On, Load Balancing and Failover Using Sun OpenSSO Enterprise 8.0

9.1 Configuring the Web Policy Agents Load Balancer

Load Balancer 4 handles traffic for the web policy agents, and is configured for simple persistence.


Note –

From a performance perspective, each policy agent validates user sessions and evaluates applicable policies. The results of those actions are cached by the policy agent that performed them. If simple persistence is not set, each agent builds its own cache, effectively doubling the workload on the OpenSSO Enterprise servers, and cutting overall system capacity. The problem will become more acute as the number of policy agents increases. In situations where each web policy agent instance is protecting identical resources, some form of load balancer persistence is highly recommended for these reasons. Although the actual type of persistence may vary when a different load balancer is used, it should achieve the goal of sending requests from the same user session to the same policy agent.



Note –

When firewalls are configured, Load Balancer 4 can be located in a less secure zone.


Use the following list of procedures as a checklist for configuring the web policy agents' load balancer:

  1. To Configure the Web Policy Agents Load Balancer

  2. To Create a Monitoring File on Each Host Machine for Load Balancer 4

  3. To Add Load Balancer 4 as a Virtual Host by Modifying the Web Policy Agent Properties

  4. To Configure Policy for the Web Policy Agents

  5. To Verify the Web Policy Agents Load Balancer Configuration is Working Properly

ProcedureTo Configure the Web Policy Agents Load Balancer

Before You Begin

The load balancer hardware and software used for this deployment is BIG-IP® manufactured by F5 Networks. If you are using different load balancer software, see the documentation that comes with that product for detailed settings information.

  1. Access https://is-f5.example.com, the Big IP load balancer login page, from a web browser.

  2. Log in using the following credentials:

    User name:

    username

    Password:

    password

  3. Click Configure your BIG-IP (R) using the Configuration Utility.

  4. Create a Pool.

    A pool contains all the backend server instances.

    1. In the left pane, click Pools.

    2. On the Pools tab, click Add.

    3. In the Add Pool dialog, provide the following information:

      Pool Name

      WebAgent-Pool

      Load Balancing Method

      Round Robin

      Resources

      Add the IP address and port number of both Protected Resource host machines: pr-1:1080 and pr-2:1080.

    4. Click Done.

  5. Add a Virtual Server.

    The virtual server presents an address to the outside world and, when users attempt to connect, it would forward the connection to the most appropriate real server.


    Tip –

    If you encounter JavaScriptTM errors or otherwise cannot proceed to create a virtual server, try using Internet Explorer.


    1. In the left frame, click Virtual Servers.

    2. On the Virtual Servers tab, click Add.

    3. In the Add a Virtual Server dialog box, provide the following information:

      Address

      Enter the IP address for lb-4.example.com

      Service

      90

    4. Continue to click Next until you reach the Pool Selection dialog box.

    5. In the Pool Selection dialog box, assign the WebAgent-Pool Pool.

    6. Click Done.

  6. Add Monitors.

    Monitors are required for the load balancer to detect the backend server failures.

    1. In the left frame, click Monitors.

    2. Click Add.

      In the Add Monitor dialog provide the following information:

      Name:

      WebAgent-http

      Inherits From:

      Choose http.

    3. Click Next.

    4. On the resulting Configure Basic Properties page, click Next.

    5. In the Send String field under Configure ECV HTTP Monitor, enter GET /monitor.html and click Next.

    6. On the Destination Address and Service (Alias) page, click Done.

      The monitor just added is in the list of monitors under the Monitors tab.

    7. Click the Basic Associations tab.

    8. Mark the Add checkbox next to the IP addresses for pr-1:1080 and pr-2:1080.

    9. At the top of the Node column, choose the monitor that you just added, WebAgent-http.

    10. Click Apply.

  7. Configure the load balancer for simple persistence.

    All requests sent within a specified interval from the same user are routed to the same agent. This significantly reduces the number of agent requests sent to OpenSSO Enterprise for validation thus reducing the load on the servers.


    Note –

    Simple persistence tracks connections based on the client IP address only, returning a client to the same node to which it connected previously.


    1. In the left frame, click Pools.

    2. Click the WebAgent-Pool link.

    3. Click the Persistence tab.

    4. Under Persistence Type, select the Simple.

    5. Set the timeout interval.

      In the Timeout field, enter 300 seconds.

    6. Click Apply.

  8. Log out of the console.

ProcedureTo Create a Monitoring File on Each Host Machine for Load Balancer 4

In order to configure the web policy agents to point to Load Balancer 4, create a file to be used by Load Balancer 4 for monitoring and modify the web agent properties — adding Load Balancer 4 as the virtual host. Instructions on how to create a monitoring file are in the following procedure. Instructions on how to modify the web agent properties are in To Add Load Balancer 4 as a Virtual Host by Modifying the Web Policy Agent Properties.


Note –

We can alternately use the default Web Server index.html rather than create monitor.html but in this deployment, index.html is used to represent the resource protected by the web policy agent.


  1. As a root user, log in to the pr–1 host machine.

  2. Change to the config directory.


    # cd /opt/SUNWwbsvr/https-pr-1.example.com/docs
    
  3. Create a monitor.html file to be used by the load balancer.


    # cat > monitor.html
    
    <HTML>
    </HTML>
    
    Hit Control D to terminate the command
    
    ^D
    
  4. Run the tail command.


    # cd /opt/SUNWwbsvr/https-pr-1.example.com/logs
    # tail -f access
    

    If you see frequent entries similar to the one below, the custom monitor is configured properly.


    IP_address - - [30/Jul/2008:13:59:48 -0700] "GET /monitor.html" 200 15

    Tip –

    If you do not see "GET /monitor.html", troubleshoot the load balancer configuration.


  5. Log out of the pr–1 host machine.

  6. As a root user, log in to the pr–2 host machine.

  7. Change to the config directory.


    # cd /opt/SUNWwbsvr/https-pr-2.example.com/docs
    
  8. Create a monitor.html file to be used by the load balancer.


    # cat > monitor.html
    
    <HTML>
    </HTML>
    
    Hit Control D to terminate the command
    
    ^D
    
  9. Run the tail command.


    # cd /opt/SUNWwbsvr/https-pr-2.example.com/logs
    # tail -f access
    

    If you see frequent entries similar to the one below, the custom monitor is configured properly.


    IP_address - - [30/Jul/2008:13:59:48 -0700] "GET /monitor.html" 200 15

    Tip –

    If you do not see "GET /monitor.html", troubleshoot the load balancer configuration.


  10. Log out of the pr–2 host machine.

ProcedureTo Add Load Balancer 4 as a Virtual Host by Modifying the Web Policy Agent Properties

In order to configure the web policy agents to point to Load Balancer 4, create a file to be used by Load Balancer 4 for monitoring and modify the web agent properties — adding Load Balancer 4 as the virtual host.

Before You Begin

This procedure assumes you have completed To Create a Monitoring File on Each Host Machine for Load Balancer 4.

  1. Access https://osso-1.example.com:1081/opensso/console from a web browser.

  2. Log in to the OpenSSO Enterprise console as the administrator.

    Username

    amadmin

    Password

    ossoadmin

  3. Under the Access Control tab, click / (Top Level Realm).

  4. Click the Agents tab.

  5. Click the Web tab.

    webagent-1 and webagent-2 is displayed under the Agent table.

  6. Click webagent-1

    The Global tab is displayed.

  7. Enter a value for the FQDN Virtual Host Map and click Add.

    The value is the name of the host machine in which Load Balancer 4 is installed.

    Map Key

    valid

    Corresponding Map Value

    lb-4.example.com

  8. Click Save.

  9. Click the Application tab.

    The Application properties page is displayed.

  10. On the resulting page, provide values for Not Enforced URL Processing.

    Enter each of the following and click Add.


    http://lb-4.example.com:90/monitor.html
    http://pr-1.example.com:1080/monitor.html
  11. Click Save.

  12. Click Back to Main Page.

  13. Click webagent-2

    The Global tab is displayed.

  14. Enter a value for the FQDN Virtual Host Map and click Add.

    The value is the name of the host machine in which Load Balancer 4 is installed.

    Map Key

    valid.

    Corresponding Map Value

    lb-4.example.com

  15. Click Save.

  16. Click the Application tab.

    The Application properties page is displayed.

  17. On the resulting page, provide values for Not Enforced URL Processing.

    Enter each of the following and click Add.


    http://lb-4.example.com:90/monitor.html
    http://pr-2.example.com:1080/monitor.html
  18. Click Save.

  19. Click Back to Main Page.

  20. Log out of the OpenSSO Enterprise console and close the browser.

ProcedureTo Configure Policy for the Web Policy Agents

Use the OpenSSO Enterprise console to configure policy for the web policy agents. The policies you create here are used in To Verify the Web Policy Agents Load Balancer Configuration is Working Properly.

  1. Access https://osso-1.example.com:1081/opensso/console from a web browser.

  2. Log in to the OpenSSO Enterprise console as the administrator.

    Username

    amadmin

    Password

    ossoadmin

  3. Under the Access Control tab, click / (Top Level Realm).

  4. Click the Policies tab.

  5. Click New Policy.

    The New Policy page is displayed.

  6. On the New Policy page, enter URL Policy for LoadBalancer-4 in the Name field.

  7. Click New under Rules.

    The New Rules page is displayed.

  8. On the New Rules page, accept the default URL Policy Agent (with resource name) and click Next.

  9. On the resulting page, provide the following information.

    Name:

    Rule for LoadBalancer-4.

    Resource Name:

    http://lb-4.example.com:90/*

    GET

    Mark this checkbox and verify that Allow is selected.

    POST

    Mark this checkbox and verify that Allow is selected.

  10. Click Finish.

    The New Policy page is displayed again.

  11. On the New Policy page, click New under Subjects.

    The New Subjects page is displayed.

  12. On the New Subjects page, verify that Access Manager Identity Subject is selected and click Next.

  13. On the resulting page, provide the following information.

    Name

    Subject for LoadBalancer-4.

    Filter

    From the drop-down list, select User and click Search. The search returns a list of available users.

    Available

    From the generated User list, select testuser1 and click Add. testuser1 is displayed in the Selected List.

  14. Click Finish.

    The New Policy page is displayed again.

  15. On the New Policy page, click OK.

    The completed policy is now included in the list of Policies.

  16. Log out of the OpenSSO Enterprise console and close the browser.

ProcedureTo Verify the Web Policy Agents Load Balancer Configuration is Working Properly

  1. Access http://lb-4.example.com:90/index.html, the OpenSSO Enterprise load balancer, from a web browser.

  2. Log in to OpenSSO Enterprise as testuser1.

    Username

    testuser1

    Password

    password

    If the default Web Server index.html page is displayed, the load balancer is configured properly.

  3. Close the browser.

  4. Access the OpenSSO Enterprise load balancer at http://lb-4.example.com:90/index.html from a web browser again.


    Tip –

    If not redirected to the OpenSSO Enterprise login page for authentication, clear your browser's cache and cookies and try again.


  5. Log in to OpenSSO Enterprise as testuser2.

    Username

    testuser2

    Password

    password

    You should see the message You're not authorized to view this page or Your client is not allowed to access the requested object as testuser2 was not included in the test policy.