Two load balancers are configured for the policy agents in this deployment example. Load Balancer 4 balances traffic passing through the web policy agents. Load Balancer 5 balances traffic passing through the J2EE policy agents. Both load balancers are configured for simple persistence. Simple persistence guarantees that requests from the same user session will always be sent to the same policy agent that initially validated the user session and evaluated the applicable policies. This chapter contains the following sections.
Load Balancer 4 handles traffic for the web policy agents, and is configured for simple persistence.
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.
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:
To Create a Monitoring File on Each Host Machine for Load Balancer 4
To Add Load Balancer 4 as a Virtual Host by Modifying the Web Policy Agent Properties
To Verify the Web Policy Agents Load Balancer Configuration is Working Properly
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.
Access https://is-f5.example.com, the Big IP load balancer login page, from a web browser.
Log in using the following credentials:
username
password
Click Configure your BIG-IP (R) using the Configuration Utility.
Create a Pool.
A pool contains all the backend server instances.
In the left pane, click Pools.
On the Pools tab, click Add.
In the Add Pool dialog, provide the following information:
WebAgent-Pool
Round Robin
Add the IP address and port number of both Protected Resource host machines: pr-1:1080 and pr-2:1080.
Click Done.
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.
If you encounter JavaScriptTM errors or otherwise cannot proceed to create a virtual server, try using Internet Explorer.
In the left frame, click Virtual Servers.
On the Virtual Servers tab, click Add.
In the Add a Virtual Server dialog box, provide the following information:
Enter the IP address for lb-4.example.com
90
Continue to click Next until you reach the Pool Selection dialog box.
In the Pool Selection dialog box, assign the WebAgent-Pool Pool.
Click Done.
Add Monitors.
Monitors are required for the load balancer to detect the backend server failures.
In the left frame, click Monitors.
Click Add.
In the Add Monitor dialog provide the following information:
WebAgent-http
Choose http.
Click Next.
On the resulting Configure Basic Properties page, click Next.
In the Send String field under Configure ECV HTTP Monitor, enter GET /monitor.html and click Next.
On the Destination Address and Service (Alias) page, click Done.
The monitor just added is in the list of monitors under the Monitors tab.
Click the Basic Associations tab.
Mark the Add checkbox next to the IP addresses for pr-1:1080 and pr-2:1080.
At the top of the Node column, choose the monitor that you just added, WebAgent-http.
Click Apply.
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.
Simple persistence tracks connections based on the client IP address only, returning a client to the same node to which it connected previously.
Log out of the console.
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.
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.
As a root user, log in to the pr–1 host machine.
Change to the config directory.
# cd /opt/SUNWwbsvr/https-pr-1.example.com/docs |
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 |
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 |
If you do not see "GET /monitor.html", troubleshoot the load balancer configuration.
Log out of the pr–1 host machine.
As a root user, log in to the pr–2 host machine.
Change to the config directory.
# cd /opt/SUNWwbsvr/https-pr-2.example.com/docs |
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 |
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 |
If you do not see "GET /monitor.html", troubleshoot the load balancer configuration.
Log out of the pr–2 host machine.
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.
This procedure assumes you have completed To Create a Monitoring File on Each Host Machine for Load Balancer 4.
Access https://osso-1.example.com:1081/opensso/console from a web browser.
Log in to the OpenSSO Enterprise console as the administrator.
amadmin
ossoadmin
Under the Access Control tab, click / (Top Level Realm).
Click the Agents tab.
Click the Web tab.
webagent-1 and webagent-2 is displayed under the Agent table.
Click webagent-1
The Global tab is displayed.
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.
valid
lb-4.example.com
Click Save.
Click the Application tab.
The Application properties page is displayed.
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 |
Click Save.
Click Back to Main Page.
Click webagent-2
The Global tab is displayed.
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.
valid.
lb-4.example.com
Click Save.
Click the Application tab.
The Application properties page is displayed.
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 |
Click Save.
Click Back to Main Page.
Log out of the OpenSSO Enterprise console and close the browser.
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.
Access https://osso-1.example.com:1081/opensso/console from a web browser.
Log in to the OpenSSO Enterprise console as the administrator.
amadmin
ossoadmin
Under the Access Control tab, click / (Top Level Realm).
Click the Policies tab.
Click New Policy.
The New Policy page is displayed.
On the New Policy page, enter URL Policy for LoadBalancer-4 in the Name field.
Click New under Rules.
The New Rules page is displayed.
On the New Rules page, accept the default URL Policy Agent (with resource name) and click Next.
On the resulting page, provide the following information.
Rule for LoadBalancer-4.
http://lb-4.example.com:90/*
Mark this checkbox and verify that Allow is selected.
Mark this checkbox and verify that Allow is selected.
Click Finish.
The New Policy page is displayed again.
On the New Policy page, click New under Subjects.
The New Subjects page is displayed.
On the New Subjects page, verify that Access Manager Identity Subject is selected and click Next.
On the resulting page, provide the following information.
Subject for LoadBalancer-4.
From the drop-down list, select User and click Search. The search returns a list of available users.
From the generated User list, select testuser1 and click Add. testuser1 is displayed in the Selected List.
Click Finish.
The New Policy page is displayed again.
On the New Policy page, click OK.
The completed policy is now included in the list of Policies.
Log out of the OpenSSO Enterprise console and close the browser.
Access http://lb-4.example.com:90/index.html, the OpenSSO Enterprise load balancer, from a web browser.
Log in to OpenSSO Enterprise as testuser1.
testuser1
password
If the default Web Server index.html page is displayed, the load balancer is configured properly.
Close the browser.
Access the OpenSSO Enterprise load balancer at http://lb-4.example.com:90/index.html from a web browser again.
If not redirected to the OpenSSO Enterprise login page for authentication, clear your browser's cache and cookies and try again.
Log in to OpenSSO Enterprise as testuser2.
testuser2
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.
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. Thus we deploy Load Balancer 5 to handle traffic for the J2EE policy agents, and configure the Load Balancer for simple persistence. Use the following list of procedures as a checklist for configuring the J2EE policy agents' load balancer.
To Add Load Balancer 5 as a Virtual Host by Modifying the J2EE Policy Agent Properties
To Verify the J2EE Policy Agent Load Balancer Configuration is Working Properly
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.
Access https://is-f5.example.com, the Big IP load balancer login page, from a web browser.
Log in using the following information:
username
password
Click Configure your BIG-IP (R) using the Configuration Utility.
Create a Pool.
A pool contains all the backend server instances.
In the left pane, click Pools.
On the Pools tab, click Add.
In the Add Pool dialog, provide the following information:
J2EEAgent-Pool
Round Robin
Add the Application Server IP addresses and port numbers: pr-1:1081 and pr-2:1081.
Click Done.
In the List of Pools, click J2EEAgent-Pool.
Click the Persistence tab and provide the following information:
Choose Active Http Cookie
Active Http Cookie persistence uses an HTTP cookie stored on a client computer to allow the client to reconnect to the same server previously visited.
Choose Insert
Click Apply.
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.
If you encounter JavaScript errors or otherwise cannot proceed to create a virtual server, try using Internet Explorer for this step.
In the left frame, click Virtual Servers.
On the Virtual Servers tab, click Add.
In the Add a Virtual Server dialog box, provide the following information:
Enter the IP address for lb-5.example.com
91
Continue to click Next until you reach the Pool Selection dialog box.
In the Pool Selection dialog box, assign the J2EEAgent-Pool pool.
Click Done.
Add Monitors.
Monitors are required for the load balancer to detect the backend server failures.
Log out of the load balancer console.
In order to configure the J2EE policy agents to point to Load Balancer 5, modify the J2EE agent properties — adding Load Balancer 5 as the virtual host.
Access https://osso-1.example.com:1081/opensso/console from a web browser.
Log in to the OpenSSO Enterprise console as the administrator.
amadmin
ossoadmin
Under the Access Control tab, click / (Top Level Realm).
Click the Agents tab.
Click the J2EE tab.
j2eeagent-1 and j2eeagent-2 are displayed under the Agent table.
Click j2eeagent-1
The Global tab is displayed.
Enter a key and value for the FQDN Virtual Host Map and click Add.
The key and the value is the name of the host machine in which Load Balancer 5 is installed.
lb-5.example.com.
lb-5.example.com
Click Save.
Click Back to Main Page.
Click j2eeagent-2
The Global tab is displayed.
Enter a key and value for the FQDN Virtual Host Map and click Add.
The key and the value is the name of the host machine in which Load Balancer 5 is installed.
lb-5.example.com.
lb-5.example.com
Click Save.
Click Back to Main Page.
The policies you create here are used in To Verify the J2EE Policy Agent Load Balancer Configuration is Working Properly.
This procedure assumes that you have just completed To Add Load Balancer 5 as a Virtual Host by Modifying the J2EE Policy Agent Properties and are still logged into the OpenSSO Enterprise console.
Under the Access Control tab, click / (Top Level Realm).
Click the Policies tab.
Click New Policy.
The New Policy page is displayed.
On the New Policy page, enter URL Policy for LoadBalancer-5 in the Name field.
Click New under Rules.
The New Rules page is displayed.
On the New Rules page, accept the default URL Policy Agent (with resource name) and click Next.
On the resulting page, provide the following information.
Rule for LoadBalancer-5.
http://lb-5.example.com:91/*
Mark this checkbox and verify that Allow is selected.
Mark this checkbox and verify that Allow is selected.
Click Finish.
On the New Policy page again, under Subjects, click New.
On the resulting page, verify that Access Manager Identity Subject is selected, and click Next.
On the resulting page, provide the following information:
LoadBalancer-5_Groups
In the drop-down list, select Group and click Search.
The search returns a list of available groups.
Select Employee-Group and Manager-Group and click Add.
The Employee-Group and Manager-Group groups are in the Selected List.
Click Finish.
On the resulting page, click OK.
The created policy is displayed in the list of Policies.
Log out of the OpenSSO Enterprise console and close the browser.
Access http://lb-5.example.com:91/agentsample/index.html from a web browser.
The Sample Application welcome page is displayed.
Click the J2EE Declarative Security link.
On the resulting page click Invoke the Protected Servlet.
The policy agent redirects to the OpenSSO Enterprise login page.
Log in to OpenSSO Enterprise as testuser1.
testuser1
password
If you can successfully log in as testuser1 and the J2EE Policy Agent Sample Application page is displayed, this first part of the test succeeded and authentication is working as expected.
Click the J2EE Declarative Security link to return.
On the resulting page, click Invoke the Protected Servlet.
If the Successful Invocation message is displayed, this second part of the test has succeeded and the sample policy for the employee role has been enforced as expected.
Close the browser.
Open a new browser and access http://lb-5.example.com:91/agentsample/index.html.
The Sample Application welcome page is displayed.
Click the J2EE Declarative Security link.
On the resulting page click Invoke the Protected Servlet.
The policy agent redirects to the OpenSSO Enterprise login page.
Log in to OpenSSO Enterprise as testuser2.
testuser2
password
If the Access to Requested Resource Denied message is displayed, this third part of the test succeeded and the sample policy for the manager role has been enforced as expected.
Click the J2EE Declarative Security link to return.
On the resulting page, click Invoke the Protected EJB via an Unprotected Servlet.
If the Successful Invocation message is displayed, the sample policy for the employee role has been enforced as expected.
Close the browser.