Cns 320 en Instructorexerciseworkbook 4 5 Days v01 PDF
Cns 320 en Instructorexerciseworkbook 4 5 Days v01 PDF
Cns 320 en Instructorexerciseworkbook 4 5 Days v01 PDF
Optimizations
CNS-319-1I
Lab Guide
Credits Page
Title Name
Architects Jesse Wilson
Howard Weise
Product Manager Lissette Jimenez
Matthew Brooks
Technical Solutions Developers Anton Mayers
Aman Sharma
Rhonda Rowland
Instructional Designer Elizabeth Diaz
Graphics Designers Ryan Flowers
Joe Baum
Publication Services Akhilesh Karanth
Rahul Mohandas
Zahid Baig
Special Thanks Layna Hurst
Todd Hurst
Layer 8 Training
Contents
Credits Page ...................................................................................................................................................................2
Lab Guide Overview .......................................................................................................................................................5
Lab Environment Overview ...........................................................................................................................................6
Citrix Hands-on Labs ..................................................................................................................................................10
Module 1: NetScaler MAS: Introduction and Configuration ........................................................................................11
Exercise 1-1: Initial Configuration and Integration of MAS with NetScaler VPX ....................................................12
Module 2: NetScaler MAS: Managing and Monitoring NetScalers .............................................................................17
Exercise 2-1: Using MAS for NetScaler Instance Management ..............................................................................18
Exercise 2-2: Viewing Events and Syslog ................................................................................................................27
Exercise 2-3: Managing SSL Certificates .................................................................................................................29
Module 3: NetScaler MAS: Managing NetScaler Configurations and Integrated Analytics ........................................33
Exercise 3.1: NetScaler Configuration Management with StyleBooks ...................................................................34
Exercise 3.2: NetScaler Configuration Management with Record & Play ..............................................................37
Exercise 3-3: Analytics using Web Insight and Security Insight ..............................................................................47
Module 4: NetScaler Web Server Logging (NSWL) ......................................................................................................56
Exercise 4-1: Configuring NSWL .............................................................................................................................57
Module 5: Integrated Caching .....................................................................................................................................68
Exercise 5-1: Integrated Caching ............................................................................................................................69
Module 6: Front End Optimization (FEO) ....................................................................................................................80
Exercise 6-1: Front End Optimizations ...................................................................................................................81
Module 7: Tuning and Optimizations ..........................................................................................................................88
Exercise 7-1: NetScaler MAS Configuration Advice ................................................................................................89
Exercise 7-2: Configuring TCP/HTTP/SSL Profiles ...................................................................................................93
Exercise 7-3: Configuring Network Profiles ..........................................................................................................100
Exercise 7-4: Replacing NetScaler Default Certificates with Trusted Certs ..........................................................107
Appendix A: Transition to Part 2................................................................................................................................111
Lab Guide Overview
In this lab guide, you will get valuable hands-on experience with NetScaler management, monitoring and
optimization settings. The exercises in this module cover NetScaler MAS, NSWL, Integrated Caching, FEO. It also
includes additional tuning and optimization settings. This lab guide will enable you to work with product
components and perform required steps for configuration of the NetScaler for web application security.
5
Lab Environment Overview
Lab Diagram
SERVER LIST
6
NetScaler List
CREDENTIALS LIST (1): Training Domain Users and Groups for NetScaler Administration
7
Working with the Labs
It is strong recommended, when running the exercises in this class, that you perform NetScaler configurations
using Chrome web browser to access the NetScaler Configuration Management utility and test application attacks
and protections in Firefox.
This will allow you to switch back-and-forth from the configuration utility to the test application multiple
times during each exercise.
When certain labs require you to reset cookies or the browser's session state it will only affect Firefox and
the test applications and not your connection to the management console in Chrome.
Many of the troubleshooting and test utilities that will be required for the Application Firewall and other
exercises are only installed for Firefox.
A suggested windows arrangement is pictured below:
During the Application Firewall exercises, the NetScaler Configuration Utility (GUI) will be run in the web browser
to perform most of the configuration. You will also be asked to open two separate PuTTY sessions to make SSH
connections to the NetScaler CLI.
Putty (1) will be used to view the Syslog output as it is generated, using the following commands:
shell
cd /var/log/
tail -f /var/log/ns.log | grep APPFW
Putty (2) will be used to toggle the Application Firewall feature on or off as required:
enable ns feature appfw
disable ns feature appfw
8
These SSH sessions will be used to make it easy to view Application Firewall violations as they occur or to switch
the feature on and off frequently during exercises. The lab will instruct you when to create the sessions and when
to use them.
It is recommended that students keep the two session running during the Application Firewall labs and switch
between the Putty sessions as needed. A suggested arrangement for the windows is displayed below.
9
Citrix Hands-on Labs
Certification exam preparation Get ready for your Citrix certification exam
by practicing test materials covered by lab
exercises.
10
Module 1: NetScaler MAS: Introduction and
Configuration
Overview:
The NetScaler Management and Analytics System (NetScaler MAS) is a virtual appliance that integrates the
management, auditing, and configuration features of NetScaler Command Center using a new interface and
management engine with the Analytics capabilities of NetScaler Insight Center. The new NetScaler MAS can be
used to manage NetScaler MPX, VPX, and SDX deployments along with NetScaler SD-WAN products in one
centralized utility. Modules 1-3 in this exercise workbook will cover various aspects of configuring and using
NetScaler MAS to manage, configure, troubleshoot, and analyze NetScaler implementations.
NetScaler MAS lecture and exercises are divided into the following modules:
Describe NetScaler MAS setup requirements (though the initial virtual appliance configuration has already
been performed, these settings will be reviewed during the exercise.)
Configure NetScaler MAS to manage one or more NetScaler systems and manage key settings of the initial
MAS setup.
o Configure NetScaler appliances for management by NetScaler MAS.
o Perform additional NetScaler MAS setup tasks such as session timeouts, NTP synchronization,
managed instance backup settings, and dashboard polling intervals.
This module contains the following exercises using the NetScaler Configuration Utility GUI:
Exercise 1-1: Initial Configuration and Integration of MAS with NetScaler VPX 15 min
11
Exercise 1-1: Initial Configuration and Integration of MAS with
NetScaler VPX
In this exercise, you will access the NetScaler MAS management console and integrate the NetScaler NS_VPX_01
for management and reporting with NetScaler MAS. The initial NetScaler MAS configuration settings will be
reviewed and additional post-setup configuration changes will be applied.
This exercise introduces the initial NetScaler MAS setup and configuration.
12
Connect to NetScaler MAS
Step Action
1. Open Chrome and in Tab (1) connect to the NetScaler configuration utility for NS_VPX_01 using
the NSIP at http://192.168.10.101. (Use Chrome for NetScaler Configuration Utility connections.)
2. In Chrome, open a new tab and in Tab (2) connect to NetScaler MAS management utility at
http://mas.training.lab.
3. Complete the NetScaler MAS setup tasks available in the Getting Started wizard:
Click Get Started.
Select Single Server Deployment under Select Deployment Type and Click Next.
Note: The virtual appliance has been minimally configured for networking when the VM was
imported. This lab will show management and configuration tasks available from the GUI and
will not require access to XenCenter or the VM console.
Note: If the new instance button is greyed out, click Finish and then go the infrastructure ->
Instances -> NetScaler VPX and select Add
5. Create a new profile for NetScalers in the lab, before configuring other settings:
Click + (plus sign) next to Profile Name to create a new Profile.
Enter netscaler_labstandard in the Profile Name field.
Enter nsroot in the User Name field.
Enter nsroot in the Password field.
Enter public in the Community field.
Deselect (uncheck) Use global settings for NetScaler communication.
Select http under Protocol for NetScaler communication.
Click Create.
13
6. Add NetScaler instance to manage:
Enter 192.168.10.101 in the IP Address field.
Verify netscaler_labstandard is still selected under Profile Name.
Click OK.
8. Switch to Tab (1) for the NetScaler configuration utility for NS_VPX_01 using the NSIP at
http://192.168.10.101. Log on as nsroot / nsroot.
10. Return to Tab (2) for the NetScaler MAS management console at http://mas.training.lab. Log on
as nsroot / nsroot.
2. Use the NetScaler MAS Setup Wizard to review initial configuration settings:
Click on System tab.
Navigate to System Administration in the left pane.
Click Setup Wizard Settings under Set Up NetScaler MAS in the right pane.
14
3. Run the NetScaler MAS Setup Wizard:
Click NetScaler MAS Network.
Verify the following information is entered:
o NetScaler Management and Analytics System IP Address: 192.168.10.15
o Netmask: 255.255.255.0
o Gateway: 192.168.10.1
o DNS: 192.168.30.11
Click Back.
Note:
All of these settings can be configured during the initial appliance set up via the command line
interactive setup menu. Once MAS is on the network, the settings can be changed using this
menu in the GUI.
Also note, the MAS admin account password for the nsroot user can be changed here. DO NOT
change the password in the lab environment, but include this step during any production setup.
Note: The timeout for NetScaler MAS management console is being increased to minimize logon
requirements during lab exercises. A shorter timeout may be more appropriate for production
deployments. A logout is required for the new timeout to take effect.
15
8. Configure Polling Interval for Managed Devices:
Click Applications tab.
Navigate to Dashboard > Settings.
Click Configure Polling Interval for Entities.
Enter 10 in the Poll Interval (minutes) field. (This is the minimum polling interval.)
Click OK.
NOTE: To ensure that we have reasonably frequent updates during lab, the smallest supported
polling interval will be used. This may impact sizing and data growth in production deployments.
10. Return to Tab (2) for the NetScaler MAS management console at http://mas.training.lab. Log on
as nsroot / nsroot.
Takeaways:
NetScaler MAS is meant to replace Citrix Command Center for NetScaler management, monitoring, and
alerting tasks. NetScaler MAS combines Citrix Command Center and NetScaler Insight Center into one
management system. NetScaler MAS also introduces additional new management features not present in
the previous Citrix Command Center product.
NetScaler MAS can be used to manage and monitor multiple NetScaler systems of any NetScaler appliance
types, including NetScaler MPX, NetScaler VPX, NetScaler SDX and its instances.
16
Module 2: NetScaler MAS: Managing and
Monitoring NetScalers
Overview:
In this module, you will use NetScaler MAS to view current real-time dashboard and statistics information for
managed NetScaler appliances. The exercises in this module will demonstrate the different levels of information
available from the NetScaler MAS, Instance Dashboard, Infrastructure Dashboard, and the Application Dashboard
views. Additional monitoring capabilities using the events view and syslog will extend the NetScaler administrators
view of real-time operation of the managed NetScaler appliances.
Finally, SSL Certificate expiration and monitoring will be used to identify expiring certificates within the
environment. NetScaler MAS will then be used to update and replace the certificates with replacement files.
Use NetScaler MAS to monitor real-time events and statistics on the managed NetScaler appliances.
Use NetScaler MAS to identify hotspots and trouble areas with specific NetScalers, entities, or applications
to facilitiate a quicker time to resolution.
Use NetScaler MAS to monitor and manage event and syslog reporting.
Use NetScaler MAS to identify certificates in use, certificate expiration alerts, and to manage certificate
replacement tasks.
This module contains the following exercises using the NetScaler Configuration Utility GUI:
17
Exercise 2-1: Using MAS for NetScaler Instance Management
In this exercise, you will use the NetScaler MAS dashboard functions to identify appliance, entity, and application
summary data using the dashboard functions. These dashboards provide graphical summaries of key statistics, top-
n style metrics for alerts and entities in use, alerts, and other key metrics. The dashboards provide monitoring and
alerting capabilities that can be used to view items across multiple NetScaler instances, multiple traffic
management entities, and/or applications. The dashboards also allow administrators to view the available metrics
from a number of different perspectives and use the summary metrics to drill-down to specific entities.
NetScaler MAS provide different dashboard views depending on how the statistics should be viewed. This exercise
demonstrates where to access these views and key information relevant to each. These views include the instance
dashboard, infrastructure dashboard, and application dashboard.
These dashboards can be used for monitoring status and for drilling down into entities for quick management tasks
like enabling and disabling affected resources.
View statistics and operational tasks available from the Instance dashboard.
Manage instance backups and backup restorations.
Generate a traffic load event and identify how this statistics affect the dashboard views.
Define and manage virtual servers as applications in NetScaler MAS.
In this exercise, you will perform the following tasks:
2. Return to Tab (2) for the NetScaler MAS management console at http://mas.training.lab. Log on
as nsroot / nsroot.
NOTE: This instance-level dashboard view is different than the Infrastructure Dashboard (left
pane navigational node) that summarizes all instances.
18
4. Review the summary information in the Instance Dashboard view:
Current NetScaler instance CPU, Memory, Disk utilization.
Status of Virtual Servers above 75% health. This is clickable and will take you to a pre-
configured search filter of the affected virtual servers at the status level selected.
Summary of Events.
Certificate expiration summary. This is also clickable and will take you to a list of
certificates in the affected categories. Notice that at least one certificate has expired;
this will be addressed later.
Network Interface Summary.
Scroll down to the Information section and view NetScaler instance details:
View NetScaler system details such as: NSIP, uptime, build version, hardware version
and system model ID details.
Note that the running vs. saved configuration comparison can be made on the instance
dashboard.
Licensed Features shows which features are licensed (not which features are enabled).
Modes displays summary of enabled/disabled modes.
Note:
The Instance Dashboard is accessed by selecting the instance on the Infrastructure page
and clicking the Dashboard button in the right-pane.
This is different than the Dashboard for all instances at the top of the navigation pane
under the Infrastructure tab. (Which will be viewed in a later step.)
This is also separate from the Dashboard view present under the Applications tab.
19
5. Return to instance details for NS_VPX_01 (192.168.10.101):
Click on Infrastructure tab.
Navigate to Instances > NetScaler VPX.
If still in the Instance Dashboard view, use the navigation bread crumbs to backup one
level and return to the NetScaler VPX list.
Verify a green confirmation message is displayed as a banner in the page. Click in the in-page
refresh icon to refresh this view and verify the backup file is displayed.
20
8. Scroll down the Infrastructure Dashboard view the following:
The top dashboard summary identifies total entities being across all managed devices.
Events by Severity (for all instances)
Health, Up Time, Models, and Versions for all instances.
NetScaler Certificates, Config Save Status, and NetScaler config drift across all instances.
Wait for the NetScaler to reboot and reconnect to http://192.168.10.101 in Tab (1) before
continuing.
10. Verify the load balancing virtual servers are in an UP state following reboot.
Navigate to Traffic Management > Load Balancing > Virtual Servers.
Verify the virtual servers are in an UP state (except for lb_vsrv_callout).
If the virtual servers are DOWN, wait 30 seconds - 1 minute for all services to finish
initializing following the reboot.
Use the in-page refresh to refresh the view.
Verify virtual servers are UP before continuing.
21
11. Generate an event on the managed NetScaler:
Use the hulk.py scripts to generate a brief load event. Prep the CMD Prompt (2) with the taskkill
command before actually generating load. Commands are located in
C:\resources\hulk_commands.txt for easy reference.
During the test, keep both CMD prompts running with access to the commands during the next
several steps and you can start/restart the Python script and terminate the process as needed.
When the test is done, remember the following:
If you have issues terminating the script, use task manager to terminate any running
python process.
Be sure the hulk.py process is stopped before continuing after the test.
NOTE: A text file containing both commands is located on the Student Desktop at
C:\resources\hulk_commands.txt. Use this to copy and paste commands to the CMD prompts, if
needed.
22
12. Return to MAS in Tab (2). Remain on the Infrastructure tab > Dashboard view.
View Events by Severity:
Change time period from 1 Day to 5 minutes.
Click on Major in the Events by Severity graph to display a list of major events across all
managed devices.
Depending on time frames, this should include events related to the NetScaler reboot
and the rate limit being reached (based on the bandwidth limit in the license).
2. Return to Tab (2) for the NetScaler MAS management console at http://mas.training.lab. Log on
as nsroot / nsroot.
NOTE: The Dashboard on the Applications tab is different than the Infrastructure Dashboard
and Instance Dashboards viewed previously. This Dashboard can be toggled between virtual
servers views and applications views.
23
4. Review the information on the Applications Dashboard for Virtual Servers. Verify the
information displayed for the following areas:
Top 5 Virtual Servers with Highest Client Connections should display spikes in activity
for lb_vsrv_rbg and little to no activity for other virtual servers. (It may take a few
minutes after stopping the hulk.py script before data is displayed.)
Top 5 Virtual Servers with Highest Server Connections.
Virtual Servers summarized by State: Up, Down, Out of Service.
Managed NetScaler instances providing virtual servers.
Summary views for Virtual Servers by health, protocols, load balancing methods, and
persistence type.
NOTE: The virtual servers below each graph are clickable and you can customize the graph to
show all, some, or specific virtual server data.
Create an Application for WebGoat Content that includes the WebGoat and Callout virtual
servers:
Click New Application.
Enter WebGoat App in the Name field.
Click Add Virtual Servers > LB Virtual Servers.
Select (check) lb_vsrv_callout, lb_vsrv_webgoat, and lb_vsrv_webgoat_ssl.
Click Select.
Click OK.
Note: An application in NetScaler MAS is a way to group multiple virtual servers together so
that they can be managed and viewed as a single entity. This can be used to group virtual severs
and dependencies together, such as if we were using the callout or an authentication virtual
server in conjunction with a load balancing virtual server or content switching and the
destination load balancing virtual servers could be combined together. This could also be useful
to keep track of HTTP and HTTPS virtual servers that frontend the same application. This step
was meant to illustrate the concept that an application does not have to be defined 1:1 per
virtual server.
Also note a given virtual server can appear in more than one Application definition in MAS, so
different "views" can be used to monitor the same virtual server.
24
6. Use Applications Dashboard to manage NetScaler entities and perform operational tasks:
Remain on Applications tab.
Navigate to Dashboard > Load Balancing > Virtual Servers.
Select (check) lb_vsrv_afweb and lb_vsrv_webgoat and click Disable.
Click Yes to confirm.
View Applications Dashboard:
Navigate to Dashboard node in left-pane (on Applications tab).
Scroll down to the State summary graph and verify 2 virtual servers are listed as "out of
service".
7. Switch to Tab (1) in Chrome for the NetScaler Configuration Utility for NS_VPX_01 at
http://192.168.10.101. Log on as nsroot / nsroot if needed.
Click ok on Infomational Pop-up
Navigate to Traffic Management > Load Balancing > Virtual Servers.
Refresh the view, if necessary.
Verify lb_vsrv_afweb and lb_vsrv_webgoat are disabled and listed as "out of service".
8. Return to Tab (2) in Chrome for the NetScaler MAS management console at
http://mas.training.lab. Log on as nsroot / nsroot.
10. Return to the Virtual Servers node and view virtual server states.
Navigate to Dashboard > Load Balancing > Virtual Servers.
Notice after enabling svc_callout, lb_vsrv_callout is still DOWN. This is due to the polling
frequency.
Click Poll Now and click Yes to confirm on the Virtual Servers plage to update all virtual
servers.
Click OK to confirm polling initiatied successfully.
Click the in-page refresh to verify lb_vsrv_callout is now UP.
25
11. Return to the Virtual Servers node to re-enable the virtual servers.
Select (check) lb_vsrv_afweb and lb_vsrv_webgoat.
Click Enable and click Yes.
Takeaways:
NetScaler MAS can view NetScaler instance, entity, and application status and key dashboard metrics and
top-n statistics.
NetScaler MAS dasbhoards and related drill-down views allow administrators to manage NetScaler
instance configurations and backups.
NetScaler MAS application and infrastructure dashboards can allow administrators to enable/disable
entities across multiple managed NetScalers.
NetScaler MAS allows administrators to switch from dashboard statistics and summary views to entity
configuration and management views.
26
Exercise 2-2: Viewing Events and Syslog
In this exercise, you will use NetScaler MAS as a syslog destination for one or more managed NetScaler instances.
NetScaler MAS can remotely configure the appropriate syslog audit policies configuring itself as the syslog audit
destination server.
NetScaler MAS will act as an event dashboard and a centralized Syslog management server for all managed
NetScalers.
2. Return to Tab (2) for the NetScaler MAS management console at http://mas.training.lab. Log on
as nsroot / nsroot.
3. Attempt to view Syslog events for managed NetScaler instances using NetScaler MAS:
Click on Infrastructure tab.
Navigate to Events > Syslog Messages.
Verify no syslog events are currently displayed for any NetScaler instance.
4. View the NetScaler MAS Syslog events. This is the MAS's own local syslog:
Click on Applications tab.
Navigate to Dashboard > Auditing.
Verify mas and mas_config messages are displayed here.
6. Return to Tab (2) for the NetScaler MAS management console at http://mas.training.lab. Log on
as nsroot / nsroot.
27
7. Integrate external syslog reporting from the managed NetScaler (192.168.10.101) to NetScaler
MAS:
Click on the Infrastructure tab.
Navigate to Instances > NetScaler VPX node in the left-pane.
Select 192.168.10.101 and click Action > Configure Syslog.
Select (check) Enable.
Click OK.
Click Close.
NOTE: Logging level default to ALL in this configuration instead of ALL except for DEBUG.
9. Return to Tab (2) for the NetScaler MAS management console at http://mas.training.lab. Log on
as nsroot / nsroot.
Takeaways:
Syslog logging to NetScaler MAS just requires the necessary syslog policy to be bound to the global system
object on the managed NetScalers. NetScaler MAS helps streamline the configuration by enabling remote
configuration of the necessary syslog policies, in the same way NetScaler MAS can configure AppFlow
integration.
28
Exercise 2-3: Managing SSL Certificates
In this exercise, you will use NetScaler MAS to identify SSL certificates in use and perform SSL certificate
management tasks. The NetScaler MAS SSL Certificate summary will be used to identify time to expiry for
certificates in use and which certificates have expired.
Once expired certificates have been identified, NetScaler MAS can be used to perform certificate update tasks by
uploading new certificate and private key files to the existing NetScaler appliances using the existing certkey
objects.
Replacement certificate and private key files are uploaded to the NetScaler MAS before being distributed to the
managed NetScaler appliance. Once a replacement set of files are on the NetScaler MAS the instance of the files
on the NetScaler MAS can then be used to distribute the updated certificate and private keys to other managed
NetScaler instances.
2. Return to Tab (2) for the NetScaler MAS management console at http://mas.training.lab. Log on
as nsroot / nsroot.
29
3. View the SSL Certificates summary under Infrastructure:
Click the Infrastructure tab.
Navigate to SSL Certificates node in the left pane.
Click Settings in the right pane.
Click Edit (pencil icon) next to Certificate Settings.
Notice the SSL Certificates console in NetScaler MAS can be tailored to highlight recommended
information:
Supported Trusted Certificate Authorities
Recommended Signature Algorithms and Recommended Key Strengths.
If the values highlighted are changed, this will affect the display graphs reporting. Keep
the default values for now.
SSL Certificate notification settings can be adjusted here. Default expiration warning is
30 days from expiry. If NetScaler MAS is configured with Email (SMTP) and SMS
notification details, then additional notifications may be generated.
30
7. Update the Expired SSL Certkey:
Navigate to SSL Certifcates in the left pane again.
Click on Expired in the Expiry graph. One certificate is currently expired.
This takes you to the certificate management page for the list of expired certificates.
Select (check) wc-training.certkey and click Update.
Update the Certificate and Private Key files associated with the SSL Certkey:
Click Choose File under the Certificate File drop-down list to browse the NetScaler MAS
Appliance. Notice there are no files in the file browser list. Click Cancel.
Click the down arrow next to Choose File under the Certificate File drop-down list and
click Local to browse the Student Desktop.
o Browse to C:\resources\SSL Certs\NEWCerts_v2\.
o Select wc-training-v2.cer and click Open.
Click the down arrow next to Choose File under the Key File drop-down list and click
Local to browse the Student Desktop.
o Browse to C:\resources\SSL Certs\NEWCerts_v2\.
o Select wc-training-v2.pem and click Open.
Verify Certificate Format is set to PEM.
Enter Password1 in the Password field.
Click OK to upload the files to the managed NetScaler and update the SSL Certkey file paths.
NOTE:
When updating the files an SSL certkey points to using the NetScaler native tools, the
new certificate and private key file names can be the same name as the original files
and will overwrite them.
When updating the files an SSL certkey points to using the NetScaler MAS tools, the
private key and certificate file names must be different than the existing files in use on
the destination NetScalers as MAS will not overwrite files currently in use by a certkey.
(Files on the NetScaler not in use with a certkey object will be overwritten.)
NOTE: The files for this certificate-key pair distributed to the managed NetScaler are now stored
on NetScaler MAS and could be used to update other SSL certkeys on other managed NetScalers.
These could then use the Choose File (from Appliance) option.
31
11. Return to the NetScaler GUI in Tab (1).
If the option to save the configuration was not enabled when updating the certkey, the
changes to the running configuration are not yet saved.
Takeaways:
Certificate and Private keys are stored on the NetScaler MAS prior to distribution to managed NetScalers.
NetScaler MAS will look for files on its own system if the "appliance" option is selected under upload.
Once certificate files have been distributed to one NetScaler, NetScaler MAS archives a copy of the
certificate and private key and can use its own copy of the files when distributing the files to subsequent
managed NetScalers.
If using the native NetScaler Configuration Utilty to update a certkey with replacement certificate and
private key files, the new files can retain the same name as the original certificate and private key files
that they are replacing. When performing the same update using NetScaler MAS, the replacement
certificate and private key files must have a different name from the files that they will be replacing.
NetScaler MAS will not overwrite existing certificate and private key file names that are still in use by an
active SSL certkey. The lab exercise got around this by replacing the original files with new files with a
different name.
32
Module 3: NetScaler MAS: Managing NetScaler
Configurations and Integrated Analytics
Overview:
In this module, you will use NetScaler MAS to push configuration changes to managed NetScaler systems and to
view analytics using Web and Security Insight.
This module will demonstrate the use of StyleBooks and configuration templates to manage configuration changes
across individual or multiple managed NetScalers. The default StyleBooks included in the NetScaler MAS, will be
used to demonstrate one method for an administrator to add entities to the NetScaler. This module also
demonstrates how to use the job configuration tasks to build custom configuration templates leveraging existing
built-in templates, manually creating templates, and the use of Record & Play to generate lists of commands for
use in custom templates and tasks. The construction of command templates and command variables are used to
illustrate how to create re-usable tasks on NetScaler MAS to push command changes to multiple NetScalers for
multiple object instances.
This module will also demonstrate the integration of NetScaler Insight with NetScaler MAS. The exercise in this
module will demonstrate Web Insight with HTML Injection. Security Insight will also be explored to demonstrate
the Application firewall statistics.
Manage NetScaler configuration changes, using StyleBooks to push changes to one or more NetScalers
and use the job generated by the StyleBook to remove configured objects.
Manage NetScaler configuration changes, using templates and jobs, by performing the following tasks:
o Create custom configuration templates using manual configuration tasks or using the Record &
Play feature.
o Define variables in a custom job and save as a template for re-use.
o Use templates to create specific configuration jobs and either run in real-time or schedule for
future deployment.
Configure and integrate NetScaler MAS Analytics reporting using AppFlow, by:
o Enable NetScaler MAS Web Insight, HTML Injection, and Security Insight data gathering.
o View Web Insight and HTML Injection statistics within NetScaler MAS.
o View Security Insight statistics within NetScaler MAS.
This module contains the following exercises using the NetScaler Configuration Utility GUI:
33
Exercise 3.1: NetScaler Configuration Management with
StyleBooks
In this exercise, you will use NetScaler MAS to deploy configuration changes to the managed NetScaler system
using the built-in StyleBooks.
StyleBooks act as a template for configuring specific features on the managed NetScaler. StyleBooks can be used to
provide a configuration pack (template) that can be used to configure entities that conform to a specific naming
convention and pre-defined set of parameters.
Use the built-in StyleBook to create a new load balancing virtual server for CMY services (192.168.30.54-
56). The services do not actually exist in the lab, but the configuration process will be demonstrated.
Use the StyleBook wizard to perform a dry run prior to performing the live configuration.
In this exercise, you will perform the following tasks:
2. Return to Tab (2) for the NetScaler MAS management console at http://mas.training.lab. Log on
as nsroot / nsroot.
NOTE: The StyleBook "HTTP/SSL Load Balancing (with monitors) generates errors when a
monitor is included. One of the parameters causes problems. Be sure to use the provided in
Stylebook in the lab step; be careful of using random stylebook.
34
5. Configure the load balancing configuration using a StyleBook. Enter the following values for the
fields listed:
Load Balanced Application Name: cmy
Load Balanced App Virtual IP Address: 172.21.10.113
Expand the Advanced Load Balancer Settings.
Load Balanced App URL Redirect: http://rbg.training.lab
Load Balanced App Algorithm: ROUNDROBIN
Load Balanced App Persistence Type: NONE.
Minimize the Advanced Load Balancer Settings.
Configure Load Balancing Server/Services:
Click "+" next to Application Servers IP Addresses until you have 3 IP Address fields.
Enter the following IP Addresses in the Application Servers IP Addresses (list):
o 192.168.30.54
o 192.168.30.55
o 192.168.30.56
NOTE: The service IP addresses used in this step are not real IP addresses in the lab. They are
being used for demonstration purposes. These services will be deleted later. DO NOT use IP
Addresses for the actual RBG, AFWeb, or WebGoat services in this exercises, unless noted.
7. Apply settings:
Uncheck Dry Run.
Click Create.
Verify configuration:
Click View objects created.
When done reviewing the objects, close the Objects Created dialog: Click "X" in upper
right corner.
Verify the configuration named cmy appears in the configurations list.
NOTE: Note the naming convention used with the objects is defined by this StyleSheet. The app
name "cmy" is then prepended to the LB vServer, Service Group entity names. A different
StyleBook could be used to support a different naming convention.
35
8. Switch to Tab (1) and view the objects in the NetScaler Configuration Utility at
http://192.168.10.101. Log on as nsroot / nsroot if needed.
NOTE: The IP addresses in use in this step are IP Addresses for fictitious CMY services and do not
match any entity in the lab. These values must be used to avoid conflicts with other lab entities.
12. Return to Tab (2) to access the NetScaler MAS console at http://mas.training.lab. Log on as
nsroot / nsroot if required.
Takeaways:
NetScaler StyleBooks are based on YAML format, which is case-sensitive and requires proper indentation.
Spaces must be used instead of tabs when formatting YAML output.
NetScaler MAS StyleBooks and their configuration packs are based on YAML and the NetScaler Nitro API.
36
Exercise 3.2: NetScaler Configuration Management with Record
& Play
In this exercise, you will use the NetScaler MAS to manage NetScaler configuration settings using configuration
templates. InBuilt templates provide pre-defined command definitions that can be used to create new
configuration jobs or as starting points for manually creating custom jobs. These templates can also contain
variable definitions so that the templates can be used to repeat configuration tasks.
To allow for greater flexibility in building complex tasks, NetScaler MAS contains a Record & Play feature that
allows an administrator to configure settings in a NetScaler (test or production) and then use the configuration
commands executed during the Record & Play session as the commands to seed the job with. These commands
can then be converted to a template, modified with variables, and then used to create additional jobs.
In this scenario, the Record & Play scenario will be used to generate a template that can be used to generate a load
balancing virtual server, create a service group, and bind the service group to the virtual server. The template will
allow administrators to supply custom values such as Virtual IP Address, port, virtual server name, and service
group name. To make the template truly useful as a repeatable task for multiple entities across multiple
NetScalers, the template will allow any number of service members to be bound to the service group by defining a
service IP or service IP range.
2. Return to Tab (2) for the NetScaler MAS management console at http://mas.training.lab. Log on
as nsroot / nsroot.
NOTE: For this exercise, ensure you are using Chrome. In order to use the Record & Play option,
pop-up blockers in the browser must be disabled. This has already been done on the lab system
in the Chrome browser.
37
3. Manage configuration jobs:
Click the Infrastructure tab.
Navigate to Configuration Jobs in the left-pane.
Click Create Job on the initial welcome pane.
Notice how the command incorporates variables as $<variable name>$, making the task generic
and repeatable.
NOTE: This is the procedure to run a task defined on the fly or based on a previously created
template. The next step will be used to view the "execute now" and the "schedule for later"
options, but the exercise is not going to run this task against the selected NetScaler.
38
Create a Custom Template and Job using Record & Play
Step Action
1. Create a JOB using Record and Play to create a virtual server and bind a service group with
services.
Click on Infrastructure tab.
Navigate to Configuration Jobs.
Click Create Job.
If the NetScaler Configuration Utility for NS_VPX_01 doesn't open in a new window, verify pop-
up blockers are disabled in your browser. This browser window will be restricted to the
NetScaler Configuration Utility only.
NOTE: The IP address(es) in use in this step are IP Addresses for fictitious CMY services and do
not match any entity in the lab. These values must be used to avoid conflicts with other lab
entities.
39
4. Create a Load Balancing Virtual Server:
Navigate to Traffic Management > Load Balancing > Virtual Servers.
Click Add.
Enter lb_vsrv_cmy in the Name field.
Enter 172.21.10.113 in the IP Address field.
Click OK.
Bind a Service Group to the Load Balancing Virtual Server:
Click No Load Balancing Virtual Server ServiceGroup Binding under the Services and
Service Group category.
Click Click to Select under Select Service Group Name*.
Select svcg_cmy and click Select.
Click Bind.
Click Continue.
Click Done to complete the Load Balancing Virtual Server.
5. Close the browser running the pop-up session of the NetScaler Configuration Utility
(http://192.168.10.101). This will return you to the Record & Play session the browser instance
running NetScaler MAS.
Click Stop in the Configuration Editor to stop the Record and Play recording session.
A link of 4 commands from 192.168.10.101 should appear in the configuration pane (left pane).
6. Drag the command link from the left pane to the right pane:
A list of commands from the Record and Play session will be displayed in the right-pane.
40
7. Update the list of commands, to make a generic task that can be used to create any LB vServer
with a Service Group binding. Several lines will need to be edited.
If you have an issue, you can re-drag and drop content from the template to replace commands.
The template will be updated once all tasks have been completed.
8. Below is the current command list in the Configuration Editor (indented lines continue from
preceding line):
add serviceGroup svcg_cmy HTTP -maxClient 0 -maxReq 0 -cip
DISABLED -usip NO -useproxyport YES -cltTimeout 180 -
svrTimeout 360 -CKA NO -TCPB NO -CMP YES
add lb vserver lb_vsrv_cmy HTTP 172.21.10.113 80 -
persistenceType NONE -cltTimeout 180
bind lb vserver lb_vsrv_cmy svcg_cmy
bind serviceGroup svcg_cmy 192.168.30.54 80
Edit the commands so they match the commands listed below. Notice that default settings are
being removed to simplify commands. Detailed settings can be adjusted in the native console.
add serviceGroup $my_svcg$ HTTP
add lb vserver $my_lbvsrv$ HTTP $my_vip$ $my_port$
bind lb vserver $my_lbvsrv$ $my_svcg$
bind serviceGroup $my_svcg$ $my_svcIP_orRange$ $my_port$
The service members IP in the ServiceGroup bind command are meant to allow a user to supply
an individual service IP Address or an IP Range using the following notation. Allowing this
template to be used to bind any number of services in a single task:
Example:
bind serviceGroup svcg_demo 192.168.30.[1-3]
NOTE: The IP addresses in use in this step are IP Addresses for fictitious CMY services and do
not match any entity in the lab. These values must be used to avoid conflicts with other lab
entities.
41
9. Verify the final command set looks like this:
Define each of the following by clicking on the variable name, updating the specified values, and
then click Save for each variable. Configured variables will be GREEN instead of BLUE.
Variable 1: $my_svcg$
o Name: my_svcg
o Display name: ServiceGroup Name
o Type Text Field.
Variable 2: $my_lbvsrv$
o Name: my_lbvsrv
o Display name: LB vServer Name
o Type Text Field.
Variable 3: $my_vip$
o Name: my_vip
o Display name: Virtual IP Address
o Type IP Address Field.
Variable 4: $my_port$
o Name: my_port
o Display name: Port
o Type Numeric Text Field.
Variable 5: $my_svcIP_orRange$
o Name: my_svcIP_orRange
o Display name: Service IP or IP Range
o Type Text Field.
IMPORTANT: Do not use the IP Address Field type here.
NOTE: The variables $my_svcg$ and $my_lbvsrv$ are used in multiple places. Therefore, when
the first instances of $my_svcg$ is defined in line 1, the references in lines 3 and 4 should also be
defined. The same is true for $my_lbvsrv$; updating the definition in line 2 also updates the
corresponding references in line 3.
If you have issues with this step, verify the names are consistent between lines for $my_svcg$,
$my_lbvsrv$, and $my_port$.
42
11. Once all variables have been defined, the values will be listed in GREEN instead of BLUE:
13. Cancel the current job and start a new one based on the template.
Click Cancel.
Click Create Job on the Welcome to Jobs Screen.
43
16. Configure variables in task:
Select Common Variable Values for all Instances.
Click Next.
This will create new entities that do not conflict with existing settings on the NetScaler. They can
be removed after this exercise.
NOTE: The IP addresses in use in this step are IP Addresses for fictitious CMY services and do
not match any entity in the lab. These values must be used to avoid conflicts with other lab
entities.
Click Finish.
The job should complete successfully. Use the in-page refresh if necessary to update the status
of the job.
NOTE: If you need to run the task again, you must remove conflicting entities before repeating.
44
19. Use the custom template to create another virtual server.
Select Configuration:
Click Create Job.
Enter job2_lb_vsrv_demo2 in the Job Name field.
Select NetScaler under instance Type.
Select Configuration Template under Configuration Source.
Drag and Drop the Template_lbv_withSvcGroup to the right-pane. (Verify all variable
definitions are GREEN.)
Click Next to continue to Select Instances.
Select Instances:
Click Add Instances.
Select (check) 192.168.10.101 and click OK.
Click Next.
45
22. Before continuing, remove the previously created entities.
rm serviceGroup svcg_cmy
rm serviceGroup svcg_demo1
rm serviceGroup svcg_demo2
rm server 192.168.30.[54-56]
rm server 192.168.30.[21-28]
Close putty.
Takeaways:
Jobs are a specific task instance. Repeating a job uses the exact same conditions and values as when the
job was created. This is useful for recreating entities again, but doesn't allow you to run the task with
different values.
A template is a capture of a set of commands that can also contain variables and the variable definitions.
Templates can therefore represent a simple or complex set of conditions that can be run multiple times
with different values (in different jobs) or across multiple instances.
For complex configurations, consider defining small templates with individual elements like creating a
virtual server, binding services, binding service groups, and then binding policies. Then these templates
can be combined into more complex templates or jobs for re-use.
Templates and jobs can be generated manually, based on inbuilt templates, custom templates that you've
built, or by reviewing commands generated on a specific NetScaler within a specific time period, or by
using Record & Play.
46
Exercise 3-3: Analytics using Web Insight and Security Insight
In this exercise, you will enable Web Insight with HTML injection and review the web site performance metrics
available within NetScaler MAS. Security Insight will also be demonstrated as NetScaler MAS can replace the use of
NetScaler Insight.
Enable Web Insight with HTML Injection for the RBG web server. Review Web Insight metrics and HTML
Injection.
Enable Security Insight for the AFWeb and WebGoat (HTTP) virtual servers. Briefly review Security Insight
settings.
Verify that NetScaler Insight Center functions are fully embedded in NetScaler MAS, allowing MAS to
replace independent NetScaler Insight deployments.
In this exercise, you will perform the following tasks:
2. Enable the Application Firewall feature, so that that AppFw policies are in effect on the AFWeb
and WebGoat virtual servers (policies are already bound).
Navigate to System > Settings.
Click Configure Basic Features.
Enable (check) Application Firewall. (Do not modify any other existing features.)
Click OK.
NOTE: The existing profiles are not fully configured for use with the SSL virtual servers.
Connections to Https:// will not be tested during this exercise.
47
4. Open Firefox and verify Application Firewall settings are in effect. For best results, test
applications in Firefox and manage NetScaler and NetScaler MAS configurations in Chrome.
Test WebGoat:
Browse to http://webgoat.training.lab/WebGoat/attack or use the WebGoat
bookmark. (Error will be generated if trailing "/" is included after attack.)
Log on as guest / guest.
Click Start WebGoat on the main page.
Navigate to Admin Functions > Report Card. This page should load successfully using
the following URL:
http://webgoat.training.lab/WebGoat/attack?Screen=XXXX
&menu=XXXX
NOTE: Many of the AppFw protections have been adjusted to allow certain behavior as part of
the Application Firewall exercises. Meaning, not all attacks in WebGoat or AFWeb will generate
the expected violations. During the NetScaler MAS demonstration of Security Insight, the attacks
generated will be limited.
5. Return to Chrome and Tab (2) for the NetScaler MAS management console at
http://192.168.10.15. Log on as nsroot / nsroot.
Verify you are connected by IP address and not FQDN: http://192.168.10.15/
IMPORTANT: For this exercise you must connect to MAS by IP address and not FQDN. There is a
current issue in both NetScaler Insight Center and NetScaler MAS that when enabling AppFlow
connections the server name in the management console connection is used as the AppFlow
collector destination name. Connections by name fail, but connections by IP Address succeed.
48
7. Enable Web Insight with HTML Injection for lb_vsrv_rbg:
Select (check) 172.21.10.101 lb_vsrv_rbg and click Enable AppFlow.
Enter true in the Expression field.
Check Web Insight.
Check HTML Injection.
Click OK.
Deselect (uncheck) 172.21.10.101 after the settings are applied.
8. Enable Web Insight, HTML Injection, and Security Insight for lb_vsrv_afweb and
lb_vsrv_webgoat.
Select (check) 172.21.10.111 lb_vsrv_afweb (HTTP).
Select (check) 172.21.10.112 lb_vsrv_webgoat (HTTP).
Click Enable AppFlow.
Enter true in the Expression field.
Check Web Insight.
Check HTML Injection.
Check Security Insight.
Click OK.
NOTE: There are both SSL and HTTP virtual servers for AFWeb and Webgoat. Be sure you select
the HTTP virtual servers, as App Firewall policies are not bound to the SSL virtual servers.
9. Switch to the NetScaler Configuration Utility open in Tab (1) using the NSIP at
http://192.168.10.101. Log on as nsroot / nsroot.
NOTE: These two parameters are not enabled by NetScaler MAS (or NetScaler Insight Center)
when enabling AppFlow and Security Insight. The parameters can be updated manually.
49
2. View the Analytics tab:
Click Analytics.
Navigate to Web Insight > Instances. No data is currently displayed.
3. Switch to Firefox and generate data for RBG, AFWeb, and WebGoat:
Click the Quick Launch folder in the bookmarks toolbar in Firefox.
Generate additional data, if needed in Firefox or Chrome by navigating links in the following web
sites (Optional):
RBG URLs:
o http://rbg.training.lab/ or http://172.21.10.101/
o /home.php
o /red.php, /blue.php, /green.php
o /dist_red.php, /dist_blue.php, /dist_green.php
o /media.php
AFWeb: http://afweb.training.lab or http://172.21.10.111
o Navigate any of the available links, though some will overlap with AppFw
testing.
WebGoat: http://webgoat.training.lab/WebGoat/attack or
http://172.21.10.112/WebGoat/attack
o Log on as guest / guest, if prompted.
o Click Start WebGoat.
o Navigate any of the links to generate content.
NOTE: All the bars in these tables can be used to drill down into the data.
50
7. View Web Insight Data per Application:
Navigate to Web Insight > Applications.
View the hits per application (lb vserver).
View the App performance metrics table which shows Hits, Bandwidth, and Response
Time:
51
Generate and View AppFlow Security Insight Data
Step Action
1. Switch to Chrome and return to Tab (2) for the NetScaler MAS management console at
http://192.168.10.15. Log on as nsroot / nsroot.
Depending on timing, there may or may not be any virtual servers listed in the Applications list,
just yet. It may take up to 10 minutes from when Security Insight was enabled for data to
display. If the applications are not yet displayed, continue with data generation in the next step.
3. Open Firefox and verify Application Firewall settings are in effect. For best results, test
applications in Firefox and manage NetScaler and NetScaler MAS configurations in Chrome.
Generate violations for AFWeb. The current Application Firewall profile has a mixture for block,
transform, and allowed behavior. Not all attack demonstrations will generate block violations at
this time.
Basic Navigation
Browse to http://afweb.training.lab/. (Return to the main page between tests.)
Click the Allow Demo link and verify page is successfully displayed.
Click the Deny Demo link and verify pate is blocked by application firewall.
Application Firewall Violations:
Click the Buffer Overflow 2 Demo link to generate a buffer overflow violation.
Click the SQL Injection Demo to generate a SQL Injection attack:
o Enter Select ' in the Lookup Value field.
o Click Submit.
Click Credit Card Demo to output a list of credit cards.
Manually browse to http://afweb.training.lab/private.htm.
Manually browse to http://afweb.training.lab/private2.htm.
NOTE: Many of the AppFw protections have been adjusted to allow certain behavior as part of
the Application Firewall exercises. Meaning, not all attacks in WebGoat or AFWeb will generate
the expected violations. During the NetScaler MAS demonstration of Security Insight, the attacks
generated will be limited.
52
4. Generate some violations for WebGoat:
Access WebGoat:
Browse to http://webgoat.training.lab/WebGoat/attack.
Log on as guest / guest.
Click Start WebGoat on the main page.
Return to the /WebGoat/attack page between tests.
Basic Attack 1: Parameter Manipulation / Start URL Violations:
Navigate to Admin Functions > Report Card. This page should load successfully using
the following URL:
http://webgoat.training.lab/WebGoat/attack?Screen=XXXX
&menu=XXXX
Adjust the URL you are currently on and append the following query parameter to the
current URL:
&admin=true
The final URL will look like the following thought the Scree and Menu parameters will
change.
http://webgoat.training.lab/WebGoat/attack?Screen=XXXX
&menu=XXXX&admin=true
This modified URL should generate a violation and an Application Firewall custom
output page.
5. Return to Tab (2) in Chrome for the NetScaler MAS management console at
http://192.168.10.15. Log on as nsroot / nsroot.
53
7. View the Applications in the summary page:
Verify lb_vsrv_webgoat and lb_vsrv_afweb are listed.
Identify the threat index and safety index for both applications.
NOTE: A full review of insight data and reports is not included in the NetScaler MAS training as it
was discussed in the NetScaler Insight training. This exercise was to demonstrate that NetScaler
MAS can handle the NetScaler Insight AppFlow data integration.
54
10. View details for lb_vsrv_afweb:
Click on lb_vsrv_afweb.
View the Threat Index (tab) for AFWeb
o Note that you can view the details of the violations reported.
View the Safety Index (tab) for AFWeb.
o Under Safety Index, view the Application Firewall Configuration summary
which also shows the profile settings in effect.
o Click on NetScaler System Security to review configuration recommendations
that are not yet implemented.
11. NetScaler Web Insight and NetScaler MAS will remain enabled for later exercises.
Keep the Web Insight settings in effect.
12. Switch to the NetScaler Configuration Utility open in Tab (1) using the NSIP at
http://192.168.10.101. Log on as nsroot / nsroot.
13. Disable the Application Firewall feature to prevent interference with later exercises.
Navigate to System > Settings.
Click Configure Basic Features.
Disable (uncheck) Application Firewall. (Keep existing features as is.)
Click OK.
Takeaways:
Web Insight provides web site performance data including client load times, bandwidth, latency, and
server performance times.
Security Insight uses AppFlow to report Application Firewall violations and statistics to NetScaler Insight
Center. It includes reporting for Application Firewall security check violations, signature violations, and IP
Reputation.
NetScaler MAS integrates NetScaler Insight with the MAS framework. As a result, NetScaler MAS can be
used as the AppFlow collector and a separate analytics systems is not required.
55
Module 4: NetScaler Web Server Logging (NSWL)
Overview:
In this module, you will configure NetScaler Web Server Logging (NSWL) to log web transaction details to a web
transaction client. The NSWL feature allows NetScaler administrators to generate and track web transaction logs
for web content served by the NetScaler either in place of gathering web transaction logs from the web servers
behind the NetScaler or in addition to the regular web transaction logs. The web transaction logs record client IP
addresses, web requests, response codes returned, server IP addresses where the content was fulfilled and other
transaction details. These logs are often used by NetScaler and/or web server administrators to audit requests
from users, verify responses returned, or used to identify certain types of issues during troubleshooting. Since web
transaction logs are not generated natively by the NetScaler, the NSWL client is deployed to write the content to
file on behalf of the NetScaler.
56
Exercise 4-1: Configuring NSWL
In this exercise, you will configure NetScaler Web Server Logging using the NSWL client and customize logging
output for RBG, AFWeb, WebGoat, and NetScaler Configuration Utility applications.
The NSWL web client is managed through a set of settings in a configuration file that determines the applications
to generate logs for and the log output formats and locations. This exercise will demonstrate multiple
configuration options that affects the logging output.
Configure NSWL
Configure logging with default and custom filters
Install and Configure NSWL as a Service
Click OK.
57
5. Open an elevated CMD Prompt to run NSWL commands during this exercise.:
Open an elevated CMD Prompt on the Student Desktop. Use the CMD prompt pinned to
the taskbar.
Run the following CMD to change the working directory:
cd c:\nswl\LOGS\
Keep this window open during this exercise. If this CMD prompt is closed, don't forget to change
directory to the correct working directory before continuing.
Keep an instance of Windows Explorer open that can be used to browse the necessary
directories. The log.conf file will be edited in Notepad++ as well.
NOTE: By manipulating the working directory when calling the nswl executable, you can
manipulate the output file locations for debug logs and transaction logs. This will be
demonstrated in later exercises.
58
9. Use the addns command to configure the list of NetScalers to manage:
Run the following commands to add NetScaler and credentials to the log.conf file:
c:\nswl\bin\nswl.exe -addns -f c:\nswl\etc\log.conf
Note: NSWL requires the use of the nsroot account. Alternate superuser accounts are not valid.
NSWL must also use the NSIP of the NetScaler instead of a management enabled SNIP. To
monitor traffic in an HA pair, configure both NSIP addresses in the same NSWL client.
11. Return to the CMD prompt. Run NSWL with the default log output settings:
Run the following command to run NSWL:
c:\nswl\bin\nswl.exe -start -f c:\nswl\etc\log.conf
12. Switch to Firefox and browse to the following URLs to generate web log content:
59
14. View web transaction log output:
Return to Windows Explorer and browse the C:\nswl\LOGS\ directory.
Select the file named Exyymmdd.log. The log file is named after the date in yymmdd
format. If the nswl command has been run more than once, the newest file will have a
number appended to the end: Ex######.log.0, Ex######.log.1, etc….
Open the file with Notepad (if prompted).
Notice that web transaction logs for the RBG, AFWeb, and WebGoat applications are displayed.
Content may also appear for the NetScaler NSIP (192.168.10.101) and will contain paths starting
with /nitro/v1/stat/, if the NetScaler Configuration Utility is still running in a web browser.
This output is in the default W3C format using the standard output parameters, using the default
output file naming convention and path.
The debug log was captured with debug level 1 and includes minimum messaging.
Notice that the debug log output is more verbose than the default logging level of 1. If the debug
flag is not supplied when running nswl, then logging level 1 is assumed.
60
18. Cleanup the current unnecessary windows:
Close the notepad windows with previous debug and transaction logs.
19. Switch to Windows Explorer and archive the previous log files:
Copy all logs in the C:\nswl\LOGS\ directory to C:\nswl\ARCHIVE\.
Add the following Filter declarations to the log.conf file (above the default filter):
Filter F1 HOST rbg.training.lab 172.21.10.101 IP 172.21.10.101 ON
Filter F2 IP 172.21.10.111 ON
Filter F3 IP 192.168.10.101 ON
Filter default
Create a filter definition block for rbg (Note: It is easier if you copy the begin default…end
default block and update settings.) Insert the new block after the Filter declarations and before
the begin default…end default block.
begin F2
logFormat NCSA
logInterval Hourly
logFileSizeLimit 10
logFilenameFormat \nswl\LOGS\afweb_%{%y%m%d}t.log
logExclude .jpg .gif .ico .png
end F2
61
4. Add the F3 Filter definition to the log.conf file:
begin F3
logFormat W3C
logInterval hourly
logFileSizeLimit 10
logFilenameFormat \nswl\LOGS\NSGUI\nsip_%{%y%m%d}t.log
end F3
Verify that the an output message stating log.conf is correct and Done !! is received.
NOTE: In some cases excessive the verify command cannot identify all syntax errors, but it
provides a minimal test case. If issues occur when running the conf file either rever to the copy
of the default file and try testing one filter declaration/definition at a time until the issue is
resolved. Don't forget to reconfigure the conf file with the NSIP and credentials using the addns
command.
62
8. Run nswl with the new conf file:
Run the following command to start logging:
c:\nswl\bin\nswl.exe -start -f c:\nswl\etc\log.conf
Open Firefox:
Click the Quick Launch folder in the Bookmarks Toolbar and click Open All in tabs. This
will launch content against RBG FQDN, RBG VIP, AFWeb, and WebGoat in one step.
o If prompted to authenticate to WebGoat, log on as guest / guest and click
Start WebGoat.
To generate additional requests, right-click on any Tab and click Reload All Tabs.
NOTE:
The working directory controls the output of the DEBUG log files and they should
appear in C:\nswl\DEBUG\ at the end of this demonstration.
The paths specific for the transaction logs in the filter definitions determine the
transaction log output paths which should be in C:\nswl\LOGS\ or in its subdirectories.
For best results, avoid output paths with spaces in the name.
63
10. View web transaction logs:
Browse to C:\nswl\LOGS\.
Verify log file for rbg_<date>.log and afweb_<date>.log are present. This will contain
the transaction logs for these specific applications only.
The Ex<date>.log is generated by the default filter and will contain WebGoat and all
other unmatched traffic.
The NSGUI director contains the logs for the NetScaler GUI.
Select any of the transaction logs and view the output. Note the following:
The RBG transaction log should contain content the lb vserver whether users connected
by name or VIP. This output is in W3C format.
The AFWeb log is capturing output in NCSA format but all image content was excluded
for .jpeg, .gif, .png, and .ico extensions.
12. Switch to Windows Explorer and archive the previous log files:
Delete all logs in the C:\nswl\LOGS\ directory.
Delete all logs in the C:\nswl\DEBUG\ directory.
64
Complete filter definition for the custom log.conf file in the above example:
begin F1
logFormat W3C
logInterval Hourly
logFileSizeLimit 10
logFilenameFormat \nswl\LOGS\rbg_%{%y%m%d}t.log
logTime GMT
end F1
begin F2
logFormat NCSA
logInterval Hourly
logFileSizeLimit 10
logFilenameFormat \nswl\LOGS\afweb_%{%y%m%d}t.log
logExclude .jpg .gif .ico .png
end F2
begin F3
logFormat W3C
logInterval hourly
logFileSizeLimit 10
logFilenameFormat \nswl\LOGS\NSGUI\nsip_%{%y%m%d}t.log
end F3
begin default
logFormat W3C
logInterval Hourly
logFileSizeLimit 10
logFilenameFormat \nswl\LOGS\Ex%{%y%m%d}t.log
end default
65
Configure NSWL and Run as a Service
Step Action
1. Return to the CMD prompt running NSWL.
Verify a confirmation message stating NetScaler Weblogging Service installed with a Done !!
message is returned.
NOTE:
The NetScaler Weblogging Service can be started and stopped via the Services.msc
console like any other Windows service or it can be started and stopped using the
nswl.exe command, which will be demonstrated.
For lab purposes. we do not want the service running non-stop so recovery will not be
configured at this time.
NOTE:
Installing nswl as a service requires that the path to the log.conf file is supplied at the
time of install.
The command parameter in the registry key is slightly different than the command used
running manually from the command line.
66
6. View Debug Logs and output locations:
Open Windows Explorer and browse to C:\nswl\DEBUG\.
o No new debug logs are created in this directory.
Browse to C:\windows\system32\.
o Look for a log file named nswl.log-<datetime> in this directory.
o Windows services use C:\windows\system32\ as the working directory and
there is no method to control the debug log output directory.
Takeaways:
NSWL allows administrators to generate web transaction logs from the web content served by the
NetScaler.
o NSWL logs generated on the NetScaler are generally the same type of web transaction logs that
can be collected from the web servers behind the NetScaler. However, the NetScaler web
transaction logs will include logging for any cached content served by the NetScaler.
o If original client IP addresses are required in web transaction logs collected at the web servers
behind the NetScaler, remember to enable some form of client IP address header insertion on
the NetScaler, so original source IPs can be passed to the web servers behind the NetScaler.
Web Logging is enabled by default; only a NSWL client is required to retrieve the log content.
For NetScaler systems in an HA pair, both members of the pair should point to the same NSWL client to
ensure no gaps in logs regardless of which NetScaler is primary in the pair.
NSWL logging must be configured using the NetScaler NSIP and the nsroot account.
67
Module 5: Integrated Caching
Overview: Dynamic caching evaluates HTTP requests and responses
based on parameter-value pairs, strings, string patterns, or other data
In this module, you will perform hands-on exercises that will demonstrate the configuration of Integrated Caching
and the impact of those settings on web site performance. Adding integrated caching to existing traffic
management virtual servers (such as load balancing and content switching) provides an additional performance
benefit for application delivery using the NetScaler and reduces load on backend servers.
68
Exercise 5-1: Integrated Caching
In this exercise, you will configure integrated caching for the RBG web application. This exercise demonstrate basic
caching configuration using policies and content groups for static caching; caching based on dynamic content using
parameterized caching or cache selectors is not included in this exercise.
Enable caching for RBG content by using policies to identify static and image-based content.
Manage content group settings for each content type.
o Ensure static content expires every 300 seconds.
o Ensure image content expires every 600 seconds.
Use requests to /red.php to generate an Invalidation action for both content groups.
View website performance and cache-control headers before and after caching is in effect.
In this exercise, you will perform the following tasks:
69
3. Adjust Firebug display options:
In the Firebug Console (pane), Click Net.
Click All.
If you want to compare stats to previous tests, also click Persist. (Click again to remove
the setting.). To clear display, click Clear.
Firebug with Net > All console. (Persist disabled) Displays current requests only.
Firebug with Net > All console. (Persist enabled). Displays current request and previous requests.
70
4. View RBG page performance in the Firebug Console:
In Firefox on Tab (1), browse to http://rbg.training.lab/blue.php.
o Note the total time to load the page and all objects as displayed in Firebug.
Next browse to http://rbg.training.lab/media.php.
o Note the total time to load the page and all objects as displayed in Firebug.
Next, click the download button to download a really, large PNG.
o Note the total time to download and display the PNG.
o Also note the size of the media_main.png file.
Keep the RBG website in Tab (1) in Firefox and keep the Firebug console active. (If it closes, re-
open it.)
Connect to the NetScaler configuration utility for NS_VPX_01 using the NSIP at
http://192.168.10.101. (Use Chrome for NetScaler Configuration Utility connections.)
Click OK.
Click OK.
71
4. Configuring global Integrated Caching Parameters:
Navigate to Optimization > Integrated Caching.
Click Change Cache Settings in the right-pane.
Click OK.
Click Create.
Deselect (uncheck) the cache_cg_rbg_images content group in the list pane.
NOTE: Content Group settings can be tuned based on the application and the content being
cached. Content in different groups can be handled differently.
72
6. Next create a Content Group for RBG Static content:
Click Add.
Enter cache_cg_rbg_static in the Name field.
Click Create.
73
9. Create a cache policy (1) to CACHE image content to the cache_cg_rbg_images content group:
Navigate to Optimization > Integrated Caching > Policies.
Click Add.
Click Create.
10. Create a cache policy (2) to CACHE static web content to the cache_cg_rbg_static content group:
Click Add.
Click Create.
11. Create a cache policy (3) to INVALIDATE all cached content for RBG when requests are sent to
/red.php:
Click Add.
Click Create.
74
12. Create a cache policy (4) to NOT CACHE other content for RBG.
Click Add.
Click Create.
13. Use Policy Manager to bind the policies to the RBG lb vServer. Select the bind point:
Click Policy Manager.
Select Load Balancing Virtual Server under Bind Point.
Select Request under Connection Type.
Select lb_vsrv_rbg under Virtual Server.
Click Continue.
Click Bind.
Click Bind.
16. Bind the cache policy (3) to invalidate content. This policy must be bound with a higher priority
than the other two policies:
Click Add Binding to bind another policy to this bind point:
Click Click to Select under Select Policy.
Change the items per page to show 50 (or more) to see all available policies.
Select cache_pol_doInval_onRed and click Select.
Enter 10 in the Priority field.
Click Bind.
75
17. Bind the cache policy (4) to not cache other objects. This policy must be bound with a lower
priority than the other policies:
Click Add Binding to bind another policy to this bind point:
Click Click to Select under Select Policy.
Change the items per page to show 50 (or more) to see all available policies.
Select cache_pol_doNoCache and click Select.
Enter 200 in the Priority field.
Click Bind.
Test Caching
Step Action
1. View initial cache objects on the NetScaler before testing content:
Navigate to Optimization > Integrated Caching.
Click View Cache Objects.
Select All and click Continue.
Verify no objects are currently cached.
Click Done.
76
4. In Tab (1), test the following content:
Browse to http://rbg.training.lab/blue.php.
Refresh the page a few times.
Switch to Tab (2) and determine which content objects in the /blue.php request were served
from Cache.
Identify which responses contain a VIA header indicating content was served from
cache by the NetScaler. Responses without a VIA header were served by the web
server.
Objects such as: /blue_top.jpg, /defaultstyles.css, and other extensions matching the
imagestuff and staticstuff policies should be cached.
Objects such as: /common.js and the .php pages are not cached.
5. Switch to Chrome and return to the Integrated Caching Statistics view in the NetScaler
Configuration Utility:
The statistics page should still be displayed. If not, Navigate to Optimization >
Integrated Caching and then click Statistics in the right-pane.
View the Cache Stats so far. Take note of the following stats:
o Hits
o Misses
o Requests
o Hit Ratio (%)
o Origin Bandwidth Saved
o Cached Objects
77
9. Return to Firefox, in Tab (1) and test the following content:
Browse to http://rbg.training.lab/media.php.
o Refresh the page a few times.
Next, click the download button to download a really, large PNG.
o Note the total time to download and display the PNG. (This is the first
download and it is served from the server and not from cache).
o Live HTTP Headers can be used to confirm the object was not cached yet. Look
for /media_main.png.
Return to http://rbg.training.lab/media.php and click Download again.
o This time the object should complete much faster.
o Use Live HTTP Headers and verify /media_main.php was served from cache
this time.
10. Switch to Chrome and return to the Integrated Caching Statistics view in the NetScaler
Configuration Utility:
The statistics page should still be displayed. If not, Navigate to Optimization >
Integrated Caching and then click Statistics in the right-pane.
View the Cache Stats so far. Take note of the following stats:
o Hits
o Misses
o Requests
o Hit Ratio (%)
o Origin Bandwidth Saved
o Cached Objects
The size of the media_main.png is taking up the bulk of the memory in use.
13. Return to Firefox, in Tab (1) and test the following content:
Browse to http://rbg.training.lab/red.php.
This will invalidate objects in the affected content groups. This expires cached content.
78
14. Re-retrieve the media_main.png file from /media.php:
Browse to http://rbg.training.lab/media.php.
o Refresh the page a few times.
Next, click the download button to download a really, large PNG.
o Since the content was invalidated, it should take longer to download this time
until the object is refreshed in cache.
Keep the integrated caching feature enabled for the next exercise with FEO.
Takeaways:
Integrated Caching should be configured prior to enabling the feature. Existing policies are already
present on the NetScaler which will result in automatically cached content once the feature is enabled.
Care should be taken to create necessary policies to prevent caching for content for which it is not
wanted.
Memory must be allocated for use by the integrated caching feature.
Cache content groups control cache retention and expiration settings and therefore can be configured
with content-specific settings for different content types and content groups.
79
Module 6: Front End Optimization (FEO)
Overview:
In this module, you will perform hands-on exercises that will demonstrate the configuration of Front End
Optimization features and their impact on web content performance. FEO provides optimizations for JavaScript,
CSS, and image-rich content that can impact browser-level performance by reducing page load and page render
times.
Enable and configure FEO policies to apply custom optimizations to a web application.
Review modifications made to content by reviewing headers and browser response and load times for
optimized content.
This module contains the following exercises using the NetScaler Configuration Utility GUI:
80
Exercise 6-1: Front End Optimizations
In this exercise, you will configure custom a custom FEO action and policy to apply optimizations to the FEO
demonstration page hosted on the AFWeb web server. As different optimizations for CSS and Image content are
applied, the effects of the optimizations will be observed using browser-based tools.
Enable FEO with basic CSS optimizations and observe impact of Combine CSS, Convert Imported CSS to
links, and Minify optimizations.
Update CSS optimizations and observe impact of Inline image and Move to head options on multiple
linked stylesheets.
Enable FEO with image optimizations and observe impact of Shrink to attributes, Make inline, optimize,
and convert GIF to PNG.
Update FEO optimizations to include LazyLoad options and observe impact on large, content-rich page
load times and performance.
In this exercise, you will perform the following tasks:
Note: The AppFlow settings in the lab will interfere with CSS optimizations that we are
attempting to test. There is no problem using both features in a production environment.
81
3. Close all existing instances of Firefox and re-open a new window.
In Tab (1), open Firebug: Tools > Web developer > Firebug > Open Firebug. (Or use
F12). Firebug should open in the right pane. Maximize the browser for best effect.
Browse in Tab (1) to http://afweb.training.lab/feo1.htm.
Scroll down to view the page content.
Note that there are many images of different image size and quality
Take note of the following in Firebug:
How much data was loaded by all objects in the page.
The load time for all objects in the page.
Note: The NetScaler may have trouble delivering all content on the un-optimized site as the lab
NetScalers have an artificially low bandwidth cap of 1 Mbps.
5. Keep the content in Firefox Tab (1) and Tab (2) open until further notice.
Enable FEO:
Navigate to System > Settings.
Click Configure Advanced Features.
Enable (check) Front End Optimization.
Click OK.
82
3. Clear existing cache objects:
Navigate to Optimization > Integrated Caching.
Click View Cache Objects.
Select All and click Continue.
Select all objects (if present) and click Flush. Click Yes to confirm.
Click Done.
Click OK.
NOTE:
A few of the stylesheets in the demonstration are 2KB in size. Therefore some of the
inline optimizations will not be applied, with the default limit of 1024 Bytes.
Click Create.
83
7. Bind the policy to the AFWeb load balancing virtual server:
Click Policy Manager.
Select Load Balancing Virtual Server under Bind Point.
Select Request under Connection Type.
Select lb_vsrv_afweb under Virtual Sever.
Click Continue.
The following changes should be observed in the Page Source under the FEODEMO: Styles 1 and
Styles 2 comments.
The stylesheet linked to the content were modified and moved to the end of the
<HEAD> section. They now appear below the Styles 2 demo.
The imported stylesheets were converted to links and combined into one line.
84
11. Update the FEO policy action with additional settings:
Navigate to Optimization > Front End Optimization > Actions.
Select feo_act_custom and click Edit.
Click OK.
85
15. Switch to Tab (5) and view the image optimizations:
Scroll down through the page and view the image content.
Notice that all images in page content have already loaded.
Click OK.
NOTE: This time the page load time is much faster due to a combination of caching and lazy
load. Images in non-displayed parts of the pages are not downloaded unless needed. You will
see the timeline in Firebug include additional requests as you scroll down.
The file size for all objects loaded in this request starts out significantly smaller but will increase
as additional objects are retrieved. Take note of both values.
20. Scroll down the page and notice how page objects are loaded only when needed. The output in
Firebug will indicate additional object requests.
86
21. View the Page Source:
Right-click the gray background in the /feo1.htm page and click View Page Source.
Keep this in Tab (6) for future reference.
If necessary, compare to the previous optimizations in Tab (4).
22. Close Firefox (when done reviewing output and page source for all tabs).
Disable FEO:
Navigate to System > Settings.
Click Configure Advanced Features.
Disable (uncheck) Front End Optimization.
Click OK.
Takeaways:
FEO requires that the Integrated Caching feature is also enabled, as FEO optimized content is stored in a
cache content group to allow the NetScaler to apply optimizations or rewrites.
FEO global parameters control the size of CSS, images, and JavaScript content that can be optimized.
Several pre-defined FEO policies and actions are already defined on the NetScaler to achieve pre-
configured optimizations for specific content types. Additional custom policies and actions can be defined
as required.
87
Module 7: Tuning and Optimizations
Overview:
In this module, you will perform hands-on exercises for configuring and tuning the NetScaler appliance. The focus
of these exercises are to reinforce the use of HTTP, TCP, and SSL profiles to manage tuning, optimization, and
security settings per application as opposed to limiting settings to globally managed parameters. While not all
optimization settings are appropriate for all environments, the settings highlighted as part of the exercise are
generally useful for a broad range of scenarios. The profiles can then be used to specify application specific settings
when needed.
Configure and use profiles to manage HTTP, TCP, and SSL settings per virtual server or service/service
group and override default or global settings.
Configure and use Network Profiles to assign IP Addresses to virtual servers, services, or monitors to
manage NetScaler to server communications.
Update the SSL certificates used by the NetScaler for its own services
This module contains the following exercises using the NetScaler Configuration Utility GUI:
88
Exercise 7-1: NetScaler MAS Configuration Advice
In this exercise, you will use the NetScaler MAS Configuration Advice utility to review the NetScaler system's
current configuration and to generate a list of configuration changes based on security, optimizations, and known
best practices. The configuration advice settings will be reviewed along with the methods available to deploy the
settings. However, settings will not be applied using NetScaler MAS at this time; instead, key settings
recommended by MAS will be applied in later exercises demonstrating the use of HTTP, TCP, SSL, and network
profiles.
Use the NetScaler MAS configuration advice utility to provide a list of configuration recommendations for
the NetScaler's current configuration state.
Review the list of recommendations for possible security and optimization settings still needed.
Identify how to use the configuration advice utility to generate configuration commands to apply to a
managed NetScaler.
In this exercise, you will perform the following tasks:
89
5. Use the MAS configuration advice feature to review the NetScaler's current configuration:
Click Infrastructure tab.
Navigate to Configuration Audit > Configuration Advice.
Select Select Device.
Verify 192.168.10.101 (NS_VPX_01 NSIP) is selected in the drop-down list.
Click Get Configuration.
Verify a list of recommendations are displayed. The list will include approximately 50
recommendations depending on exact state of the current NetScaler configuration. Due to the
lab dependencies, DO NOT apply all recommendations as is.
90
8. Review configuration advice recommendations by specific category.
Select PCI Compliance v3.0 under the Filter By: Category drop-down list.
Recommendations include recommendations for Application Firewall settings and the use of
end-to-end SSL (over SSL Offload or HTTP only virtual servers). This particular NetScaler
configuration has existing Application Firewall profiles and policies applied to certain virtual
servers, but some security checks have been modified to transform instead of block. The level of
the Application Firewall profile configuration will affect the specific list of recommendations.
The Configuration Advice output is used to highlight areas of possible configuration changes
needed and to generate commands to apply those changes.
Check Please make sure SQL Injection Protection is enabled.
Check Please enable XPath injection protection.
Verify preview commands are displayed.
Generate command output:
Click the Generate Configuration button (next to Commands Selected). See screenshot
below.
Notice that you can use the configuration advice interface to construct commands and
either download a configuration file or Apply Now to managed NetScalers. DO NOT
apply commands.
Click Download File.
Save corrective_command.conf to C:\resources\ and click Save.
Do not apply the commands.
91
9. Review configuration advice recommendations by specific category.
Select Best Practices under the Filter By: Category drop-down list.
Notice that these recommendations address various network and http settings affecting the
NetScaler. The recommendations include Windows Scaling, Nagle's Algorithm, Drop invalid HTTP
requests, SNMP Alarm recommendations, and Cookie Version (if still set to Version 0).
Instead of using MAS to push these settings to the NetScaler. The next exercise will use HTTP
and TCP profiles to manage some of the applicable settings.
Takeaways:
NetScaler MAS can generate a list of recommended configurations based on the current configuration of a
managed NetScaler. Settings identify key requirements for security, system, optimization, and best
practices.
NetScaler MAS configuration advice can also be used to generate a configuration file to apply select
recommendations or it can be used to directly apply commands to managed NetScalers.
92
Exercise 7-2: Configuring TCP/HTTP/SSL Profiles
In this exercise, you will use TCP, HTTP, and SSL profiles to apply specific optimization and tuning settings to
individual virtual servers, in order to override global settings on the NetScaler. The TCP and HTTP profiles provide
granular control of TCP and HTTP parameters that can be used to tune settings per virtual server and/or service to
meet application specific requirements for WAN or LAN networks. The profiles can be used to override global
parameters and provide the ability to manage additional settings not handled by the global parameters.
Please note that the settings in use in this exercise, are generally recommended optimizations for most NetScaler
deployments. However, there may be some exceptions. Please review specific settings for applicability before
deploying in production. Not all settings are suitable for all environments.
The NetScaler has several built-in profiles that are already tuned for specific traffic types and LAN or WAN network
conditions. These existing profiles should be reviewed and used where applicable. Custom profiles can be created
as needed.
93
2. Create a new TCP Profile with some basic optimizations and tuning settings for use:
Navigate to System > Profiles.
Click TCP Profiles tab.
Click Add.
Enter tcp_prof_custom1 in the Name field.
Configure settings for the following fields listed. Keep defaults for unspecified fields:
Enable (check) Windows Scaling.
o Keep default Window Scaling Factor at 4.
o Window Scaling must be tuned for your network and traffic type.
Verify TCP Flavor is set to Default. (This is used to set specific TCP congestion algorithm
to use.)
Enable (check) Selective Acknowledgement.
Enable (check) Use Nagle's Algorithm.
Click Create.
NOTE: These settings will typically work for web traffic (and ICA traffic) in most situations, but
are not universally applicable in all situations. The profiles can be used to override global TCP
parameters and additional settings that cannot be managed at the global parameter level.
3. Create a custom HTTP profile with some basic optimization settings for use:
Click HTTP Profiles tab.
Click Add.
Enter http_prof_custom1 in the Name field.
Configure settings for the following fields listed. Keep defaults for unspecified fields:
Enable (check) Drop invalid HTTP requests.
Enable (check) Mark HTTP/0.9 requests as invalid.
Enable (check) Mark CONNECT requests as invalid.
Click Create.
NOTE:
Additional settings of note not tuned in this profile, include:
Client IP Header Expression which can be used to identify HEADER with client IP address
so the NetScaler can extract the source IP. Such as an x-forwarded-for request arriving
at the NetScaler
SPDY Protocol support, which will be demonstrated in a later exercise.
HTTP/2 connection support (HTTP 2.0 vs. 1.0 and 1.1 connection support), which will be
demonstrated in a later exercise.
94
4. Create a custom SSL Profile to disable SSLv3:
Click SSL Profile tab.
Click Add.
Enter ssl_prof_custom1 in the Name field.
Click OK and click Done to create a profile with the default settings.
5. Update the HTTP and SSL load balancing virtual servers for WebGoat:
Navigate to Traffic Management > Load Balancing > Virtual Servers.
6. Apply TCP and HTTP Profiles to the HTTP virtual server for WebGoat:
Select (check) lb_vsrv_webgoat and click Edit.
Click Profiles under the Advanced Settings to add it to the configuration pane.
Select tcp_prof_custom1 from the TCP Profile drop-down list.
Select http_prof_custom1 from the HTTP Profile drop-down list.
Click OK under Profiles to apply settings.
7. Apply TCP and HTTP Profiles to the SSL virtual server for WebGoat:
Select (check) lb_vsrv_webgoat_ssl and click Edit.
Click Profiles under the Advanced Settings to add it to the configuration pane.
Select tcp_prof_custom1 from the TCP Profile drop-down list.
Select http_prof_custom1 from the HTTP Profile drop-down list.
Click OK under Profiles to apply settings.
Apply the SSL Profile to the SSL Virtual Server for WebGoat:
Click SSL Profile under the Advanced Settings to add it to the configuration pane.
Select ssl_prof_custom1 from the SSL Profile drop-down list.
Click OK under SSL Profile to apply settings.
95
8. Close all existing instances of Firefox and re-open a new window.
In Tab (1), Browse in Tab (1) to https://webgoat.training.lab/WebGoat/attack.
(NOTE: Use SSL and no trailing "/" in the URL after "attack".)
Enable browser to proceed to web page despite the untrusted certificate.
Enter guest / guest if prompted for credentials.
Click Start WebGoat.
NOTE: When you browse please : no trailing "/" . If you browse to /WebGoat/attack/ it will
create a security violation.
For Reference:
HTTP/2 or SPDY in use:
96
Response Headers
NOTE: Standalone SPDY protocol support is largely deprecated in newer browsers and replaced
with HTTP/2 protocol support. Enable SPDY for legacy browsers that cannot handle HTTP/2
connections.
97
13. Close all existing instances of Firefox and re-open a new window.
In Tab (1), Browse in Tab (1) to https://webgoat.training.lab/WebGoat/attack. (NOTE: Use
SSL.)
Enter guest / guest if prompted for credentials.
Click Start WebGoat.
14. Alternate method to confirm HTTP version in use using the Firefox native Web Developer (not
the Add-on Web Developer Extension):
Return to Tab (1).
Click Tools > Web Developer > Network.
Browse to https://webgoat.training.lab/WebGoat/attack again.
Takeaways:
HTTP and TCP profiles can be applied to virtual servers or service/service groups.
o Profiles override global settings.
o Virtual server settings manage client-side connections and service/service group profiles manage
server-side connections.
98
o If no service-side profiles are specified, virtual server profiles are in use.
o If no virtual server profiles are specified, global parameters are used.
SSL Profiles provide granular control of SSL parameters and can be applied to virtual server or
service/service groups as needed.
99
Exercise 7-3: Configuring Network Profiles
In this exercise, you will use Network profiles to assign unique IP addresses for NetScaler traffic for a specific
virtual server in order to separate its traffic from the default SNIP that is assigned. To demonstrate the use of net
profiles to assign IP addresses, one net profile will be assigned to a load balancing virtual server and a second net
profile will be assigned for use with service monitors.
A network trace will be generated using the nstrace command and the results viewed to confirm which source IP
addresses are assigned for NetScaler-to-server communication.
Traffic for AFWeb, WebGoat, and any other non-specified traffic on the NetScaler should continue using
the default SNIP.
Application traffic for the RBG virtual server will be assigned a unique IP address for NetScaler-to-server
communication using 192.168.10.104.
Monitor traffic for the RBG services will be assigned a unique IP address for NetScaler-to-server
communication using 192.168.10.105.
Confirm the results with a network trace.
In this exercise, you will perform the following tasks:
Create and bind two Net Profiles for each of the custom IP Addresses.
Generate a network trace to verify the configuration.
100
2. Create additional VIPs on the NetScaler:
Navigate to System > Network > IPs.
Click Add.
Add new VIP (1):
Enter 192.168.10.104 in the IP Address field.
Enter 255.255.255.255 in the Netmask field.
Select Virtual IP in the IP Type field.
Disable (uncheck) Enable Management Access control. Click Yes to confirm.
Click Create.
Add new VIP(2):
Enter 192.168.10.105 in the IP Address field.
Enter 255.255.255.255 in the Netmask field.
Select Virtual IP in the IP Type field.
Disable (uncheck) Enable Access Management control. Click Yes to confirm.
Click Create.
Click OK.
Click OK and click Done.
101
6. Bind monitor to svc_red:
Navigate to Traffic Management > Load Balancing > Services.
Select (check) svc_red and click Edit.
Click Service to Load Balancing Monitor Binding under Monitors.
Click Add Binding.
Click Click to Select under Select Monitor.
Select mon_rbg_http and click Select.
Click Bind and click Close.
Click Done.
7. Bind the Net Profile to the RBG load balancing virtual server:
Navigate to Traffic Management > Load Balancing > Virtual Servers.
Select lb_vsrv_rbg and click Edit.
Click Profiles under the Advanced Settings to add the category to the configuration
area.
Select net_prof_rbgweb_from104 under Net Profile.
Click OK under the Profiles category.
Click Done.
102
1. Connect to the NetScaler configuration utility for NS_VPX_01 using the NSIP at
http://192.168.10.101. (Use Chrome for NetScaler Configuration Utility connections.)
This expression is intended to capture any traffic using the SNIP or the VIPs associated with the
net profiles regardless of whether the IP address is in the source or destination header of the
packet.
NOTE: When configuring the Expression in the Filter Expression field, ensure there are NO
SPACES between the rules and the OR operator ("||"). While other advanced expressions can
include spaces, the Trace screen treats this as an expression syntax error and will generate an
error when starting the trace.
103
4. Return to the NetScaler configuration Utility in Chrome.
Click Stop and Download to stop trace.
Download trace to Student Desktop:
Select (check) nstrace1.pcap and click Download.
Save trace file to C:\resources\ as nstrace1.pcap.
Click Save.
Click the file nstrace1.pcap from Chrome's download files bar (at bottom of browser)
and click Open.
Click Close.
The trace file should automatically open in Wireshark. Skip any prompts asking you to check for
updates or to update Wireshark.
NOTE:
If you run the nstrace multiple times, the NetScaler will generate the trace in a unique
date/timestamped folder in /var/nstrace/ each time. The file will keep the same name
unless you adjust additional settings when configuring the trace. However, the file will
not overwrite previous traces as it is in its own unique folder.
If you save the nstrace file locally, be sure to increment the name or else you could
overwrite a previously downloaded file also named nstrace1.pcap.
Results:
SNIP 192.168.10.111 is used for all other SNIP functions on the NetScaler. Traffic will be seen
going to and from any of the following IP Addresses, depending on the traffic tested:
AFWeb Server (Monitors and Web traffic): 192.168.30.71
WebGoatA and WebGoatB Servers: 192.168.30.72-73
NetScaler MAS: 192.168.10.15
Command Center: 192.168.10.13
There should be no communication to 192.168.10.111 for the following:
RBG Servers: 192.168.30.51-53
104
6. In Wireshark, view content in Wireshark for the 192.168.10.104 IP only:
Enter the following expression in the filter bar in Wireshark. (Field contains the hint text
"Apply a Display filter…"). The field will be GREEN for correct syntax and RED for
incorrect syntax.
ip.src==192.168.10.104||ip.dst==192.168.10.104
Hit Enter to apply the new filter.
Results:
IP 192.168.10.104 is used for traffic to and from the RBG services based on traffic sent to the
load balancing virtual server (172.21.10.101) only. Traffic using the 192.168.10.104 IP represents
traffic generated by users and excludes all monitoring traffic. In the above test, the load
balancing traffic was directed to /blue.php (and related objects), whereas the monitor is probing
"/" (and related objects).
Traffic will be seen going to and from any of the following IP Addresses:
RBG Servers: 192.168.30.51-53 only
There should be no communication to 192.168.10.111 for the following:
AFWeb Server (Monitors and Web traffic): 192.168.30.71
WebGoatA and WebGoatB Servers: 192.168.30.72-73
NetScaler MAS: 192.168.10.15
Results:
IP 192.168.10.105 is used for traffic generated by the Monitors for the RBG Services only. Traffic
is now originating from the 192.168.10.105 IP instead of the 192.168.10.111 SNIP. This can also
be used to separate monitor traffic from other traffic affecting the services that originated
against the load balancing virtual server.
Traffic will be seen going to and from any of the following IP Addresses:
RBG Servers: 192.168.30.51-53 only
There should be no communication to 192.168.10.111 for the following:
AFWeb Server (Monitors and Web traffic): 192.168.30.71
WebGoatA and WebGoatB Servers: 192.168.30.72-73
NetScaler MAS: 192.168.10.15
105
8. In Wireshark, view content in Wireshark for the RED Server only at 192.168.30.15 IP only:
Enter the following expression in the filter bar in Wireshark. (Field contains the hint text
"Apply a Display filter…"). The field will be GREEN for correct syntax and RED for
incorrect syntax.
ip.src==192.168.30.51||ip.dst==192.168.30.51
Hit Enter to apply the new filter.
Results:
This filter confirms that the only traffic being sent to and from the red server (192.168.30.51) is
being sent to or from the 192.168.10.104 or 192.168.10.105 IPs. None of the RED traffic uses the
SNIP 192.168.10.111.
Traffic will be seen going to and from any of the following IP Addresses:
RBG Servers: 192.168.30.51-53 only
There should be no communication to 192.168.10.111 to or from the RED server
(192.168.30.51).
Takeaways:
Assigning specific SNIPs or VIPs to virtual servers (or services)
Network profiles (net profiles) determine which IP Address (and/or Traffic Domain) to assign to specific
traffic flows on the NetScaler.
o Net profiles are ignored if USIP mode is enabled.
o If Net profiles exist on both service/service group or virtual server, the service/service group
profile overrides the virtual server profile.
o If a profile only exits for the virtual server, then the virtual server's profile is in effect.
106
Exercise 7-4: Replacing NetScaler Default Certificates with
Trusted Certs
In this exercise, you will update and replace the NetScaler's default system certificates with trusted certificates
signed by the domain CA, to enable trusted HTTPS communication to the NetScaler Configuration Utility. This
procedure allows NetScaler administrators to incorporate certificates signed by trusted CA's with the appropriate
cipher support and bit-length keys to meet security requirements in their environments. The procedure is
relatively straight-forward, but many administrators are unfamiliar with the task.
During this exercise, the internal services that rely on the built-in ns-server-certificate certkey will be viewed, to
identify the components dependent on the certkey. The existing certkey will be kept in place, but will be updated
to point to the new certificate and private key files.
Update the SSL certificate in use by internal NetScaler services and ensure the connection to the
NetScaler configuration utility over HTTPS is trusted.
In this exercise, you will perform the following tasks:
View internal services and certificate dependencies in the NetScaler configuration utility and in the CLI.
Update the NetScaler ns-server-certificate certkey to use the new certificate files without breaking the
services dependent on the certkey.
107
2. Access the NetScaler Configuration Utility using SSL:
Update the URL in Chrome and browse to https://192.168.10.101.
NOTE: If your NetScaler has been upgraded from an older appliance prior to NetScaler 11.0 to
NetScaler 11.0 or 11.1, you may have slightly different issuer details and in some cases older
NetScalers will contain a default certificate of only 512 bits which may cause additional
certificate errors with newer browsers refusing to allow connections.
New installations of NetScaler 11.0 and later contain 2048-bit default certificates.
If you are not replacing the NetScaler's built-in certificates with your certificates signed by a
trusted CA, but you still need 2048-bit certificates for the NetScaler internal services, delete the
NetScaler's existing certificates that start with ns-.* from the /nsconfig/ssl/ directory and reboot.
The NetScaler will regenerate these certificates with the 2048-bit default certificates as if it was
a new 11.x installation.
Notice that the internal services for nsrpcs, nshttps, nskrpcs, and the nsrnatsip all use SSL and
have a certkey bound.
108
5. Open a Putty session to 192.168.10.101:
To open putty: Right click on Start > Run > putty 192.168.10.101.
Log on as nsroot / nsroot.
Run the following commands to view the internal services with full names:
show service -internal -summary -fullValues
Notice that certificate details are not included in the show service command.
6. View the details of the certificates in use for the following services:
show ssl service nshttps-127.0.0.1-443
109
11. Apply a new certificate to the NetScaler certkey:
Navigate to Traffic Management > SSL > Certificates > Server Certificates.
Select (check) ns-server-certificate and click Update.
Enable (check) Update the certificate and key.
Enable (check) No Domain Check (at bottom).
Click OK to attempt to apply changes. The NetScaler will then prompt for the Password for the
private key.
Enter Password1 in the Password field when prompted.
Click OK.
Verify the Issuer Name now displays as "training-AD-CA" for the ns-server-certificate certkey.
Takeaways:
SSL certkeys on the NetScalers are objects that act as pointers to the certificate and private key files on
the file system. Virtual servers and services point to the certkey object and not the files directly; the
certkey object identifies the specific files in use.
Updating certificates then is a matter of just updating the certificate and private key files referenced by
the certkey; all objects referencing a specific certkey do not need to be updated.
Internal services on the NetScaler which are used for NetScaler management and NetScaler system
communication such HA Synchronization, HA Propagation, GSLB, and clustering, rely on the ns-server-
certificate. Therefore, all that is needed to change the certificate in use by internal services to a cert
signed by a trusted CA or to update the key bit-length in use is to update the files referenced by the ns-
server-certificate certkey object. No changes to certkey-service bindings are required.
110
Appendix A: Transition to Part 2
Overview:
The steps to transition from Part 1 to Part 2 are included in the CNS-318 book for reference, in case it is needed.
Only perform these steps if instructed.
These steps allow students completing the Part 1 content (CNS-318, Mon-Wed) to transition to the starting state
required for Part 2(CNS-319, Thu-Fri).
IMPORTANT: Only run these steps if going from Part 1 to Part 2 (CNS-318 to CNS-319).
If starting in the Part 2 (CNS-3219) images, skip this procedure.
Estimated time to complete this task : 5 minutes
2. Run the following commands to set the config for the new start state:
Restore the dependent files for the configuration from part 1(signatures, imports, and SSL certs):
batch -filename
/var/labstuff/restore/restorefiles_part1end.bat
Restore the dependent files for the configuration (signatures, imports, and SSL certs):
batch -filename
/var/labstuff/restore/restorefiles_part2start.bat
NOTE: This configuration keeps all of the load balancing virtual servers and policies from part 1,
with the exception of AppFlow integration with Insight has been remove. The AppQoE and IP
Reputation features are disabled and their policies are no longer bound to the associated virtual
servers. AppFw feature is disabled, but the policies are still bound to the WebGoat and AFWeb
virtual servers, for later demonstrations.
The transition scripts add an SSL certkey pointing to an expired certificate for *.training.lab. The
SSL certkey is in use by two additional lb vservers for WebGoat and AFWeb on SSL and 443.
111
3. Reconnect to NS_VPX_01 at 192.168.10.101 using PUTTY. Log on as nsroot / nsroot.
Verify all the following load balancing virtual servers are present.
lb_vsrv_rbg
lb_vsrv_afweb
lb_vsrv_webgoat
lb_vsrv_callout (will be listed as down)
lb_vsrv_afweb_ssl (NEW)
lb_vsrv_webgoat_ssl (NEW)
Note: If dependencies referenced in the configuration such as Signatures or imported pages are
not present on the NetScaler, the depdendent objects such as policy actions or profiles will be
missing. Repeat step 2 and run all three scripts to fix the issue and reboot.
Verify the three custom responder policies are included in the summary list:
rs_pol_drop_bycallout
rs_pol_drop_bycallout2
rs_pol_respondwith_err_reqrate
Verify the one custom responder action is included in the summary list:
rs_act_respondwith_err_reqrate
112
11. Open XenCenter and connect to your assigned XenServer:
Use XenCenter shortcut on Desktop.
Shutdown NetScaler Insight Center VM and start NetScaler MAS Virtual Appliance:
Right-click NS_InsightCenter in left pane and click Shutdown.
Right-click MAS Virtual Appliance in left pane and click Start, if not running.
113
114