We 7111 Stud
We 7111 Stud
Education academy.avnet.com
TR-375528 *****
V10.0
cover
WebSphere Education
TR-375528 *****
Student Notebook
Trademarks
The reader should recognize that the following terms, which appear in the content of this training
document, are official trademarks of IBM or other companies:
IBM, the IBM logo, and ibm.com are trademarks or registered trademarks of International Business
Machines Corp., registered in many jurisdictions worldwide.
The following are trademarks of International Business Machines Corporation in the United States,
or other countries, or both:
Approach® Bluemix™ CICS®
DataPower® DB™ DB2 Connect™
DB2® developerWorks® Express®
IMS™ Notes® RACF®
Rational® Redbooks® Tivoli®
WebSphere® Worklight® z/OS®
400®
Intel and Intel Core are trademarks or registered trademarks of Intel Corporation or its subsidiaries
in the United States and other countries.
Linux is a registered trademark of Linus Torvalds in the United States, other countries, or both.
Microsoft and Windows are trademarks of Microsoft Corporation in the United States, other
countries, or both.
Java™ and all Java-based trademarks and logos are trademarks or registered trademarks of
Oracle and/or its affiliates.
UNIX is a registered trademark of The Open Group in the United States and other countries.
VMware and the VMware "boxes" logo and design, Virtual SMP and VMotion are registered
trademarks or trademarks (the "Marks") of VMware, Inc. in the United States and/or other
jurisdictions.
Other product and service names might be trademarks of IBM or other companies.
TR-375528 *****
V10.0
Student Notebook
TOC Contents
Trademarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvii
Agenda . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxiii
TR-375528 *****
Student Notebook
TR-375528 *****
V10.0
Student Notebook
TR-375528 *****
Student Notebook
TR-375528 *****
V10.0
Student Notebook
TR-375528 *****
Student Notebook
TR-375528 *****
V10.0
Student Notebook
Unit 10. REST and JSON support for Web 2.0 and mobile applications . . . . . . . . . . . . . . . 10-1
Unit objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-2
Alternatives to SOAP-based web services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-3
Web SOA (Web 2.0) versus Enterprise SOA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-4
Web SOA protocols and standards . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-5
Growth of mobile clients . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-6
DataPower as the reverse proxy for Web 2.0 / Mobile clients . . . . . . . . . . . . . . . . . . . . . . 10-7
Securing the reverse proxy with ISAM for Mobile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-8
Introduction to REST . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-9
REST style services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-10
Example: Employee processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-11
Employee REST interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-12
Example: REST interaction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-13
Example: Add employee REST request explained . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-14
Example: Add employee REST response explained . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-15
Common DataPower REST patterns: Facade . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-16
Common DataPower REST patterns: Bridge . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-17
Common DataPower REST patterns: REST enrichment . . . . . . . . . . . . . . . . . . . . . . . . . 10-18
Tools to support REST: Service or protocol handler related . . . . . . . . . . . . . . . . . . . . . . 10-19
Front side handler support of HTTP method selection . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-20
JSON request and response types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-21
Process bodyless messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-22
JSON threat protection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-23
TR-375528 *****
Student Notebook
TR-375528 *****
V10.0
Student Notebook
TR-375528 *****
Student Notebook
TR-375528 *****
V10.0
Student Notebook
TR-375528 *****
Student Notebook
TR-375528 *****
V10.0
Student Notebook
TR-375528 *****
Student Notebook
TR-375528 *****
V10.0
Student Notebook
TMK
Trademarks
The reader should recognize that the following terms, which appear in the content of this training
document, are official trademarks of IBM or other companies:
IBM, the IBM logo, and ibm.com are trademarks or registered trademarks of International Business
Machines Corp., registered in many jurisdictions worldwide.
The following are trademarks of International Business Machines Corporation, registered in many
jurisdictions worldwide:
Approach® Bluemix™ CICS®
DataPower® DB™ DB2 Connect™
DB2® developerWorks® Express®
IMS™ Notes® RACF®
Rational® Redbooks® Tivoli®
WebSphere® Worklight® z/OS®
400®
Intel and Intel Core are trademarks or registered trademarks of Intel Corporation or its subsidiaries
in the United States and other countries.
Linux is a registered trademark of Linus Torvalds in the United States, other countries, or both.
Microsoft and Windows are trademarks of Microsoft Corporation in the United States, other
countries, or both.
Java™ and all Java-based trademarks and logos are trademarks or registered trademarks of
Oracle and/or its affiliates.
UNIX is a registered trademark of The Open Group in the United States and other countries.
VMware and the VMware "boxes" logo and design, Virtual SMP and VMotion are registered
trademarks or trademarks (the "Marks") of VMware, Inc. in the United States and/or other
jurisdictions.
Other product and service names might be trademarks of IBM or other companies.
TR-375528 *****
Student Notebook
TR-375528 *****
V10.0
Student Notebook
pref
TR-375528 *****
Student Notebook
TR-375528 *****
V10.0
Student Notebook
pref
Course description
Accelerate, Secure, and Integrate with IBM DataPower V7.1
Duration: 5 days
Purpose
This course teaches you the fundamental skills that are required to configure,
implement, and troubleshoot services that are developed on the IBM
DataPower Gateway (IDG) appliances with firmware version 7.1.x. The
concepts in this course are also beneficial to system administrators of the
DataPower appliance, although there is a separate course for administrators.
Audience
This course is designed for integration developers who configure service
policies on IBM DataPower Gateway appliances.
Prerequisites
Before taking this course, you should successfully complete course VW700,
Technical Introduction to IBM WebSphere DataPower Gateway Appliances
V7 and VW710, What’s New in DataPower V7.1. You should also be familiar
with:
• Security-based concepts and protocols
• XML-related technologies such as XML schema, XPath, and XSLT
• JavaScript programming
• Web service fundamentals and the web services security specifications
• REST-based services
Objectives
After completing this course, you should be able to:
• Describe how DataPower appliances are configured
• Create a web service proxy to virtualize web service applications
• Implement web services security
• Create and configure cryptographic objects
• Configure Secure Sockets Layer (SSL) to and from DataPower
appliances
TR-375528 *****
Student Notebook
TR-375528 *****
V10.0
Student Notebook
pref
Agenda
Day 1
Course introduction
Unit 1. Quick introduction to developing on DataPower
Exercise 1. First exposure to the DataPower developer environment
Unit 2. Services overview
Unit 3. Structure of a service
Exercise 2. Creating a BookingService gateway
Unit 4. Multi-protocol gateway service
Day 2
Unit 5. Problem determination tools
Exercise 3. Enhancing the BookingService gateway
Unit 6. Handling errors in a service policy
Exercise 4. Adding error handling to a service policy
Unit 7. DataPower cryptographic tools and SSL setup
Exercise 5. Creating cryptographic objects and configuring SSL
Unit 8. XML and web services security overview
Day 3
Exercise 6. Web service encryption and digital signatures
Unit 9. Authentication, authorization, and auditing (AAA)
Exercise 7. Web services authentication and authorization
Unit 10. REST and JSON support for Web 2.0 and mobile applications
Exercise 8. Using DataPower to implement REST services
Day 4
Unit 11. OAuth overview and DataPower implementation
Exercise 9. Defining a three-legged OAuth scenario that uses DataPower
services
Unit 12. DataPower caching
Exercise 10. Configuring a response cache
Unit 13. Integrating with IBM MQ
Exercise 11. Configuring a multi-protocol gateway service with IBM MQ
TR-375528 *****
Student Notebook
Day 5
Unit 14. Web service proxy service
Exercise 12. Configuring a web service proxy
Unit 15. Service level monitoring
Exercise 13. Implementing a service level monitor in a web service proxy
Unit 16. Patterns for service configuration
Exercise 14. Using a DataPower pattern with the Blueprint console
Unit 17. Course summary
TR-375528 *****
V10.1
Student Notebook
Uempty
Unit 1. Quick introduction to developing on
DataPower
References
IBM DataPower Gateway Knowledge Center:
http://www.ibm.com/support/knowledgecenter/SS9H2Y_7.1.0
© Copyright IBM Corp. 2015 Unit 1. Quick introduction to developing on DataPower 1-1
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Unit objectives
After completing this unit, you should be able to:
• Log in to the WebGUI
• Navigate around the WebGUI interface
• Identify the primary functions of the menus on the navigation bar
• Start the creation of a DataPower service
• Identify the typical areas of a service configuration page
• Save configuration definitions in memory and on the file system
• List the file directories that are commonly used for development
• Support any non-English languages that are enabled on the appliance
Notes:
TR-375528 *****
V10.1
Student Notebook
Uempty
Notes:
“IDG” is “IBM DataPower Gateway”, the new appliance series that was announced for V7. It is also
referred to as the “9006” appliance.
Although the command-line interface (CLI) and the SOAP management (SOMA) aspect of the XML
management interface (XMI) can be used for development, the primary way to develop resources
on the appliance is the WebGUI web interface.
© Copyright IBM Corp. 2015 Unit 1. Quick introduction to developing on DataPower 1-3
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
https://MyDataPowerAddress:9090
Notes:
The WebGUI access to the appliance uses SSL, so the protocol is “https.” The default port that the
WebGUI is active on is 9090, although the appliance administrator can change it.
To log in to the appliance, you must use a predefined user name and password. In DataPower
administrative pages, the “user name” is the name of a “user account” object.
Although all defined domains are visible under “Domain,” the user can connect only to domains to
which the user is authorized.
TR-375528 *****
V10.1
Student Notebook
Uempty
Figure 1-4. Login and development access to the appliance WE711 / ZE7111.0
Notes:
A user group can have multiple sets of permissions, so multiple application domains can be
accessible.
Creating user accounts, user groups, and domains are covered in detail in the Administration
course.
© Copyright IBM Corp. 2015 Unit 1. Quick introduction to developing on DataPower 1-5
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Navigation bar
Control Panel
Notes:
When login is completed, the WebGUI home page is displayed.
The home page has three areas: banner, navigation bar, and Control Panel.
When using a specific function, the work area for that function replaces the Control Panel area.
TR-375528 *****
V10.1
Student Notebook
Uempty
WebGUI banner
Appliance name
Save configuration
to file system
Notes:
The appliance administrator specifies the appliance name.
The user can switch to other authorized domains from the Domain menu.
© Copyright IBM Corp. 2015 Unit 1. Quick introduction to developing on DataPower 1-7
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Firmware level
Notes:
The Blueprint Console is covered in a later unit.
As text is entered into the search box, candidate functions appear as a list beneath the entry field.
As more letters are entered, the list adjusts to accommodate the newly entered text.
TR-375528 *****
V10.1
Student Notebook
Uempty
Figure 1-8. WebGUI Control Panel: Links to common functions WE711 / ZE7111.0
Notes:
The Control Panel allows quick access to common development and administration functions.
The Services section allows you to create or modify the primary DataPower services.
The Monitoring and Troubleshooting section provides a view of the appliance system log,
troubleshooting functions, and status.
The Files and Administration section provides links to file management, system control, importing
and exporting, and cryptographic keys and certificates on the appliance.
Most of the links on the Control Panel are also available through the navigation bar.
The Search field above the navigation bar is used for searching within the categories in the
navigation bar.
© Copyright IBM Corp. 2015 Unit 1. Quick introduction to developing on DataPower 1-9
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Notes:
The main menus in the navigation bar enable many development functions. The most popular
development menus are Status, Services, and Objects.
Most of the objects that are created as part of a service, including the service itself, are also
individually available under Objects.
TR-375528 *****
V10.1
Student Notebook
Uempty
Notes:
© Copyright IBM Corp. 2015 Unit 1. Quick introduction to developing on DataPower 1-11
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
2
3
4 5
7 8
Notes:
This slide shows areas that are common for the configuration of a service.
1. Navigation bar remains visible and available
2. Clicking the object type typically returns you to the catalog for that object type
3. Multiple tabs that are object-dependent
4. Apply, cancel, or delete the object
5. Object-specific links
6. Service policy configuration (programming-like configuration)
7. Information to connect to the back side application
8. Front side interface to access the service
More detailed presentation of the multi-protocol gateway configuration is covered in a later unit.
TR-375528 *****
V10.1
Student Notebook
Uempty
Notes:
The system log is defined as a log target. A log target receives log entries from objects to post.
Each domain always has a log target that is called default-log to represent the default system log.
More log targets can be defined and customized.
The most recent log entries are shown at the top of the system log.
The logs can be sorted by the categories that are listed at the top.
Logging is covered in more detail in a later unit.
© Copyright IBM Corp. 2015 Unit 1. Quick introduction to developing on DataPower 1-13
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Notes:
Clicking Apply commits configuration changes that are made in the current WebGUI page.
However, such changes are stored in temporary memory. You must click Save Configuration on
the upper-right corner of the WebGUI interface to commit changes to permanent storage (file
system). If you attempt to switch application domains without committing your changes, a warning
dialog box is shown, allowing you to switch domains without saving any changes, or to save the
changes immediately.
TR-375528 *****
V10.1
Student Notebook
Uempty
Configuration Checkpoints
Notes:
Configuration checkpoints can also be used as a form of a rollback for a single domain.
Existing checkpoints can be removed, compared, or rolled back (that is, redefine the domain
configuration).
© Copyright IBM Corp. 2015 Unit 1. Quick introduction to developing on DataPower 1-15
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
File management
3
2
File management
Notes:
1. From the navigation bar Administration section, click Main > File Management.
2. Alternatively, you can open the File Management page through the icon of the same name in
the Control Panel.
3. The file stores are divided into different directories. Most directories are specific to one
application domain, others are shared across all domains, and a few are specific to the default
domain.
4. Actions against a directory are initiated from the Action column. Actions against selected files
are initiated by using buttons.
TR-375528 *****
V10.1
Student Notebook
Uempty
config: Per application Stores configuration files for the current application
domain; not domain
shared
export: Per application Holds any exported configuration that is created with
domain; not the Export Configuration operation
shared
local: Per application Storage space for files that local services use,
domain; including XML style sheets, XML schemas, and WSDL
possibly visible documents
to other • Use the visible domains setting to view the local
domains file store of other application domains
store: System-wide; Sample and default style sheets that DataPower
shared services use
• A common practice is to copy these style sheets
into your local directory before you change them
temporary: Per application Temporary disk space that document processing rules
domain; not and actions use, and is cleared on an appliance restart
shared
© Copyright IBM Corporation 2015
Notes:
Directories that are commonly accessed during development are in bold.
When auxiliary storage is enabled, it is accessible as a subdirectory of the local: and the
logstore: directories.
© Copyright IBM Corp. 2015 Unit 1. Quick introduction to developing on DataPower 1-17
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
cert: Per application Location to store private keys and digital certificates
domain; not • System automatically encrypts all files in this
shared store
• After being added, files cannot be copied or
modified
• You can delete digital certificates and private keys
Notes:
If you specify Disaster Recovery mode on the initialization or reinitialization of an appliance or
blade, there are certain situations in which you can export the keys.
TR-375528 *****
V10.1
Student Notebook
Uempty
Notes:
When auxiliary storage is enabled, it is accessible as a subdirectory of the local: and the
logstore: directories.
© Copyright IBM Corp. 2015 Unit 1. Quick introduction to developing on DataPower 1-19
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Notes:
TR-375528 *****
V10.1
Student Notebook
Uempty
Notes:
Use the export configuration command to back up the current configuration or to duplicate services
and settings in other application domains. The export configuration command writes a series of
XML files that follow the DataPower XML Management schema. In the last step of the Export
Configuration page, you have an opportunity to download the .zip file that contains the XML
configuration files. Alternatively, you can retrieve the configuration files from the export: file store
that is associated with the current domain.
© Copyright IBM Corp. 2015 Unit 1. Quick introduction to developing on DataPower 1-21
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Import a configuration
• The Import Configuration feature updates the domain configuration
with a previously saved version
– Useful for duplicating
configured services
from one application
domain to another
– Administrators and
developers must
confirm changes
that overwrite
already configured
services and
interfaces
– Can import a range
of resources, from
individual objects
to multiple services
© Copyright IBM Corporation 2015
Notes:
The import configuration feature accepts only DataPower XML Management documents as an XML
file or as a .zip file.
A deployment policy allows an imported configuration to be preprocessed, and certain properties to
be modified.
Deployment policy variables allow the externalization of the substitution values within the
deployment policy.
Rewriting local service addresses updates the local service bindings to the equivalent interfaces in
the imported configuration.
TR-375528 *****
V10.1
Student Notebook
Uempty
Notes:
The System Control page in an application domain has only three functions. In the default domain,
an administrator can use many more functions.
System Control can be accessed by clicking Control Panel > Administration > Main > System
Control, or the System Control icon on the Control Panel.
You can change your own password.
Restart Domain restarts the domain from its last persisted configuration. This function is the
configuration that is saved when Save Configuration is clicked.
Reset Domain is destructive. It deletes all of the objects that were created within the domain,
including any services, and restarts the empty domain. The only resources that are retained are
files in the local: directory.
© Copyright IBM Corp. 2015 Unit 1. Quick introduction to developing on DataPower 1-23
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Figure 1-23. Globalization: Displaying other languages in WebGUI and the log WE711 / ZE7111.0
Notes:
The DataPower WebGUI and the system log and messages can be displayed in languages other
than English.
TR-375528 *****
V10.1
Student Notebook
Uempty
Enabling languages
• For any language other than English, that language must be enabled
before it can be used
– If incorrect settings are made, English is the default language
• Click Administration > Device > Language
– Visible in default
domain only
– Set by administrator
Notes:
© Copyright IBM Corp. 2015 Unit 1. Quick introduction to developing on DataPower 1-25
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
• Example: German as
the primary language
in the browser
Figure 1-25. Getting the WebGUI to display an alternative language WE711 / ZE7111.0
Notes:
The language must be enabled in DataPower first.
TR-375528 *****
V10.1
Student Notebook
Uempty
Figure 1-26. Getting an alternative language for the log and messages WE711 / ZE7111.0
Notes:
© Copyright IBM Corp. 2015 Unit 1. Quick introduction to developing on DataPower 1-27
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Unit summary
Having completed this unit, you should be able to:
• Log in to the WebGUI
• Navigate around the WebGUI interface
• Identify the primary functions of the menus on the navigation bar
• Start the creation of a DataPower service
• Identify the typical areas of a service configuration page
• Save configuration definitions in memory and on the file system
• List the file directories that are commonly used for development
• Support any non-English languages that are enabled on the appliance
Notes:
TR-375528 *****
V10.1
Student Notebook
Uempty
Checkpoint questions
1. True or False: One way to restrict access to an application domain is
to define user groups to restrict user account access to a particular
domain.
2. True or False: A user can access the WebGUI by using http or https,
depending on how the administrator configures it.
3. Which directories are important to a developer and specific to an
application domain?
A. cert:
B. export:
C. image:
D. local:
E. sharedcert:
F. store:
Notes:
Write your answers here.
1.
2.
3.
© Copyright IBM Corp. 2015 Unit 1. Quick introduction to developing on DataPower 1-29
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Checkpoint answers
1. True.
Notes:
TR-375528 *****
V10.1
Student Notebook
Uempty
Exercise 1
Notes:
© Copyright IBM Corp. 2015 Unit 1. Quick introduction to developing on DataPower 1-31
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Exercise objectives
After completing this exercise, you should be able to:
• Log in to the WebGUI
• Use the navigation bar
• Use an object catalog
• Import a service
• Edit a multi-protocol gateway
• Review the actions in a policy editor
• Test a service from a browser and a cURL command
Notes:
TR-375528 *****
V10.1
Student Notebook
Uempty
Unit 2. Services overview
References
IBM DataPower Gateway Knowledge Center:
http://www.ibm.com/support/knowledgecenter/SS9H2Y_7.1.0
TR-375528 *****
Student Notebook
Unit objectives
After completing this unit, you should be able to:
• Define what a DataPower service is
• List the supported services on the DataPower appliance
• Describe the similarities and differences in the features that each
DataPower service supports
Notes:
TR-375528 *****
V10.1
Student Notebook
Uempty
Request
MyService
Service policy
Front side
Back side
•Authenticate
•Transform
•Route Endpoint
Remote clients application
servers
Response
Notes:
“Front side” defines the client interface to the DataPower service.
Most services have a service policy, which you configure to deliver the DataPower functions that
the service needs.
“Back side” defines the DataPower outbound service interface to the endpoint application servers.
TR-375528 *****
Student Notebook
Request
Remote and Endpoint
internal application
clients servers
Response
Service on same or Service on same or
different appliance different appliance
Call
Figure 2-3. Front sides and back sides, and sideways WE711 / ZE7111.0
Notes:
The front side of a service can receive requests from a remote client, an internal client, or another
service on the appliance.
While executing a service policy, the service can call other services on the appliance or other
application servers.
The back side of the service calls the target application server, or perhaps another service on the
appliance.
TR-375528 *****
V10.1
Student Notebook
Uempty
Notes:
AAA is authentication, authorization, and auditing.
The primary DataPower services are multi-protocol gateway and the web service proxy.
The web service proxy configuration is WSDL-based. It is the only service that requires a WSDL
file.
All services support monitors and logging.
TR-375528 *****
Student Notebook
• Use cases
– Continuing support for existing customer implementations
– Superseded by more powerful service types
Notes:
The XSL proxy service supports XML validation and transformation at wire speed.
The term “wire speed” is often used to describe the XML processing performance of a WebSphere
DataPower SOA appliance. That is, the average XML processing rate is almost as high as the
network connection transmission rate. Runtime variables, such as the complexity of XML messages
and the XSL transform, affect processing speed.
Companies that provide XML applications or web services often skip the XML schema validation
step due to performance cost. With the XSL proxy service, these companies can validate XML
messages against an existing schema without significant degradation in performance. This solution
also requires no modification to the existing back-end service.
TR-375528 *****
V10.1
Student Notebook
Uempty
Notes:
The features that are listed for the XML firewall are not exhaustive. The XML firewall also supports
the same features that are mentioned previously for the XSL proxy.
An XML firewall uses a document processing policy to enforce the features that are mentioned in
the slide. For example, a firewall policy can require that messages be decrypted and then
schema-validated. Other features, such as XML signatures, access control, and dynamic routing,
have actions that are associated with them and are used in a firewall policy.
XML threat protection and SSL communication are configured at the service level instead of the
policy level.
TR-375528 *****
Student Notebook
HTTPS
Notes:
The multi-protocol gateway does not support the loopback proxy mode as supported by the XML
firewall and XSL proxy, but the same effect can be specified by using a DataPower variable within
the service.
The protocol that is used on the client side of the gateway does not need to be the same as the one
on the back end.
The supported protocols are HTTP, HTTPS, FTP, SFTP, NFS, raw XML, WebSphere MQ,
WebSphere MQ File Transfer Edition (MQFTE), TIBCO EMS, WebSphere JMS, and IMS Connect.
The gateway can use GET and PUT queues to communicate by using WebSphere MQ messages.
Raw XML is an implementation that uses persistent TCP connections to allow messages to flow
from the client to the back-end server and back again.
TR-375528 *****
V10.1
Student Notebook
Uempty
Client Web
Web service proxy services
Notes:
An XML firewall or multi-protocol gateway can be created from a WSDL file as well. However, the
web service proxy is simpler to configure with the WSDL file because it includes built-in support for
creating rules at different levels of the WSDL, and service virtualization.
Multiple WSDL files can be associated with the web service proxy, producing a single virtual WSDL
that the client sees.
The web service proxy does not support the loopback proxy mode as supported by the XML firewall
and XSL proxy, but a DataPower variable within the service can be used to specify the same effect.
You can receive requests over various transports (front side handlers). It is the same list that a
multi-protocol gateway supports for the front side.
WSDLs can be retrieved from a Universal Description, Discovery, and Integration (UDDI) registry
and from WebSphere Service Registry and Repository.
Governance policy, such as WS-SecurityPolicy and WS-MediationPolicy, can also be retrieved from
a UDDI registry and WebSphere Service Registry and Repository.
WebSphere Service Registry and Repository can “push” changes to a web service proxy.
TR-375528 *****
Student Notebook
Trading Partners
© Copyright IBM Corporation 2015
Notes:
The DataPower B2B support adds additional protocol handlers:
• Applicability Statement 1 (AS1), AS2, AS3, ebXML Message Service (ebMS)
The B2B gateway service supports the following standards for message bodies:
• XML
• Electronic Data Interchange (EDI) ANSI X12
• Electronic Data Interchange for Administration, Commerce, and Transport (EDIFACT)
• Binary that is not XML or EDI.
This service is available on the XB62 and the IDG.
TR-375528 *****
V10.1
Student Notebook
Uempty
Notes:
A junction combines the web space of the web server with the web space of the Access Manager
Reverse Proxy. This results in a unified view of the entire web object space.
ISAM for Web and ISAM for Mobile provide their own optional reverse proxy web server, which is
known as WebSEAL. The Access manager reverse proxy in DataPower provides the same
functions that webSEAL does, but within DataPower itself.
The resources that are supported and protected include URLs, URL-based regular expressions,
CGI programs, HTML files, Java servlets, and Java class files.
If the incoming message needs further mediation, such as a transformation, the access manager
reverse proxy can pass the message to another DataPower service like an MPGW to do that.
This service is available on the IDG only.
TR-375528 *****
Student Notebook
Notes:
The web application firewall service contains functionality that is required for securing, load
balancing, and accelerating web-based applications. This service is unlike the other services, which
focus on XML-based applications.
Thread mediation is provided by checking for malicious JavaScript within HTTP messages.
The concept of the web application firewall is similar to other services, except that it applies to
HTTP traffic.
The web application firewall provides features specific to web applications, such as session
management, web-based validation, and cookie handling.
The configuration is based on request and response maps, rather than a service policy.
TR-375528 *****
V10.1
Student Notebook
Uempty
Other services
• Web token service
– Loopback service to support OAuth token services
• Interoperability test service
– Development tool that simplifies the testing of style sheets and schemas
• XSL coprocessor service
– Loopback service that accepts JAXP-based requests
– Deprecated
• Four secondary services are available for handling message traffic
without executing a service policy
– HTTP service: Serves documents from a device directory
– TCP proxy service: Forwards TCP traffic to another address and port
– SSL proxy service: Used by log targets to securely connect to remote log
systems
– Cloud Gateway Service: Creates a Cloud Gateway service, which can be used
with Bluemix Cloud Integration
Notes:
Web token service and interoperability test service are explained in other units.
The XSL coprocessor service is a variant of the XSL proxy service. It is deprecated, and should not
be used. In the past, this service was commonly used to test style sheets. This capability is now
available in the interoperability test service. Although this service supported JAXP-based requests,
there is no Java running in the firmware. It conforms to the JAXP interface.
By default, the appliance does not create an HTTP service on port 80. It must be explicitly created.
This service is meant for low-volume or testing purposes; there is not much room for the disk
requirements of a typical web server.
The TCP and SSL proxy services listen for requests on the specified port number and forward the
requests to a remote host address and port.
A Cloud Gateway service can be used with Bluemix Cloud Integration Services to secure traffic
from cloud-based Bluemix applications to enterprise applications or data sources.
Each Cloud Gateway service must have one or more enterprise applications defined. When a
cloud-based client establishes a connection to a Cloud Gateway service, the client identifies which
enterprise application to connect to using its service name.
TR-375528 *****
Student Notebook
For more information, see the IBM Bluemix home page: https://ace.ng.bluemix.net/
TR-375528 *****
V10.1
Student Notebook
Uempty
Figure 2-13. Which service type should you use? WE711 / ZE7111.0
Notes:
The remaining service types are for more-specialized and less-frequent requirements. Sometimes
these primary service types might call services of other types for utility functions.
TR-375528 *****
Student Notebook
Unit summary
Having completed this unit, you should be able to:
• Define what a DataPower service is
• List the supported services on the DataPower appliance
• Describe the similarities and differences in the features that each
DataPower service supports
Notes:
TR-375528 *****
V10.1
Student Notebook
Uempty
Checkpoint questions
1. True or False: The web service proxy is the only service that requires a
WSDL.
2. True or False: While executing a service policy, the service can invoke
only other services on the appliance.
3. Which service type is the best choice for this requirement? A service
needs to schema-validate and transform a message before it is placed on
a WebSphere MQ queue for mainframe processing. Input comes over
HTTPS from external clients, and over HTTP from internal clients.
A. XML firewall
B. Multi-protocol gateway
C. Web service proxy
4. Which service type is the best choice for this requirement? An enterprise
has operations within several existing web services that it wants to
expose to external clients as a single web service.
A. XML firewall
B. Multi-protocol gateway
C. Web service proxy
© Copyright IBM Corporation 2015
Notes:
Write your answers here.
1.
2.
3.
4.
TR-375528 *****
Student Notebook
Checkpoint answers
1. True.
2. False. While executing a service policy, the service can invoke other
application servers and other services on the appliance.
4. C. Web service proxy. This service type can present a single virtual
web service to the client that is composed of specific operations from
several web services.
Notes:
TR-375528 *****
V10.1
Student Notebook
Uempty
Unit 3. Structure of a service
References
IBM DataPower Gateway Knowledge Center:
http://www.ibm.com/support/knowledgecenter/SS9H2Y_7.1.0
TR-375528 *****
Student Notebook
Unit objectives
After completing this unit, you should be able to:
• List the basic structural components of a service and describe their
relationships
• List the ways that a service configures its front-side access and back-
side connections
• Use the policy editor to configure a service policy
• Create a service policy with actions that process the client request or
server response
• List some of the processing actions and describe their function
• Configure service-wide settings such as:
– Service type: static back-end, dynamic back-end, and loopback proxy
– XML Manager
– URL rewriting
Notes:
TR-375528 *****
V10.1
Student Notebook
Uempty
Object-based configuration
• Configuration is object-based
– A service (an object itself) is composed of many lower-level objects
– These objects are “data” objects, not the traditional object-oriented entities with
custom-coded methods (behavior)
• In the vertical navigation bar, expand Status > Main > Object Status
– List of lower-level objects that compose a service
Notes:
TR-375528 *****
Student Notebook
Notes:
TR-375528 *****
V10.1
Student Notebook
Uempty
Domain
Domain
Rule • Each rule contains multiple actions
– Some standard actions are Validate,
Transform, and Results
Domain
Domain
Action – Custom XSLT is always available by
using the Transform action
© Copyright IBM Corporation 2015
Notes:
From the service level on down, the focus is on the XML-based services that are covered in this
course: XML firewall, multi-protocol gateway, and web service proxy.
For a service, the configuration is divided between the front side access, connection to the back
side, general service settings, and the service policy.
TR-375528 *****
Student Notebook
Request
Notes:
When a service receives a message from a designated IP and port, a sequence of events is set into
motion before the message is ultimately forwarded to its intended destination. The events are
separated into three distinct phases: client-side processing, service processing, and server-side
processing.
Response messages from the server then pass through these phases in reverse. Response
processing is the same as request processing except that the server must deal with errors from the
back-end service.
During client-side processing, the URL submitted by the client might be rewritten. The HTTP
headers are altered, and the format of the message is validated (SOAP or XML).
During service policy processing, the message might be transformed in any number of ways, and
filtered, encrypted, decrypted, signed, verified, or duplicated, and sent to a third-party resource for
handling.
During server-side processing, the message might be routed, TCP and HTTP options set, or SSL
connections negotiated.
URI propagation refers the part of the URL after the host-port combination.
TR-375528 *****
V10.1
Student Notebook
Uempty A user agent can be configured with an SSL proxy profile to communicate securely to the back-end
service.
A load balancer object is used to provide redundancy for multiple back-end servers. The service
sends the message to the load balancer group instead of the back-end server. The load balancer
group chooses the back-end server.
Multi-step scope refers to the sequence of actions that are executed on the request and response.
Variables can be set to pass information between the actions.
TR-375528 *****
Student Notebook
Notes:
TR-375528 *****
V10.1
Student Notebook
Uempty
Notes:
TR-375528 *****
Student Notebook
Notes:
After the client-side processing phase is completed and accepted the message, the message is
passed to the service’s processing policy. The process is often referred to as Multistep processing.
A Processing Policy is a list of rules that contain actions that can be applied to a message. Actions
are specific operations that are applied to a message such as encryption and decryption, message
signing, authentication. As the request message passes through the processing policy, the actions
are applied to the message in a specified sequence, ultimately resulting in the message that is
passed to the server-side processing phase.
TR-375528 *****
V10.1
Student Notebook
Uempty
Multi-Protocol Gateway
Processing Policy
z
z
z
Processing Rule #N Match Processing
Processing Processing
[Req | Rsp | Both | Error] Action Action #1#1 z
Action zz Action #N
Notes:
Each service that you configure has exactly one Processing Policy.
The processing policy defines what should happen when a message arrives from either the client
(request), or the server (response).
A processing policy is composed of one or more Processing Rules. A processing rule always
begins with a Match Action, followed by one or more Processing Actions. Processing rules are
identified as either request, response, both, or error types. A processing rule that is indicated as a
request rule is ignored during response processing. A processing rule that is identified as both is
evaluated for both requests and responses. Error rules are executed only when an error occurs
during processing.
TR-375528 *****
Student Notebook
Match Action
• Evaluate statements by using: AND | OR message arrives from either
the client (request), or the server (response).
Processing
Match Expression: URL | HTTP Header | XPath
Action #1 | Error Code
Processing
Match Expression: URL | HTTP Header | XPath
Action #1 | Error Code
z
z
z
Processing
Match Expression: URL | HTTP Header | XPath
Action #1 | Error Code
Notes:
TR-375528 *****
V10.1
Student Notebook
Uempty
Notes:
TR-375528 *****
Student Notebook
Notes:
The back side connection can be dynamically determined, rather than hardcoded. In this case, the
connection is made from a style sheet within the service policy.
TR-375528 *****
V10.1
Student Notebook
Uempty
= File
Supporting Processing
Crypto-Profile
Protocol Objects Rules
Key/Certificate Processing
Match Rule
Objects Actions
Key/Certificate
AAA Policy XSL/XML Files
Files
Notes:
This diagram shows some of the objects that are associated with a specific service. For example,
the service might be a Multi-Protocol Gateway that you create for handling requests. The service
uses a Front Side Handler object that identifies an IP address and port. It also includes an SSL
Proxy object that includes the necessary objects for SSL encryption. The service has a Processing
Policy (for the service processing phase), and that policy contains one or more Processing Rules,
and each rule contains one or more Processing Actions. Some of the objects are created for you as
a by-product of configuration wizards, and others are created by drag actions within the WebGUI.
TR-375528 *****
Student Notebook
• For a multi-protocol gateway and XML firewall, the policy editor opens
in its own window
– You configure all rules within the service policy in this window
– All of the rules are visible in the window
• For the web service proxy, the policy editor is displayed as a section on
the Policy tab
– Only the rules that relate to the currently selected level of the WSDL (proxy,
wsdl, service, port, operation) are configured
– In the web service proxy, the policy editor does not show all the rules that apply
to the service at the same time
Notes:
TR-375528 *****
V10.1
Student Notebook
Uempty
Policy editor
Policy area
Notes:
The policy area is where the service policy is named, and the configuration applied. In the web
service proxy, there is no policy area in the policy editor.
The rule configuration area is where rules are created, named, deleted, and configured. Action
icons are dragged onto the rule configuration path.
The configured rules area lists the current rules that are part of the service policy.
TR-375528 *****
Student Notebook
If the request matches the conditions that are set in the Match action,
then the actions are executed © Copyright IBM Corporation 2015
Notes:
This example defines a rule with a Match action and two actions (Validate and Results).
A rule can be configured to apply to:
• Server to client (server response)
• Both directions (client request and server response)
• Client to server (client request)
• Error (errors during message processing)
TR-375528 *****
V10.1
Student Notebook
Uempty
Processing rules
• Rules have the following directions: • Other capabilities
– Server to client (response) – Programmatic actions such
– Client to server (request) as loops are available;
otherwise, actions are
– Both directions (request and response)
performed in sequential order
– Error: Executes when errors occur
– The asynchronous option
during processing in the request and
response rules allows the next action to start
without waiting for the current
• Rules have priority and are ordered action to complete
– Multiple rules
might match on
the same URL;
order is critical
to selection
– Specific rules
must have
higher priority
than catch-all
rules
© Copyright IBM Corporation 2015
Notes:
A specific matching rule can match on the URL */test. A catch-all rule can match on all URLs by
using the asterisk (*).
Processing in rules occurs sequentially in the order that the actions appear. Actions that allow for
programmatic processing, such as looping and if-then-else statements, are available.
TR-375528 *****
Student Notebook
Match action
• A Match action provides different
processing that is based on
matching conditions
Notes:
A Match action is used to define criteria that are matched against the incoming traffic to determine
whether the actions configured in the rule are applicable.
Each rule is configured with a Match action.
The error code is not an HTTP error code, but a DataPower internal error code value.
TR-375528 *****
V10.1
Student Notebook
Uempty
Processing actions
• A rule consists of multiple processing actions with scope
– Actions such as Transform or Validate execute during the request or response
rule (if there are any)
– Contexts or defined variables within the scope are used to pass information
between actions
– Asynchronous options allow the following action to start before the current action
completes
– Programmatic actions allow for looping and if-then-else logic in rules
The contexts and variables that are set during the request processing are available
to the actions used in the response processing because of a shared scope
© Copyright IBM Corporation 2015
Notes:
Variables can be set by using a Set Variable action (Advanced > Set Variable).
Contexts are temporary variables that contain XML data, binary non-XML data, user, or system
variables.
The Log action is a good example of asynchronous processing. You might want to log
asynchronously so that subsequent processing can continue without delay while logging is being
completed. If you want to wait until later and continue after your previous asynchronous actions
complete, you can add an Event-sink action. In this action, you can list previous asynchronous
actions that you wait on.
The Conditional action implements if-then-else processing based on XPath expression values.
The For-each action implements a loop on designated actions that are based on XPath expression
values.
TR-375528 *****
Student Notebook
Processing actions
Action Description
Notes:
The Encrypt and Decrypt actions are used for XML encryption. The Sign and Verify actions are
used in XML signatures. These actions are explained in the web services security unit.
The AAA action is presented in the AAA lecture.
The advanced actions are:
• Anti-Virus: This action scans a message for viruses by using an external ICAP server.
• Call Processing Rule: This action invokes a named rule; processing resumes on the next step.
• Conditional: This action selects an action for processing based on an XPath expression.
• Convert Query Params to XML: This action converts non-XML CGI-encoded input (an HTTP
POST of HTML form or URI parameters) into an equivalent XML message.
• Crypto-Binary: This action does a cryptographic operation (sign, verify, encrypt, decrypt) on
binary data.
• Event-sink: This action forces a wait for asynchronous actions before continuing.
TR-375528 *****
V10.1
Student Notebook
Uempty • Extract Using XPath: This action applies an XPath expression to a context and stores the
result in another context or a variable.
• Fetch: This action retrieves an identified external resource and places the result in the specified
context.
• For-each: This action defines looping based on a count or expression.
• Header Rewrite: This action rewrites HTTP headers or URLs.
• Log: This action sends the content of the specified input context as a log message to the
destination URL identified here.
• Method Rewrite: This action rewrites the HTTP method for the output message.
• MQ Header: This action manipulates WebSphere MQ headers.
• On Error: This action sets a named rule as the error handler; it is invoked if subsequent
processing encounters errors.
• Results Asynchronous: This action asynchronously sends a message in a specified context to
a URL or to the special output context.
• Route (by using Variable): This action routes the document according to the contents of a
variable.
• Set Variable: This action sets the value of a variable for use in subsequent processing.
• SLM: This action invokes a service level monitor (SLM) policy.
• SQL: This action sends SQL statements to a database.
• Strip Attachments: This action removes either all or specific MIME or DIME attachments.
• Transform binary: This action does a specified transform on a non-XML message, such as
binary or flat text.
• Transform with processing control file: This action transforms by using XQuery on an input
document (XML or JSON) with a processing control file.
• Transform (that uses processing instruction): This action transforms by using XSLT that is
specified by processing instructions within the XML document; the parameters might be
passed.
TR-375528 *****
Student Notebook
Notes:
Many actions have an asynchronous option. Event-sink is used in processing rules to wait for
certain asynchronous actions to complete before processing continues.
TR-375528 *****
V10.1
Student Notebook
Uempty
tmp1 OUTPUT
Notes:
Each action has an input and output. The appliance can explicitly define or generate it.
The tmp1 context variables are temporary variables that are used to pass information between the
actions.
The appliance predefines the INPUT and OUTPUT context variables to represent the input and
output messages.
A multi-step processing rule refers to a rule with at least one processing action.
TR-375528 *****
Student Notebook
Notes:
It is not always necessary to specify a context within an action. The WebGUI provides default input
and output contexts that can be used.
PIPE can improve processing efficiency and reduce latency by eliminating the need for temporary
storage of processed documents. This feature is used for streaming documents through the
appliance.
TR-375528 *****
V10.1
Student Notebook
Uempty
Notes:
The Validate action is used to validate the schema of XML documents. The schema URL can
reference either a local or a remote file.
A schema exception map object uses an XPath expression to specify the encrypted and
unencrypted parts of an XML document. It allows for encrypted XML documents to be validated by
using XML schemas that do not support XML encryption.
The Fetch button can be used to download a style sheet from a URL and store it on the appliance.
The Validate Document via Attribute Rewrite Rule option searches for an xsi:schemaLocation
attribute and rewrites this attribute value by using a URL rewrite policy. The validation is then
performed against the rewritten schema reference.
TR-375528 *****
Student Notebook
Notes:
The Validate action is also used to validate the schema of JSON structures. The JSON schema
URL can reference either a local or remote file.
The expected file type for a JSON schema is JSV or JSON.
DataPower Version 6.0.0 supports draft 3 of the IETF JSON Schema specification. There are a few
options in the specification that DataPower Version 6.0.0 does not support. For more information
about the options, see the product documentation.
TR-375528 *****
V10.1
Student Notebook
Uempty
Notes:
The Transform action is also used for supporting custom XSLT actions.
The style sheet can be either referenced from the appliance or uploaded from a remote site.
The URL Rewrite Policy rewrites external references that are contained within the input document.
TR-375528 *****
Student Notebook
Figure 3-27. Transform action that uses XQuery (JSON and XML) WE711 / ZE7111.0
Notes:
This option for the Transform action supports XQuery as the transformation language, rather than
XSLT.
XQuery is a language that is designed to query XML data, much as SQL is used to query relational
data. DataPower V6.0.0 includes the JSONiq extension to XQuery. This extension adds support for
JSON to XQuery.
DataPower Version 6.0.0 supports XQuery 1.0 and its related specifications. The JSONiq extension
support is for 0.4.42.
The Input Language indicates whether the input document is JSON or XML. The third option of
XSD indicates that the input document is XML, but it also displays another entry field that accepts
an XML schema file location. This schema is used to type the data (for example, integer, number,
text) for the XQuery processing, but it does not validate against the schema. For validation, you
must use a Validate action.
The Transform Language indicates the language of the transformation file. The only valid option
now is XQuery.
The URL Rewrite Policy rewrites external references that are contained within the input document.
TR-375528 *****
V10.1
Student Notebook
Uempty
Notes:
This version of the Transform action uses a WebSphere Transformation Extension mapping file to
control the transformation.
TR-375528 *****
Student Notebook
Filter action
• A Filter action accepts or rejects an incoming message
– Identifies an XSL style sheet that is used for message filtering
– Does not perform an XSL transformation
• The XSL style sheet uses the <dp:reject> and <dp:accept>
tags to filter messages
• The Filter action can be used to prevent replay attacks
Notes:
A standard filter employs the selected XSLT style sheet to either accept or reject the submitted
document.
TR-375528 *****
V10.1
Student Notebook
Uempty
Notes:
A replay attack protects against hackers that send a valid message multiple times. This attack
occurs when the intruder intercepts a valid message and sends that message on behalf of
someone else. To protect against replay attacks, messages pass unique values in each message.
The unique values that the replay filter supports are WS-Addressing messages that contain a
message ID, a WS-Security user name token with a nonce value, or a custom XPath. A nonce is a
bit string that is generated to produce a unique string. It is used in authentication and security
situations to create a unique ID.
The replay attack filter uses a standard style sheet, replay-filter.xsl, to check whether
messages are executing replay attacks.
The WS-Addressing message ID is a unique message identifier.
The WS-Security user name token can contain a password digest, which is a hashed value of the
password. Optionally, it can contain a nonce value, which is a unique base 64-bit encoded value.
Custom XPath uses content from the XML message to detect replay attacks.
TR-375528 *****
Student Notebook
GatewayScript action (1 of 2)
• GatewayScript is a JavaScript-based run time for processing mobile,
web, and API workloads
• Focuses on the “developer” experience, with familiar and friendly
constructs and APIs
• Performance
– Compiler technology and native execution
– Built on intellectual capital and expertise from 10+ years of securing and
optimizing XSLT parsing and compiler technology
– Ahead of time compilation with caching, not single threaded
• Secure
– Transaction isolation
– Code injection protection
– Short lived execution
– Small footprint
Notes:
Why use JavaScript?
• JavaScript is a widely used scripting language for large computer network environment.
• JavaScript is fast moving and community-driven, both client-side and server-side, and now
gateway also.
• A gateway run time that is based on JavaScript simplifies configuration for developers and
provides an easier development paradigm for mobile, web, and API.
TR-375528 *****
V10.1
Student Notebook
Uempty
GatewayScript action (2 of 2)
• Easily manipulate JSON and binary data to transform payloads or
create gateway functionality
• New Processing Policy Action
– Transformation style processing
policy action
– Access to gateway functions
through APIs
Notes:
JSONiQ or XQuery is not a general-purpose programming language; it is used for selectively
finding information from payloads and transforming them.
JavaScript provides you the ability to apply control logic and grant access to gateway API
functionality.
TR-375528 *****
Student Notebook
Content-based routing
• With content-based routing, the service can use a back-end service at
run time that is based on incoming message content
– The service type must be dynamic back-end
• Example:
– Route requests to different servers based on <state> value
DataPower configuration
<state>NC</state> EastAddressSearch
Request MPGW
Notes:
The content-based routing example that is shown in this slide routes the message to separate web
services based on the value of the <state> field in the message. The AddressRouter
multi-protocol gateway (MPGW) uses an XPath expression to extract the state value. If the value is
“NC” (North Carolina), an eastern state in the United States, the message is forwarded to the
EastAddressSearch multi-protocol gateway, which sends the message to the EastAddressSearch
web service. If the value is “CA” (California), a western state in the United States, the message is
forwarded to the WestAddressSearch multi-protocol gateway, which forwards the message to the
WestAddressSearch web service.
TR-375528 *****
V10.1
Student Notebook
Uempty
Notes:
The XPath Routing Map is used to specify static destinations that are based on the evaluation of an
XPath expression.
The XSL style sheet that is used in a Route action can use the DataPower extension function
<dp:set-target> to set the endpoint.
TR-375528 *****
Student Notebook
Figure 3-35. Style sheet programming with dynamic routing WE711 / ZE7111.0
Notes:
This example uses dp:soap-call in an XSL style sheet.
Set up a variable call to contain the XML message.
Use dp:call-soap() to send the message and save the response in a variable: result
<xsl:variable name="result"
select="dp:call-soap(http://fn.com/test',$call)"/>'
Use the dp:soap-fault extension function to generate a custom SOAP fault message.
The dp:http-request-header(headerFieldName) function is a common extension function that
is used to extract an HTTP header from a message.
Here is an example:
<xsl:variable name="SOAPAction"
select="dp:http-request-header( SOAPAction')"/>'
The SOAPAction parameter needs single quotation marks (') because the function expects an
XPath expression.
TR-375528 *****
V10.1
Student Notebook
Uempty The equivalent usage of <dp:set-target>(...) can also be accomplished by using DataPower
service variables. For example, to set the back-end URI in a style sheet, use the following code:
<dp:set-variable name=" var://service/routing-url'"'
value=" http://1.2.3.1:2068'"/>'
<dp:set-variable name=" var://service/URI'"'
value=" /SomeBank/services/checking'"/>'
The sslProxyProfile parameter is the name of a DataPower sslProxyProfile object.
TR-375528 *****
Student Notebook
Results action
• The Results action sends the document in the input context to:
– Destination URL, can be a list
– Output context, if no destination URL is specified
• If the Results action is the last action in a rule, it is usually writing to
the OUTPUT predefined context
• Use the Results action in the middle of the rule to send results
asynchronously
– Enable Asynchronous to send results to destination and continue processing in
the rule
– Can use a subsequent Event-sink action to wait on Results completion
Notes:
The Results action is typically the last action in a rule because it is used to return a response at the
end of the service policy. Make sure that the input context contains the variable with the document
to return to the client.
An alternative is to have the last action itself write to the OUPUT context.
The default Results action copies the input context to the output context.
TR-375528 *****
V10.1
Student Notebook
Uempty
Figure 3-37. Results asynchronous and multi-way results mode WE711 / ZE7111.0
Notes:
A regular Results action can be set to asynchronous mode, which can be used with an Event-sink
action to wait for the remote server response.
A Results Asynchronous action cannot have an output context.
If a Results or a Results Asynchronous action needs to specify multiple locations as destinations,
you must use a variable to represent the destination. An example of the format of that variable is
(from the product documentation):
<results mode="require-all" multiple-outputs="true">
<url input="context1">http://127.0.0.1:22223</url>
<url input="context2">http://127.0.0.1:22224</url>
<url input="context3">http://127.0.0.1:22225</url>
<url input="context4">http://127.0.0.1:22226</url>
</results>
Attempt All sends the results in the input context to all destinations and succeeds even if all the
remote servers fail.
TR-375528 *****
Student Notebook
First Available attempts each destination in order and stops with success after successfully
sending the input to at least one remote server.
Require All sends the input context to all destinations and fails if any of the remote servers fail.
TR-375528 *****
V10.1
Student Notebook
Uempty
Service settings
• Specifications on how the service operates
– TCP connection parameters
– HTTP versions
– Connection timeout values
– XML manager
– Traffic monitors
– XML threat protection
– HTTP header injection and suppression
– And more
• Varies by service type
Notes:
Traffic monitors are covered in another unit.
TR-375528 *****
Student Notebook
Service types
Remote clients Application servers
Static back-end
Dynamic back-end
Notes:
The static back end forwards traffic to a statically defined endpoint.
The dynamic back end forwards traffic that is based on the execution of a policy that specifies the
back-end host address and port.
A loopback proxy does not forward the message to a back-end service after processing is
complete. This service type is often useful for validation and transformation services.
A multi-protocol gateway (MPGW) and a web service proxy (WS-Proxy) can use a Set Variable
action to set var://service/mpgw/skip-backside to "1". This setting makes these services act
like a loopback proxy. Although you can use this variable in a web service proxy, it is unlikely.
TR-375528 *****
V10.1
Student Notebook
Uempty
URL rewriting
• Create a URL rewrite policy to rewrite some or all of a client URL
Notes:
The URL rewrite policy executes at the service level and before the service policy.
Rewriting the URL at the service level affects the matching rule of the service policy. If you rewrite
the URL, make sure that it still matches one of the matching rules.
A URL rewrite policy can also be executed within a service policy by adding a Header Rewrite
action to the policy header and referencing a URL rewrite policy.
PCRE refers to Perl-compatible regular expression. The match expression must be entered in this
syntax.
The five options available under URL Rewrite Type are:
• absolute-rewrite: Rewrites the entire body of the URL
• content-type: Rewrites the contents of the content-type header field
• header rewrite: Rewrites the contents of a specific HTTP header field
• post-body: Rewrites the data that is transmitted in the HTTP post body
TR-375528 *****
Student Notebook
The Stylesheet Replace Expression is used to specify a style sheet that transforms or filters a
document that is identified from a rewritten URL.
The Input URL Unescape is used to specify whether URL-encoded characters (that is, %2F) are
rewritten to literal character equivalents.
The Stylesheet URL Unescape is used to specify whether the style sheet identified in Stylesheet
Replace Expression is subject to literal character replacement of URL-encoded characters.
The URL Normalization field is used to enable normalization of URL strings (for example, '').
Optionally, if the URL Rewrite Type is header-rewrite, then a Header Name field is available to
specify a target HTTP header field.
A URL rewrite policy can also be specified at the action level for transform, validate, and header
rewrite actions.
TR-375528 *****
V10.1
Student Notebook
Uempty
XML Manager
• The XML Manager obtains and manages XML documents, style sheets,
and other resources on behalf of one or more services
– All services use the default XML Manager object
– Accessed from the navigation bar by clicking
Objects > XML Processing > XML Manager
Notes:
Click Objects > XML Processing > XML Manager to display the XML Manager objects list, which
provides the list of XML Managers that are currently configured, along with their configuration
details.
TR-375528 *****
Student Notebook
Notes:
Each XML Manager maintains a cache of compiled style sheets to facilitate wire speed XML
processing.
A load balancer group, or server pool, provides redundancy among back-end resources.
A user agent uses URL mappings to specify many options: proxy policies, SSL proxies, FTP client
options, and other options.
TR-375528 *****
V10.1
Student Notebook
Uempty
Notes:
The XSL proxy service does not have an XML threat protection tab.
“DoS” is “denial of service.”
XML Parser limits are as follows:
• XML Bytes Scanned: The maximum number of bytes scanned in one message by the XML
parser. “0” indicates no restriction.
• XML Element Depth: The maximum depth of element nesting.
• XML Attribute Count: The maximum number of attributes that are allowed within an XML
element.
• XML Maximum Node Size: The maximum size of an individual XML node in bytes.
• XML Maximum Distinct Prefixes: Defines the maximum number of distinct XML namespace
prefixes in a document.
• XML Maximum Distinct Namespaces: Defines the maximum number of distinct XML
namespace URIs in a document.
TR-375528 *****
Student Notebook
• XML Maximum Distinct Local Names: Defines the maximum number of distinct XML local
names in a document.
• XML External Reference Handling: To allow references in DTD to URLs outside the
appliance.
TR-375528 *****
V10.1
Student Notebook
Uempty
Figure 3-44. JSON document limits within the XML manager WE711 / ZE7111.0
Notes:
A JSON Settings object is selected to be attached to an XML manager. The JSON Settings choice
is on the Main tab of the XML manager page.
JSON Parser limits are as follows:
• Maximum label length: The maximum label length limits the number of characters in the label
portion of the JSON label-value pair. The length includes any white space that is contained
between quotation marks. Enter a value in the range 256 – 8192. The default value is 256.
• Maximum value length for strings: The maximum value length limits the number of
characters in the value portion of a label-value pair when the value is a string. The length
includes any white space that is contained between quotation marks. Enter a value in the range
8192 – 2097152. The default value is 8192.
• Maximum value length for numbers: The maximum number length limits the number of
characters in the value portion of a label-value pair when the value is a number. The number
must be a contiguous string of characters that contain no white space. The number can include
a minus sign and a positive or negative exponent. Enter a value in the range 128 – 256. The
default value is 128.
TR-375528 *****
Student Notebook
• Maximum nesting depth: The maximum nesting depth provides threat protection by limiting
the number of nested label-value pairs that are allowed in the JSON message. Enter a value in
the range 64 – 256. The default value is 64.
• Maximum document size: The maximum document size provides threat protection by limiting
the number of bytes in the body of the JSON message. If the message is converted to JSONx,
the maximum document size specifies the size before conversion to JSONx. Notice that the
document size of the JSON message and the size of the JSONx equivalent might differ. Enter a
value in the range 4194304 – 134217728. The default value is 4194304.
If no JSON Settings object is associated with a service’s XML manager, the default values are in
effect.
Because the XML parser is used in addition to the JSON parser when parsing a JSON document,
the more restrictive parser limits (JSON or XML) apply.
TR-375528 *****
V10.1
Student Notebook
Uempty
Notes:
Click Export to download a .zip file of the XML firewall configuration. The .zip file contains only
the configuration data and files of the selected XML firewall service.
Click Administration > Configuration > Export Configuration to have more control over the
objects and files that are exported.
Notice that there is also an Import Configuration.
TR-375528 *****
Student Notebook
Notes:
The system log displayed by the XML firewall is a filtered version of the main system log, and it
shows only the events that your XML firewall generates.
TR-375528 *****
V10.1
Student Notebook
Uempty
Unit summary
Having completed this unit, you should be able to:
• List the basic structural components of a service and describe their
relationships
• List the ways that a service configures its front-side access and back-
side connections
• Use the policy editor to configure a service policy
• Create a service policy with actions that process the client request or
server response
• List some of the processing actions and describe their function
• Configure service-wide settings such as:
– Service type: static back-end, dynamic back-end, and loopback proxy
– XML Manager
– URL rewriting
Notes:
TR-375528 *****
Student Notebook
Checkpoint questions
1. True or False: A service has a single policy with many rules, and
each rule has many actions.
Notes:
Write your answers here:
1.
2.
3.
4.
TR-375528 *****
V10.1
Student Notebook
Uempty
Checkpoint answers
1. True.
2. True.
3. False. Of the primary services that are presented, only the XML
firewall supports the loopback proxy mode. The loopback can be
simulated in the multi-protocol gateway and the web service proxy by
using a DataPower variable within the service policy.
4. B.
Notes:
TR-375528 *****
Student Notebook
Exercise 2
Notes:
TR-375528 *****
V10.1
Student Notebook
Uempty
Exercise objectives
After completing this exercise, you should be able to:
• Create a multi-protocol gateway
• Test the message flow by using the SoapUI graphical interface tool
Notes:
TR-375528 *****
Student Notebook
Exercise overview
DataPower
SoapUI student_domain
Request
BookingServiceProxy
Multi-Protocol Gateway
Reply
Uses
FLY_domain
Notes:
TR-375528 *****
V10.1
Student Notebook
Uempty
Unit 4. Multi-protocol gateway service
References
IBM DataPower Gateway Knowledge Center:
http://www.ibm.com/support/knowledgecenter/SS9H2Y_7.1.0
TR-375528 *****
Student Notebook
Unit objectives
After completing this unit, you should be able to:
• Configure a multi-protocol gateway to provide a service over a set of
different protocols
• Configure a connection to a static back-end service
• Configure a connection to a dynamic back-end by use of a processing
rule to select a back-end service at run time
Notes:
TR-375528 *****
V10.1
Student Notebook
Uempty
Notes:
TR-375528 *****
Student Notebook
LDAP
IAM
MQ: JMS: EMS: IMS
COBOL Copybook
Notes:
The Multi-Protocol Gateway service builds on the XML Firewall’s XML and security functionality by
adding support for multiple protocols. In addition to HTTP and HTTPS, the Multi-Protocol Gateway
supports MQ, JMS, Tibco EMS, FTP(S), SFTP, NFS, and IMS. All of these protocols can be mixed
and matched as necessary. For example, messages received over HTTPS can easily be routed to
MQ or JMS.
TR-375528 *****
V10.1
Student Notebook
Uempty
Notes:
MTOM is Message Transmission Optimization Mechanism. This W3C recommendation is for
vendor-neutral and platform-neutral attachments in the SOAP environment.
Raw XML messages begin and end with the root XML node over a TCP/IP connection; no headers
are included, as with HTTP.
For an overview of MQ messaging, review the MQ white paper, “The continuing benefits of
commercial messaging.” This paper can be found by entering the title for a search at:
http://www.ibm.com/e-business/linkweb/publications/servlet/pbi.wss
The TIBCO Enterprise Message Service product website provides a summary of its features at:
http://www.tibco.com
TR-375528 *****
Student Notebook
Handlers Description
FTP poller Polls a remote FTP server for input
Notes:
The FTP poller front side handler object polls inside the director for files from an FTP server. The
FTP server URL is specified as: ftp://user:password@host:port/path/path/
A regular expression can be used to restrict the files within the directory that are polled.
The FTP server front side handler object acts as a virtual FTP server. There is a limited amount of
storage on the DataPower appliance; hence, you should be careful when you are using this object.
The NFS poller is configured in a way that is similar to an FTP poller, except that it polls an NFS
server for input.
The IMS Connect handler enables communication between the appliance and an IMS Connect
server.
TR-375528 *****
V10.1
Student Notebook
Uempty
Notes:
Some protocol handlers appear only when you have the appropriate license on the appliance: for
example, MQ, JMS, and TIBCO EMS.
TR-375528 *****
Student Notebook
Multi-protocol gateway
HTTP
.
.
.
HTTP, HTTPS
MQ and more
MQ
Notes:
As the name suggests, a static back-end gateway maps exactly one back-end resource for all
requests that pass through the gateway. MQ, JMS, and TIBCO EMS resources require more
information to describe the back-end resource. The DataPower Appliance uses a custom syntax for
these resources.
TR-375528 *****
V10.1
Student Notebook
Uempty
HTTPS HTTPS
WebSphere
MQ
JMS
Stateless
FTP
raw XML
SFTP SFTP
Stateful Stateful
raw XML raw XML
IMS IMS
Connect Connect © Copyright IBM Corporation 2015
Notes:
The route action or a url-open within a style sheet specifies dynamic back ends.
With the stateful raw XML handler, the client sends a message by a stateful communication
protocol, such as an HTTP session. The handler preserves the session from the client to the
back-end service. For this reason, the stateful raw XML front side handler can be matched only with
the stateful raw XML back-end handler.
TR-375528 *****
Student Notebook
Figure 4-9. Multi-protocol gateway and XML firewall compared WE711 / ZE7111.0
Notes:
The multi-protocol gateway inherits most of the features from the XML firewall object. In a sense,
the gateway provides multiple front side and back-end handlers to the XML firewall. The only
exception is the loopback proxy feature.
Use the Advanced action to enforce a service level management (SLM) policy in a processing rule.
In the previous exercise, you used XML firewalls because they are easier to learn. If you had a
scenario with a more realistic environment, the services would be implemented as multi-protocol
gateways.
TR-375528 *****
V10.1
Student Notebook
Uempty
2 5
Notes:
The multi-protocol gateway inherits most of the XML firewall features. The following list explains
some new or modified settings that are specific to the multi-protocol gateway. For an explanation on
the remaining settings in the editor, see the XML firewall presentation.
1. Remember to click Apply to commit changes that are made in the editor.
2. Specify a name and a description for the multi-protocol gateway.
3. Specify whether the back-end service URL is defined at design time (static back end) or defined
at execution (dynamic back end). Keep in mind that the left side of the editor covers Gateway to
back-end settings, while the right side covers Client to gateway settings.
4. For a static back end, enter the endpoint address for the back-end service.
5. The XML Manager handles style sheet and document processing options. This setting is the
same as a regular XML firewall. In fact, the gateway can reuse an XML Manager that was
created for an XML firewall.
6. The Multi-Protocol Gateway Policy defines the rules in a document processing policy. The
processing rule actions are the same as the ones that are available to the XML firewall, with the
addition of the SLM policy action.
TR-375528 *****
Student Notebook
7. The Front Side Protocol section lists one or more front side handlers that are configured for
the gateway. You can either add an existing front side protocol handler or create a protocol
handler for the gateway.
The Propagate URI choice must be set to off for non-HTTP back-end protocols.
TR-375528 *****
V10.1
Student Notebook
Uempty
Multi-protocol gateway
HTTP
HTTPS HTTP
Figure 4-11. Scenario 1: Provide HTTP and HTTPS access WE711 / ZE7111.0
Notes:
In this scenario, the client can access the back-end service over a regular HTTP connection or a
secure HTTPS connection. The DataPower Appliance sits on the edge of the network; that is, the
connection between the gateway and the back-end service exists in the intranet. The connection to
the back-end service is made by an unsecured HTTP connection. For this scenario, assume that
communication between the DataPower appliance and the back-end service is secure in a
corporate intranet.
TR-375528 *****
Student Notebook
Figure 4-12. Step 1: Configure the back side transport WE711 / ZE7111.0
Notes:
To create a multi-protocol gateway, click New Multi-Protocol Gateway from the WebGUI Control
Panel.
The figure on this slide covers the left side of the main multi-protocol gateway editor.
TR-375528 *****
V10.1
Student Notebook
Uempty
Notes:
After you define a processing rule in the policy, click Apply to save the changes that are made in
the processing rule.
The Match action accepts calls with a particular URI path. The gateway automatically rejects any
request if it does not match any of the defined rules.
The Match action must be the first action on any processing rule. The Validate action appears after
the match rule.
The Results action directs the gateway to connect and send the message to the back-end service
or the original client.
TR-375528 *****
Student Notebook
Figure 4-14. Step 3: Create the front side handlers WE711 / ZE7111.0
Notes:
You can reuse front side protocol handlers that you created. However, you can associate the
handler with only one service (XML firewall, web service proxy, multi-protocol gateway, and other
services) at a time.
Usually, a new handler is automatically added to the protocol list after you configure the handler.
TR-375528 *****
V10.1
Student Notebook
Uempty
Figure 4-15. Step 4: Configure the front side handler WE711 / ZE7111.0
Notes:
The SSL Proxy setting is unique to the HTTPS Front Side Handler editor. It does not appear in the
HTTP Front Side Handler editor. All other options appear in both the HTTP and HTTPS front side
handler.
The DataPower appliance includes multiple Ethernet interfaces. Services can be mapped to one or
more interfaces on the appliance. For a list of all available Ethernet interfaces, click Network >
Interface > Ethernet Interface from the WebGUI.
TR-375528 *****
Student Notebook
1
2
3
Figure 4-16. Step 5: Configure the SSL proxy profile WE711 / ZE7111.0
Notes:
The SSL proxy profile defines a set of keys and certificates that the gateway uses to build an SSL
connection. The Forward (Client) Crypto Profile defines the keys and certificates that are used in
an SSL connection between the gateway and the back-end service. The Reverse (Server) Crypto
Profile defines a set of keys and certificates that are used to establish an SSL connection from the
client to the gateway.
Using the same crypto profile for the forward and reverse connections does not imply that the
service uses the same SSL connection in both connections. Only the keys and certificates are
shared; two distinct SSL connections are used for each side of the gateway.
TR-375528 *****
V10.1
Student Notebook
Uempty
Multi-protocol gateway
HTTP HTTP
HTTPS
HTTP
Notes:
The dynamic back-end service allows one endpoint on the DataPower appliance to represent a
single service, which is composed of different operations from different back-end services.
The diamond in the middle of the multi-protocol gateway diagram represents a decision point. One
or more processing rules define the actual back-end service for each incoming request. The
decision itself to choose one endpoint over another occurs at execution.
TR-375528 *****
Student Notebook
Notes:
The following steps assume the multi-protocol gateway was created according to the first scenario.
The actual back-end service is defined by a custom style sheet in a processing rule.
TR-375528 *****
V10.1
Student Notebook
Uempty
<xsl:output method="xml"/>
<xsl:template match="/">
<xsl:copy-of select="."/>
<dp:set-target>
<host>address.training.ibm.com</host>
<port>9080</port>
</dp:set-target>
</xsl:template>
</xsl:stylesheet>
Figure 4-19. Sample service that targets a style sheet WE711 / ZE7111.0
Notes:
The <dp:set-target> built-in element defines the IP address (or host name) and the port for a
particular back-end server. Other attributes are available to set up an SSL connection to the
back-end service.
This style sheet example matches any incoming message to one particular endpoint. In a real-world
scenario, different template match rules would trigger different <dp:set-target> settings.
You can also use a url-open element in a style sheet to communicate to a specific back-end
service.
TR-375528 *****
Student Notebook
Multi-protocol gateway
HTTP
HTTPS MQ queue
manager
MQ
MQ queue
manager
Notes:
There is no requirement to use MQ in both the front side and the back side. The multi-protocol
gateway can act as an HTTP-to-MQ message converter, and the reverse.
TR-375528 *****
V10.1
Student Notebook
Uempty
HTTP MQ client
Notes:
MQ and Application Server are separate products that both support asynchronous messaging.
The Application Server platform messaging engine maintains a set of queues that process
asynchronous messages.
TR-375528 *****
Student Notebook
Notes:
OTMA is Open Transaction Management Access.
The IMS OTMA facility is a transaction-based connectionless client/server protocol that runs on
IMS Version 5.1 or later. It functions as an interface for host-based communications servers that
access IMS TM applications through the z/OS Cross Systems Coupling Facility (XCF).
IMS Connect communicates to OTMA by XCF.
TR-375528 *****
V10.1
Student Notebook
Uempty
DataPower
Web services
WSP
interface
RESTful
MPGW
interface
Notes:
For a presentation of REST and DataPower, see: Implementing REST services with DataPower
Appliances at: http://www.ibm.com/developerworks/websphere/techjournal/0903_peterson/
0903_peterson.html
Check developerWorks for more DataPower articles, and search the DataPower Information Center
for REST support.
TR-375528 *****
Student Notebook
Notes:
Process Messages whose body is empty option: Useful for RESTful message patterns in which
some message flows might not incorporate a body but multi-step rules still need to run. It bypasses
the built-in “One Way Exchange Pattern” in multi-step.
Matching Rule type HTTP Method: Supports a processing rule that matches on the HTTP
method: HEAD, DELETE, PUT, POST, and GET.
HTTP Method on dp:url-open: Allows control of the HTTP method on a dp:url-open.
Method Rewrite Advanced Processing action: Rewrites HTTP method requests to the back end.
Method Rewrite by Set Variable action: Another way to rewrite the HTTP method.
JSON encoding in Convert HTTP action: Automates the conversion of JSON passed in a RESTful
request to an XML representation called JSONx. There is also a style sheet to convert JSONx into
JSON.
JSON Choice for request/response types: Another request and response type of JSON is added.
TR-375528 *****
V10.1
Student Notebook
Uempty
Application
———
Response rule TPIPE ICAL
(one or more (synchronous)
RESPONSE actions)
Multi-Protocol Gateway
Notes:
IMS Synchronous Callout support is a feature for allowing IMS to consume an external service
through DataPower. By defining an IMS Callout Front Side Handler to DataPower MPGW, an IMS
application can initiate synchronous calls to an external service through DataPower following the
IMS Call (ICAL) protocol. The ICAL protocol enables an application program that runs in an IMS
technology-dependent region to synchronously send outbound messages to request services or
data, and receive responses.
For synchronous callout requests, an IMS application program issues a DL/I ICAL call and waits in
the dependent region to process the response. DataPower retrieves the callout request, processes
it based on the rules and actions that are defined in the MPGW policy, and sends it out to the
back-end service. In a similar manner, the response is flown back and processed through the
MPGW. The figure here illustrates the callout inbound and outbound flow through DataPower.
TR-375528 *****
Student Notebook
Notes:
Typical uses include:
• An IMS Connect proxy to IMS Connect clients: Existing IMS Connect clients can use this
feature to make in-flight modifications to headers and payloads without changing the client or
IMS.
• Web service facade to IMS Connect transactions: Organizations can use the web service
features in DataPower to quickly enable web service support for IMS Connect.
TR-375528 *****
V10.1
Student Notebook
Uempty
WebSocket Proxy (1 of 2)
• WebSocket is a bidirectional frame-based protocol for enabling real-
time communication over supporting HTTP or HTTPS infrastructure
– Designed to enable real-time applications such as: Messaging over the WEB,
Chat Applications, Video Applications, Notifications, and other applications
• Use DataPower to secure, route, shape, and load-balance initial
WebSocket connection establishment
DataPower Appliance
WebSocket client WebSocket server
Notes:
This slide shows full-duplex, bidirectional, and low-latency communication for web and mobile
applications.
TR-375528 *****
Student Notebook
WebSocket Proxy (2 of 2)
• Apply DataPower policy actions until and including WebSocket upgrade
request over HTTP or HTTPS
– After upgrade request is accepted, DataPower simply proxies the client and
server communication
• Example: Chat applications that use WebSockets require client
authentication and connection throttling
– Use DataPower AAA to authenticate and authorize client credentials and SLM to
enforce connection concurrency
Network HTTP
infrastructure upgrade:
WebSockets MPGW
HTTP
HTTP AAA, SLM, HTTP,
HTTPS
FSH and more HTTPS
WebSocket
HTTP
WebSockets proxy
HTTPS
DataPower Gateway (pass-thru)
FSH Appliance
WebSocket
© Copyright IBM Corporation 2015
Notes:
This slide shows full-duplex, bidirectional, and low-latency communication for web and mobile
applications.
TR-375528 *****
V10.1
Student Notebook
Uempty
Comparing services
• Select a Web Service Proxy when working with WSDLs
– Web service virtualization, service policy definition by operation, and service
level management by operation are easier to define by using this service type
Notes:
TR-375528 *****
Student Notebook
Unit summary
Having completed this unit, you should be able to:
• Configure a multi-protocol gateway to provide a service over a set of
different protocols
• Configure a connection to a static back-end service
• Configure a connection to a dynamic back-end by use of a processing
rule to select a back-end service at run time
Notes:
TR-375528 *****
V10.1
Student Notebook
Uempty
Checkpoint questions
1. True or False: With a dynamic back-end, the multi-protocol gateway
relies on a custom style sheet action within a processing rule to
configure the back-end destination. It is up to the developer to create the
custom style sheet.
2. True or False: A multi-protocol gateway (MPGW) service can be
configured with an IMS Connect back side handler to receive a request
from a client, process it, and send it to IMS Connect.
3. Which scenarios are better suited for a multi-protocol gateway as
opposed to a web service proxy?
Description Definition
1. Multi-protocol gateway A. WSDL
2. Web service proxy B. Service Registry and Repository
concepts
C. Multiple front side handlers
D. Easy service level rule configuration
E. MQ integration
© Copyright IBM Corporation 2015
Notes:
Write your answers here:
1.
2.
3. (1)
(2)
TR-375528 *****
Student Notebook
Checkpoint answers
1. True.
2. True.
3. 1 – C and E.
2 – A, B, and D.
Notes:
TR-375528 *****
V10.1
Student Notebook
Uempty
Unit 5. Problem determination tools
References
IBM DataPower Gateway Knowledge Center:
http://www.ibm.com/support/knowledgecenter/SS9H2Y_7.1.0
TR-375528 *****
Student Notebook
Unit objectives
After completing this unit, you should be able to:
• Capture information by using system logs for messages that pass
through the DataPower appliance
• Configure a multi-step probe to examine detailed information about
actions within rules
• List the problem determination tools that are available on the
DataPower appliance
Notes:
TR-375528 *****
V10.1
Student Notebook
Uempty
Notes:
TR-375528 *****
Student Notebook
• CPU usage
– Displays percentage of CPU usage
– Status > System > CPU Usage
• System usage
– Displays load and work queue status
– Status > System > System Usage
Notes:
It is a good practice to check the appliance file system memory for available space. The logging
system can fill up the available file storage space, which can prevent the system from writing log
entries. This situation prevents the system from processing messages.
Temporary Space is used for processing, logging, and debugging.
Internal Space is used for import, export, firmware upgrades, and debug data.
System Usage indicates the current load on the server and the length of the work queue. If the
server suddenly slows down or becomes unresponsive, the cause might be system usage. If the
system has a throttle in place, the high memory usage (load) might be causing the throttle to refuse
connections.
TR-375528 *****
V10.1
Student Notebook
Uempty
Troubleshooting
The Troubleshooting page contains the following tools:
• Ping Remote
– Pings a remote host address
• TCP Connection Test
– Creates a TCP connection to remote endpoint
• Packet Capture (default domain only)
– Captures network packets to and from the appliance
• View System Log and generate log messages
– Specifies log level of messages to record
– Generates log messages for testing log targets
• Error Report
– Includes the running configuration and relevant system log entries for errors
– Emails error report to an email address
• XML File Capture (default domain only)
– Captures inbound XML files that are submitted to the appliance
• Probe
– Enables or disables probes on services
© Copyright IBM Corporation 2015
Notes:
The best tool to use first when a problem occurs often depends on how the appliance is being used
at the time.
During the development phase, the default system log is often the best place to start, followed by
use of the multi-step probe.
During the testing phase, generating an error report (which contains the running configuration of the
appliance and the relevant log entries) is an excellent first step, followed by use of the multi-step
probe.
During the production phase, first check the system usage for load and work lists and then check
the object status for objects that are changed to the down state. Finally, check the default system
log.
Include a generated error report to DataPower support.
TR-375528 *****
Student Notebook
Troubleshooting: Networking
• Use the Ping Remote tool to • Use the TCP Connection Test to
test connectivity to a remote test connectivity to a remote
host destination
– Enter IP address or host name
– Enter IP address or host name
and click Ping Remote
– Optionally, enter the IP version – Enter the port number
to use – Click TCP Connection Test
– The default is IPv4
Notes:
Ping Remote allows DataPower to ping a host system. Using ping confirms that there is network
connectivity to the host IP address that the DataPower appliance is attempting to reach.
The TCP Connection Test confirms that DataPower can reach the IP address and the port. This
step is useful to confirm whether a service is running remotely or not. For example, you can use
TCP Connection Test with the IP address of WebSphere Application Server and port 9080 to
confirm that the server is up and running on the remote host.
TR-375528 *****
V10.1
Student Notebook
Uempty
Notes:
In the Troubleshooting web page, scroll down to the packet capture section. Click the Packet
Capture icon to begin the capture. A dialog box confirms the action. When the capture is complete,
a Download Packet Capture icon appears on the Troubleshooting page.
You can control the network interface to monitor the duration of monitoring and the number of KB
that can be captured.
DataPower support expects the pcap format when a PMR is opened.
Before installing a packet capture tool, such as Wireshark (formerly called Ethereal), make sure that
you have the necessary permission from your network staff.
Restarting the device automatically turns off packet capture.
TR-375528 *****
Student Notebook
Troubleshooting: Logging
• Use Set Log Level to set the log level for the current domain
• Use Generate Log Event to verify that log targets are active and able
to capture events
Notes:
Setting the log level to DEBUG is helpful during development but it affects processing. Therefore,
DEBUG mode should not be used in production.
Generate Log Event is used to test out a log event and a log target that are configured.
TR-375528 *****
V10.1
Student Notebook
Uempty
Notes:
The highest priority is emergency and the lowest priority is debug.
The target captures messages only at or above the configured level. For example, the error level
captures messages at the error, critical, alert, and emergency levels. To capture all messages, set
the log level to debug.
Setting the level to either info or debug causes a blue Troubleshooting Enabled notice to appear
on all WebGUI pages.
Here are log levels of the default system log:
• emergency: An emergency-level message. The system is unusable.
• alert: An alert-level message. Immediate action must be taken.
• critical: A critical message. Immediate action must be taken.
• error: An error message. Processing might continue, but action should be taken.
• warning: A warning message. Processing should continue, but action should be taken.
• notice: A notice message. Processing continues, but action might need to be taken.
TR-375528 *****
Student Notebook
TR-375528 *****
V10.1
Student Notebook
Uempty
Notes:
The system log is defined as a log target. A log target receives log entries that DataPower objects
generate. Each domain always has a log target that is called default-log to represent the default
system log. More log targets can be defined and customized with the log entries from objects to
post.
The most recent log entries are shown at the top of the system log.
The logs can be sorted by the categories that are listed at the top.
TR-375528 *****
Student Notebook
Notes:
The Generate Log Event tool is used to test the configuration of a newly created log event and log
target.
TR-375528 *****
V10.1
Student Notebook
Uempty
Troubleshooting: Reporting
• Generate Error Report
– Error report is required when engaging with IBM DataPower support
– Error report file is created in the temporary: directory
• Error Report contains:
– Current configuration
– Current contents of the system log
– Contents of CLI log
• Send Error Report:
– DataPower uses an external mail server (SMTP) to email the error report to a
specific email recipient
Notes:
Click Generate Error Report. A dialog box asks for confirmation and indicates the location of the
resulting file.
If an error report is available, an icon appears that allows immediate access to the file.
TR-375528 *****
Student Notebook
Troubleshooting: Advanced
• Use XML File Capture to allow the configuration of system-wide file-
capture mode
– The file capture facilitates the visibility of erroneous XML and XSLT
content
• Use View Running Config to view the configuration of all the objects
that are currently in memory
Notes:
TR-375528 *****
V10.1
Student Notebook
Uempty
Notes:
XML File Capture sets the configuration of system-wide file-capture mode. The file capture
facilitates the visibility of erroneous XML and XSLT content.
TR-375528 *****
Student Notebook
Notes:
Using the Send a test message tool versus cURL:
The test message tool is a quick and useful tool for creating SOAP requests, and it can be used in
place of open source tools like cURL. However, when using the test message tool, you cannot
upload a file to the DataPower box to send; you need to copy and paste text. You also cannot
persist the test message after it is created. The advantage of using tools like cURL is that it can
send files directly from the file system.
TR-375528 *****
V10.1
Student Notebook
Uempty
1 4
2 3
Probe Probe
disabled Probe enabled disabled
Time
Notes:
In the diagram on the slide, four messages are sent to the probe. Only message 2 and message 3
are captured. The probe functions like a recorder. When the probe is enabled, it starts recording
messages that enter the appliance. When the probe is disabled, recording is stopped and the probe
stops capturing messages.
The multi-step probe can be used to view:
• Action execution trace
• Message content
• Header values
• Attachments
• Variable values (local, context, global, service)
TR-375528 *****
Student Notebook
Notes:
Probes are enabled for the following services:
• XSL proxy and XSL coprocessor
• B2B gateway
• XML firewall
• Multi-protocol gateway
• Web service proxy
• Web token service
• Web application firewall
TR-375528 *****
V10.1
Student Notebook
Uempty
Notes:
The multi-step probe window opens with the probe disabled when you enable the probe from the
service configuration page.
Rules that generate an error while executing are displayed in red text inside the multi-step probe
window.
Clicking Flush clears the requests inside the multi-step probe window.
Restarting the appliance disables all probes.
TR-375528 *****
Student Notebook
Notes:
1. The row of actions across the top show what executed in the rule. The magnifying glass to the
left of the action represents the input message. The magnifying glass to the right of the action is
the result of executing that action. When you click a particular magnifying glass, the contents of
the rest of the page changes to the state at that point in the processing. The square brackets
around the magnifying glass indicate which one is selected. You can also click Next and
Previous to view the message step-by-step as it is executed from the processing rule.
2. The default tab that is displayed is the Content tab. The tab renders the message contents if it
can.
3. Other tabs are available to show more state that is associated with the message processing at
the selected point in the rule.
The local, context, global, and service variables are DataPower variables that are generated from
the appliance.
TR-375528 *****
V10.1
Student Notebook
Uempty
Debugging GatewayScript (1 of 4)
• To activate the GatewayScript debugging, two conditions must be met:
í Debugging must be enabled in the GatewayScript action
í The script that is invoked in the GatewayScript Action must contain a
“debugger;” statement
Debugger
statement
Enable/Disable
button
Notes:
To activate the GatewayScript debugger, two conditions must be met. The first condition requires
the GatewayScript debugging to be enabled. GatewayScript debugging is enabled by clicking
Enable Debug in the configuration screen of the GatewayScript action. The enable-disable button
is highlighted in the image on the left side of this slide.
The Debug button does not persist during a domain or appliance reboot. Therefore, if the button
was enabled, and the appliance is rebooted, the button is in a disabled state after the reboot.
The second condition that must be met requires the syntax of the GatewayScript code to contain
the debugger statement. An example is represented in the image that is on the right side of the
screen.
TR-375528 *****
Student Notebook
Debugging GatewayScript (2 of 4)
• The flow of a transaction is paused indefinitely
í The GatewayScript processing breaks at the “debugger;” line
í A maximum of 10 debug sessions are in progress at any time
í Use “show debug-actions” (in config mode) to find available sessions to
debug
Notes:
This screen capture image is an example of what you would see and how you would figure out how
to begin the debugger. There is status with the name debug-actions. When debugging is enabled,
and a debugger statement exists in the GatewayScript script, a “show debug-actions” message
shows the debug requests.
The GatewayScript execution breaks at the debugger statement. You might have up to 10 debug
sessions in progress at one time. The scope of the maximum debug sessions is per appliance (not
per domain).
• The session ID is used to identify which debug session you want to work with.
• The transaction ID is the ID of the transaction.
• The service name is the name of the service.
• The file location is the actual location of the script file that is being paused.
• The remote address is the address of the client.
In Use represents whether someone else is debugging the session. Currently, joint debugging is
not allowed, so if In Use is set to Yes, you cannot debug this session.
TR-375528 *****
V10.1
Student Notebook
Uempty If In Use is Yes, then the following fields contain data that represents the user currently debugging
the session:
• User: The user currently debugging the session
• User location: IP address of the user
• Elapsed time: The amount of time that the transaction remains the debugger
TR-375528 *****
Student Notebook
Debugging GatewayScript (3 of 4)
• Enter the CLI debugger – GDB-like interface
í Must be in config mode in the domain where the action executed
í debug-action <session ID>: Enter the CLI debugger until the script
completes
Notes:
The GatewayScript debugger is similar to the GNU Project debugger (GDB), which shows what is
going on inside another program while it is running.
The debug-action must be executed from within the domain that is being debugged, and from within
configuration mode (use the CLI co command).
The previous slide showed a debug session ID of 85. This image shows how you enter a debugging
session, by executing a debug-action and the session ID: debug-action 85
What you are going to see, as represented on the image, is that the debugger shows a listing of the
code around the debug statement. The debug listing includes line numbers and an arrow =>
pointing to the debug statement.
In the debugger, many commands can be executed, such as step-into, step-over, and other
commands. The debugger commands are listed on the next slide.
TR-375528 *****
V10.1
Student Notebook
Uempty
Debugging GatewayScript (4 of 4)
Debugging commands:
• List source code
– list(l) [number of lines]
• Breakpoints
– break (b) <line | script.js:line | function()>
– delete (d) <identifier | all>
– info break (ib)
• Print variable values
– print (p) <variable>
• Explore stack trace
– backtrace (bt)
• Program execution control
– continue (c)
– next (n) [count]
– step (n) [count]
– out (o) [count]
– quit (q)
© Copyright IBM Corporation 2015
Notes:
This slide includes a list of some of the GatewayScript debugging commands that the debugger
supports.
For more detailed information, see the “GatewayScript debugger commands” section in the
DataPower Knowledge Center.
TR-375528 *****
Student Notebook
Notes:
The -v verbose flag produces much information in the output. It allows the user to see all of the
client and server interaction.
TR-375528 *****
V10.1
Student Notebook
Uempty
Notes:
TR-375528 *****
Student Notebook
Logging basics
• Logging system is based on the publish/subscribe model
– Objects publish events
– Subscribers subscribe to events of interest
Notes:
Log files can be encrypted or signed for more security.
Objects that generate log messages have different priorities. These messages range from verbose
debugging to infrequent critical or emergency level messages.
TR-375528 *****
V10.1
Student Notebook
Uempty
Log targets
List of log levels for the system log:
• emergency: System is unusable
• alert: Take immediate action
• critical: Critical condition
• error: An error occurred
– The error code is included
• warning: A warning condition
occurred
– Nothing might be wrong, but
conditions indicate that a problem might occur soon if nothing changes
• notice: A normal but significant condition applies
• information: An informational message only
• debug: Debug-level messages
– This level generates many messages
Notes:
TR-375528 *****
Student Notebook
Finance
log target Publish
Event3 AAA
© Copyright IBM Corporation 2015
Notes:
The diagram in the slide shows 2 log targets: HR and Finance log targets. These log targets
subscribe to certain types of events that are generated or published from objects on the DataPower
appliance.
Use the Generate Log Event tool in the Troubleshooting pane to test whether log targets capture
the log messages.
TR-375528 *****
V10.1
Student Notebook
Uempty
Notes:
The Event Subscription tab is not visible in the screen capture.
Log targets capture messages that are posted from the various objects and services that are
running on the appliance. Target types enable more capabilities that include rotating files,
encrypting and signing files or messages, and sending files to remote servers.
TR-375528 *****
Student Notebook
Notes:
The log entries that are stored on a local or NFS file can be rotated, emailed, or uploaded to other
locations. The entire file can also be encrypted and signed.
SNMP is a network protocol that allows for the exchange of management information between
network devices. This protocol is included in the TCP/IP protocol suite.
Syslog is the format and protocol that is used to send messages over TCP or UDP to a Syslog
daemon (syslogd). It allows for log messages to be collected from many applications.
Syslog-NG (New Generation) is being depreciated. Use syslog-tcp in place of syslog-ng.
TR-375528 *****
V10.1
Student Notebook
Uempty
Event filters
• On the Configure Log
Target page, click the
Event Filters tab
• Event filters create filters
for a log target that are
based on event codes
– Use the Event
Subscription Filter to
subscribe to specific
event codes
– Use the Event
Suppression Filter to
exclude certain event
codes from being written
to the log target
– Click the Select Codes
button to add event codes
to Event Code value list
© Copyright IBM Corporation 2015
Notes:
You can subscribe the current log target to particular event code categories. Example event codes
include out of memory, failed to install on local port, and other codes.
These event codes are event conditions that are specific to DataPower.
TR-375528 *****
Student Notebook
Object filters
• On the Configure Log Target page, click the Object Filters tab
• Object filters allow only those messages that selected objects generate
to be written to a log target
• It is possible to create a log target that collects log messages for a
particular class of objects
– Example: AAA policy object called MyTest
Notes:
The object filter is more specific than the object class name. This filter collects log messages of an
instance of a class.
For example, a log target would collect messages from an XML firewall that is named MyFirewall
and not all XML firewall instances.
TR-375528 *****
V10.1
Student Notebook
Uempty
Event subscriptions
• On the Configure Log Target page, click the Event Subscriptions tab
Notes:
Event categories is the same term that is used to describe an object class name.
At least one event category must be defined for a log target to capture messages.
TR-375528 *****
Student Notebook
Log action
The Log action sends the
contents of the Input
context to a destination
URL
• Is used to log entire
message instead of
creating a log entry
• Configure:
– Destination: Must be a
valid URL to either a
local file or a remote
destination
– Log Level: Event
category
– Log Type: Log priority
– Method: HTTP method
of POST, PUT, or
DELETE © Copyright IBM Corporation 2015
Notes:
If you want to capture the message payload (the data in the message), a Log action must be used.
TR-375528 *****
V10.1
Student Notebook
Uempty
Unit summary
Having completed this unit, you should be able to:
• Capture information by using system logs for messages that pass
through the DataPower appliance
• Configure a multi-step probe to examine detailed information about
actions within rules
• List the problem determination tools that are available on the
DataPower appliance
Notes:
TR-375528 *****
Student Notebook
Checkpoint questions
1. True or False: To test a Log Event, you would use the Generate Log
Event option in the troubleshooting pane to generate a log message,
and verify that it is included or excluded in a log target.
2. A client cannot connect to the XML firewall service. Select the best
steps to troubleshoot this problem.
A. Check the client URL and Object status (and possibly TCP connection test).
B. Ping the DNS to validate the proper XML firewall service. Check the back
side connection.
3. Logs can be stored off-device by using (select five):
A. SMTP
B. SOAP
C. NFS
D. syslog-ng
E. daemon
F. syslog
G. POP
© Copyright IBM Corporation 2015
Notes:
Write your answers here:
1.
2.
3.
TR-375528 *****
V10.1
Student Notebook
Uempty
Checkpoint answers
1. True.
2. A.
3. A, B, C, D, and F.
Notes:
TR-375528 *****
Student Notebook
Exercise 3
Notes:
TR-375528 *****
V10.1
Student Notebook
Uempty
Exercise objectives
After completing this exercise, you should be able to:
• Perform advanced configuration of an MPGW
• Configure a document processing policy with more actions
• Test the MPGW policy by using the graphical SoapUI tool
• Perform basic debugging by using the system log
Notes:
TR-375528 *****
Student Notebook
Exercise overview
DataPower
SoapUI student_domain
Request
BookingServiceProxy
Multi-Protocol Gateway
Reply
Uses
FLY_domain
Notes:
TR-375528 *****
V10.1
Student Notebook
Uempty
Unit 6. Handling errors in a service policy
References
IBM DataPower Gateway Knowledge Center:
http://www.ibm.com/support/knowledgecenter/SS9H2Y_7.1.0
© Copyright IBM Corp. 2015 Unit 6. Handling errors in a service policy 6-1
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Unit objectives
After completing this unit, you should be able to:
• Configure an error policy
• Configure an On Error action in a service policy
• Configure an error rule in a service policy
• Describe how On Error actions, error rules, and error policies are
selected during error handling
Notes:
TR-375528 *****
V10.1
Student Notebook
Uempty
Notes:
Error handling constructs are used to handle errors that occur during execution of a service policy.
© Copyright IBM Corp. 2015 Unit 6. Handling errors in a service policy 6-3
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Processing Policy
z
z
z
Processing Rule #N Match Processing
Processing Processing
[Req | Rsp | Both | Error] Action Action #1#1 z
Action zz Action #N
Notes:
Error rules are executed only when an error occurs during processing.
Error Code: A match template that matches against specific error codes that might be raised by
previously executed processing rules.
TR-375528 *****
V10.1
Student Notebook
Uempty
Notes:
To configure an On Error action, run the following steps:
1. Drag the Advanced icon to the rule configuration path.
2. Double-click the Advanced icon.
3. On the Configure Action page, select On Error and click Next.
4. Configure the On Error action and click Done.
The Error Input and Error Output context in an On Error action provide the context for the
actions within the error rule (if selected).
5. Use the context OUTPUT in the Error Output field to return the error message to the client.
© Copyright IBM Corp. 2015 Unit 6. Handling errors in a service policy 6-5
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Notes:
The rule directionality (request or response) does not apply to an error rule; it can run on either the
request or the response rule.
TR-375528 *****
V10.1
Student Notebook
Uempty
Use the
Transform action
to build custom
error messages in
an error rule
• Transforms error
messages that
the appliance
generates into
custom error
messages
Notes:
© Copyright IBM Corp. 2015 Unit 6. Handling errors in a service policy 6-7
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Figure 6-7. Style sheet programming that use error variables WE711 / ZE7111.0
Notes:
The example log message that is generated in the slide has a log priority of error with the class
name ws-proxy. The log message that is generated contains the contents of the variable errtest.
The variable that is listed in the slide can also be viewed when you are running the multi-step probe
by clicking the Service Variables tab.
A log target can gather messages that use the dp:type attribute in the <xsl:message> tag,
enabling user-defined debug messages to be captured in logs.
TR-375528 *****
V10.1
Student Notebook
Uempty
Notes:
This example style sheet includes some common DataPower extension functions that can be used
when building a custom error message.
The service variables that are shown are also visible in the multi-step probe.
This style sheet is only a template of an actual error style sheet. A custom error style sheet can
customize the amount of detail to include in an error message.
© Copyright IBM Corp. 2015 Unit 6. Handling errors in a service policy 6-9
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Notes:
TR-375528 *****
V10.1
Student Notebook
Uempty
Error Policy
• The Error Policy is a fallback error handler that is used when there is
an unhandled error in a multi-protocol gateway transaction
• The Error Policy is available as a configurable property in multi-protocol
gateway (MPGW) service
– Matching rules must be defined
– Error Actions must be defined to handle errors in an HTTP or HTTPS request
flow
• The Error Policy allows for:
– Customization of the default error response for non-SOAP/non-XML web
applications while the MPGW used to return SOAP fault
– Customization of a default error response (instead of the traditional default
SOAP fault) for replying to your non-SOAP or non-XML client applications in a
simpler manner
– Fallback for an error that is not successfully handled with any precedent error
handlers (such as multistep error rule)
Notes:
In DataPower firmware release 6.0.0, a new Error Policy is introduced to the multi-protocol gateway
(MPGW) service. Its principal function is being a fallback error handler. If there is an error in the
MPGW transaction that any precedent error handler did not successfully handle, the new Error
Policy is executed to generate the final error response.
The reasons for the new feature are described as follows.
Before Release 6.0.0, the MPGW service tended to return a SOAP fault to the client as the default
error response. This setting is not an optimal default setting for non-SOAP or non-XML clients; for
example, for the MPGW as a web proxy, the client might expect an HTML page to highlight the error
cause and suggestions.
Regarding existing error handlers, today the primary error handler to customize the error response
is the multistep error rule that is either designated by an On Error action or fired by a matching
procedure. Also, you can manipulate the generation of an error response by using service variables
(for example, var://service/error-message, subcode).
However, even the multistep error rule might not complete, and when it fails, the client still receives
the default SOAP fault message. You can use the new Error Policy when there is no error handler
© Copyright IBM Corp. 2015 Unit 6. Handling errors in a service policy 6-11
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
(such as multistep error rule) or the precedent error handler fails. By using the new Error Policy, you
can have a fallback to generate the error response (such as an HTML, a plaintext, an XML, or
whatever) to the client based on the request’s content type.
TR-375528 *****
V10.1
Student Notebook
Uempty
Notes:
You can benefit from the new Error Policy in various situations:
• You are running the web business upon the MPGW service and want to have a customizable
default error response that is based on the runtime request’s content type (rather than the
SOAP fault message).
• You are developing a new MPGW service and do not need a complex error handling logic
(including many actions that are involved in the multistep error rule) to generate the error
response. For example, in a circumstance when you need to respond with an HTTP URL
redirection without a complex error rule configuration, then the Error Policy is a convenient and
effective way for this purpose.
• You implemented error handling logics upon the multistep error rule, and you are now able to
use the new Error Policy as a fallback error handler if the multistep error rule fails.
© Copyright IBM Corp. 2015 Unit 6. Handling errors in a service policy 6-13
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Notes:
The next three slides explain the following concepts: the required configurations to enable the new
Error Policy, the preconditions when the Error Policy is started, and the expected output when the
Error Policy is used for generating the error response.
For configurations, you can see the new property “Error Policy” under the Advanced tab in a
Multi-Protocol Gateway configuration. To enable the Error Policy for generating the response for an
MPGW error, you need to specify it with an existing “Multi-Protocol Gateway Error Policy” object.
This object is a new type of object that this enhancement introduces. You implemented error
handling logics on the multistep error rule, and you are now able to use the new Error Policy as a
fallback error handler if the multistep error rule fails.
TR-375528 *****
V10.1
Student Notebook
Uempty
Multi-protocol
gateway
Request flow
MyService
SOAP,
Front side
Back side
XML, Processing policy
handlers
handlers
protocol
protocol
Binary, (request,
HTTP, JSON, response, and
HTTPS and more
error rule) Back end
clients
Notes:
The required conditions for the new Error Policy to be run include:
• The MPGW transaction is initiated from an HTTP or HTTPS request that represents a web
gateway flow. The back-end system can be any type.
• An error is occurring in one of the following areas:
- The front side (for example, header parsing failure in the front side)
- Request processing (for example, the Encrypt action in a request rule fails)
- Back-end server (for example, failure to establish a connection to the back-end server)
- Response processing (for example, the Filter action rejects the invalid response)
• The multistep error rule, which might be designated by an On-Error action or a Policy Maps
matching procedure, is used for handling the error. But neither of them is completed
successfully. Or, there is not any error rule to handle the original error.
When the previous conditions are true, any precedent error handler does not handle the error.
Under these conditions, the situation of “unhandled error” occurs, which requires a fallback.
© Copyright IBM Corp. 2015 Unit 6. Handling errors in a service policy 6-15
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
For example, you have the error rule that the On-Error action invokes, and it fails. Then, the
multistep processing rule matching selects the error rule to process, and the matched error rule
also fails. Then, it is time to start the new Error Policy.
TR-375528 *****
V10.1
Student Notebook
Uempty
Note: If no matching rule is satisfied or the Error Action fails during its execution
– for example, if a connection to the proxy URL cannot be established – then the
default SOAP fault is returned to the client.
Notes:
When the Error Policy is executed, it evaluates the Matching Rules, selects, and runs the first
matched Error action. At the end, it returns the result to the HTTP or HTTPS client.
If an error occurs during the Error action execution – for example, it fails to fetch the page from the
specified URL – then it returns the default SOAP fault to the client.
In the following situations, the Error Policy is not used for generating the response:
• You actively create the transaction failure by using the dp:send-error extension function with
the specified response message.
• You enable the Padding Oracle Protection setting under the XML Threat Protection tab so
that the response message is obscured.
© Copyright IBM Corp. 2015 Unit 6. Handling errors in a service policy 6-17
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Notes:
Multi-Protocol Gateway Error Policy is a new type of configuration object to be bound to the
Multi-Protocol Gateway’s property “Error Policy.”
It contains an ordered list of Matching Rule with Error action so that you can define at which
particular condition (the Matching Rule evaluates) to run which Error action for generating the
response.
Like the Processing Policy’s definition, the Policy Maps evaluate the Matching Rule in order. So the
screen capture presents a useful exemplary configuration for the matching strategy; it works as
follows:
• For any XML request (matched by Content-Type “*xml*”), the associated error map is called if
there is an XML match.
• For any HTML request (matched by Content-Type “*html*”), the associated error map is called
if there is an HTML match.
• If none of the defined matching rule is evaluated to be true, then the associate map is called for
all other “non-matching” conditions.
TR-375528 *****
V10.1
Student Notebook
Uempty
• Multi-protocol gateway
provides four modes:
– Error rule
– Proxy (remote)
– Redirect
– Static (local)
• Decide which mode to use
and configure Response
Code, Reason Phrase, and
Header Injection to
override the current
values to be returned to
the client
Notes:
The Multi-Protocol Gateway Error Action is the other new type of configuration that is introduced by
the feature. Currently, it provides four modes to produce the response message:
• The Error Rule mode indicates that the appliance runs the specified processing rule and
returns its output to the client. You can choose the processing rule only with rule direction
“Error.” In this “error rule”, you can define how the error is handled (such as logging and
rewriting the service variables). You can also add, modify, or delete a response header by using
the header-related extension functions in the processing rule.
• The Proxy (Remote) mode means that the appliance fetches the data from the specified
remote HTTP or HTTPS URL and returns the response message to the client.
• The Redirect mode indicates that the appliance sends an HTTP redirection to the client with
“307 Redirect,” and the “Location” header value is as specified in the remote HTTP or HTTPS
URL.
• The Static (Local) mode is the default mode. It indicates that the appliance fetches the data
from the local error page underneath the local:/// and store:/// directories and returns
the response message to the client.
© Copyright IBM Corp. 2015 Unit 6. Handling errors in a service policy 6-19
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
For Proxy and Static modes, you can define properties such as Response Code, Reason
Phrase, and Header Injection to tweak the response. The values override the current values (or
default values) to be returned to the client.
TR-375528 *****
V10.1
Student Notebook
Uempty
“Content-Type” considerations:
• Static mode: You need to statically set the value by using header
injection
• Proxy mode: It copies the value that is returned from the Remote
URL and you can use header injection to override
• Rule mode: You can manipulate the Content-Type header and use
header injection to override
© Copyright IBM Corporation 2015
Notes:
This slide shows the practical usage notes for the new feature.
For HTTP response code or phrase, the default value is “500 Internal Error.” Except for the Redirect
mode, which is with fixed value “307 Redirect,” you can use the configuration, including either the
response code, the reason phrase, or both, to override the default values.
For response headers, you can always use the header injection to override the response headers.
And in the Rule mode, you can manipulate the response headers by using the extension functions.
“Content-Type” is the most important header to consider. For Static mode, you are usually required
to set the value by using the header injection. For proxy mode, the appliance copies the value that
is returned from the Remote URL, and you can use header injection to override the value. For Rule
mode, you can either set the Content-Type on the rule, use the header injection, or do both to
override at the end.
© Copyright IBM Corp. 2015 Unit 6. Handling errors in a service policy 6-21
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Notes:
If you are configuring the HTTPS URL for proxy mode, you need to use the user agent to set up the
required SSL proxy profile. The user agent can also be used for setting the timeout value for the
connection to the remote URL.
The feature is available only for MPGW with HTTP or HTTPS traffic and has no effect on other
services and flows.
Before release 6.0.0, the web application firewall had a concept similar to the object “Error Policy.”
To eliminate the naming confusion against the new “Multi-Protocol Gateway Error Policy,” the
previously known “Error Policy” was renamed to “Web Application Firewall Error Policy.” The
change took effect only in the displayed name; the config file (.cfg) and exported material in the
6.0.0 firmware and pre-6.0.0 releases are fully compatible.
TR-375528 *****
V10.1
Student Notebook
Uempty
Unit summary
Having completed this unit, you should be able to:
• Configure an error policy
• Configure an On Error action in a service policy
• Configure an error rule in a service policy
• Describe how On Error actions, error rules, and error policies are
selected during error handling
Notes:
© Copyright IBM Corp. 2015 Unit 6. Handling errors in a service policy 6-23
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Checkpoint questions
1. True or False: When a rule with an On Error action encounters an
error, the rule is always terminated.
2. True or False: An error rule is unidirectional.
3. A service policy has an error rule and a request rule with an On Error
action. How does the firmware select the error-handling option?
A. The On Error radio button is selected from the admin setup page.
B. The firmware does not select the error-handling option. Selecting the error-
handling option is an off-appliance function.
C. If the On Error action is already encountered, error processing goes to the
On Error action. If the On Error action is not encountered, the error rule
gets control.
D. None of items A, B, and C.
E. All of items A, B, and C.
Notes:
Write your answers here:
1.
2.
3.
TR-375528 *****
V10.1
Student Notebook
Uempty
Checkpoint answers
1. False. Continuation of the current rule depends on the setting of
Error Mode.
2. False. An error rule is active for both request and response rules.
3. C.
Notes:
© Copyright IBM Corp. 2015 Unit 6. Handling errors in a service policy 6-25
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Exercise 4
Notes:
TR-375528 *****
V10.1
Student Notebook
Uempty
Exercise objectives
After completing this exercise, you should be able to:
• Configure an error policy at the MPGW service level
• Configure a service policy with an On Error action
• Configure a service policy with an Error rule
Notes:
© Copyright IBM Corp. 2015 Unit 6. Handling errors in a service policy 6-27
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
TR-375528 *****
V10.1
Student Notebook
Uempty
Unit 7. DataPower cryptographic tools and SSL
setup
References
IBM DataPower Gateway Knowledge Center:
http://www.ibm.com/support/knowledgecenter/SS9H2Y_7.1.0
© Copyright IBM Corp. 2015 Unit 7. DataPower cryptographic tools and SSL setup 7-1
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Unit objectives
After completing this unit, you should be able to:
• Explain how to use the DataPower tools to generate cryptographic
keys
• Create a crypto identification credential object that contains a
matching public and private key
• Create a crypto validation credential to validate certificates
• Set up certificate monitoring to ensure that certificates are up to date
• Configure an SSL proxy profile that accepts an SSL connection
request from a client
• Configure an SSL proxy profile that initiates an SSL connection from a
DataPower service
Notes:
TR-375528 *****
V10.1
Student Notebook
Uempty
Upload
Generate
Notes:
A self-signed certificate implies that no third-party certificate authority validates the certificate.
All key files are placed in an encrypted storage area on the appliance. The appliance can read
them, but the values cannot be displayed to users.
© Copyright IBM Corp. 2015 Unit 7. DataPower cryptographic tools and SSL setup 7-3
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Notes:
The files that are submitted to a certificate authority are created by default.
The fields from Country Name (C) down to Common Name (CN) are part of the distinguished
name.
The file name for the key file that is generated is of the form cert:///name-privkey.pem. If the
field is left blank, the system creates this file automatically.
TR-375528 *****
V10.1
Student Notebook
Uempty
Notes:
The password is for the key file that is generated.
Select on for Generate Self-Signed Certificate to generate a self-signed certificate into the
temporary: directory and the store: directory.
If Export Self-Signed Certificate or Export Private Key is off, then the generated key or
certificate is placed in the cert: directory only, where it cannot be edited.
When you click Generate Key, you generate a private key file and object, and a certificate file and
object.
© Copyright IBM Corp. 2015 Unit 7. DataPower cryptographic tools and SSL setup 7-5
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Notes:
The temporary: directory is cleared when the appliance shuts down or restarts.
TR-375528 *****
V10.1
Student Notebook
Uempty
1 : 1 or 2
Crypto profile
1 : 0 or 1 1 : 0 or 1
Crypto Crypto
validation credentials identification credentials
Notes:
This graphic shows the relationships of the various objects and files that are involved in SSL and
other crypto work on the appliance. It also shows the multiplicity of the relationship. For example, an
SSL proxy profile object can have 1 or 2 crypto profile objects that are related to it.
The crypto key and crypto certificate are also used in encryption and digital signatures.
The details on the objects are in the following slides.
© Copyright IBM Corp. 2015 Unit 7. DataPower cryptographic tools and SSL setup 7-7
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Crypto
identification credentials
Figure 7-7. Key and certificate objects point to files WE711 / ZE7111.0
Notes:
Although the shared secret key is not used in SSL, it is used in OAuth, and infrequently in
encryption and signatures.
TR-375528 *****
V10.1
Student Notebook
Uempty
Shared secret
key
File containing
symmetric key
Notes:
A secret key is used for symmetric key encryption.
Symmetric keys are used in OAuth.
DataPower does not have a utility that can generate a symmetric key. Use a tool, such as the Java
“keytool” or OpenSSL, to generate a key.
The key file can be uploaded from this page.
© Copyright IBM Corp. 2015 Unit 7. DataPower cryptographic tools and SSL setup 7-9
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Define a crypto key object that points to the private key file
• From the vertical navigation bar, click:
Objects > Crypto Configuration > Crypto Key
• Use the Crypto Key page to define a secret key object for a private
asymmetric key
– Provides an extra level of
security by providing an
indirect reference to the file
Crypto
key
File containing
private key
Notes:
A crypto key represents the private key that is used for asymmetric key encryption.
The key file can be uploaded from this page.
TR-375528 *****
V10.1
Student Notebook
Uempty
Crypto certificate
Crypto
certificate
File containing
certificate
Notes:
The Crypto Certificate page can be accessed from the vertical navigation bar by clicking Objects >
Crypto Configuration > Crypto Key.
Selecting the Password Alias option to be on means that the password entered for the key is a
password alias that was generated from a password map.
If Ignore Expiration Dates is off, the certificate object is placed in a “down” state if it is out of its
validity date range. If it is on, the certificate object is in an “up” state, but it might be rejected during
processing because of an invalid date.
© Copyright IBM Corp. 2015 Unit 7. DataPower cryptographic tools and SSL setup 7-11
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Crypto Crypto
key certificate
Crypto
identification credentials
Notes:
Enter a name for the crypto identification credential.
In the Crypto Key field, select the crypto key object from the list. You can use the + and ... to create
or edit a crypto key object.
In the Certificate field, select a certificate object from the list. You can use the + and ... to create or
edit a certificate object.
Specify the intermediate certificate authority (CA) certificates, if available, by clicking the Add. The
process establishes a trust chain that consists of one or more CA certificates.
You can also create a crypto identification credential by clicking Keys and Certs Management >
Identification Credentials from the Control Panel.
TR-375528 *****
V10.1
Student Notebook
Uempty
Crypto
validation credentials
Crypto
Crypto
Crypto
certificate
certificate
certificate
© Copyright IBM Corporation 2015
Notes:
The certificate validation mode specifies how to validate the presented certificate.
Two options are available:
• Match exact certificates or immediate issuer: The certificate that is presented or the
immediate issuer of the certificate must be available on the appliance.
• Full certificate chain checking (PKIX): The certificate that is presented and any intermediate
certificates that are chained back to the root certificate must be trusted.
The Use CRLs field is used to check whether certificates in the trust chain should be monitored for
expiration.
Creating a validation credential that is based on the certificates that are stored in the pubcert
directory creates a crypto certificate object for each certificate inside the pubcert directory. The
Create Validation Credential from pubcert: on the Configure Crypto Validation Credentials
catalog page does exactly that. An SSL client validates a presented certificate by verifying the
issuing CA certificate against its list of common public CA certificates that it contains locally. If the
certificate is self-signed, the client must have access to the self-signed certificate. Otherwise, it
cannot verify the server identity.
© Copyright IBM Corp. 2015 Unit 7. DataPower cryptographic tools and SSL setup 7-13
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
You can create a crypto validation credential that is based on well-known CA certificates that are
already stored on the appliance, or imported ones. The option is available on the Crypto Validation
Credentials page.
TR-375528 *****
V10.1
Student Notebook
Uempty
Notes:
This page is accessed from the vertical navigation bar, by clicking Administration >
Miscellaneous > Crypto Tools.
Certificates are exported to the temporary: directory; they can be downloaded by using file
management.
Only certificates can be exported and imported.
The object name that is typed must match the name of the exported crypto object exactly.
For an imported crypto object, a password alias can be supplied if the password is not entered.
If the appliance has the Hardware Security Module (HSM) feature installed, private keys can be
exported and imported.
© Copyright IBM Corp. 2015 Unit 7. DataPower cryptographic tools and SSL setup 7-15
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Uploading keys
• From the vertical navigation bar, click Objects > Crypto
Configuration > Crypto Key
• On the Crypto Key page, click Upload to upload the key file
Notes:
TR-375528 *****
V10.1
Student Notebook
Uempty
Notes:
The certificate monitor posts a warning in the system log. Review the system log for warnings.
Expired certificates are not trusted.
© Copyright IBM Corp. 2015 Unit 7. DataPower cryptographic tools and SSL setup 7-17
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Notes:
Any trust chain that uses a revoked certificate is broken.
The CRL policy can be configured to fetch CRL lists from a CRL server. The CRL server is checked
for validity by using the CRL Issuer Validation Credential object that is selected.
The protocol is either HTTP or LDAP. Appropriate fields are displayed to support the protocol.
The Cryptographic Profile identifies the crypto profile to use to connect to the CRL issuer when
using SSL.
TR-375528 *****
V10.1
Student Notebook
Uempty
Notes:
Polling interval specifies the frequency with which certificate expiration dates are checked.
Reminder time is the number of days before the certificate expiration event is written to the log file.
© Copyright IBM Corp. 2015 Unit 7. DataPower cryptographic tools and SSL setup 7-19
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Notes:
The HSM is a piece of hardware with associated software and firmware that can do a number of
security functions. At order time, you can add an HSM to your appliance.
FIPS 140-2 level security is a standard for validating HSMs. For some specialized circumstances,
FIPS 140-2 Level 3 security is needed. The appliance supports the process through HSM
hardware.
To export private keys on HSM hardware, the Private Key Exportable via hsmkwk option must be
selected (the location is the Crypto Tools page).
The HSM option is shown only if you have an HSM installed.
HSM is not available on a virtual appliance.
TR-375528 *****
V10.1
Student Notebook
Uempty
1 2 Endpoint
Client application
SSL-encrypted SSL-encrypted
servers
request request
SSL-encrypted SSL-encrypted
reply reply
3
SSL-encrypted SSL-encrypted
reply request
External
resources
© Copyright IBM Corporation 2015
Notes:
SSL is a point-to-point protocol. A new SSL connection is required for each point. For example,
three separate SSL connections are required for connections from remote client to appliance,
appliance to endpoint application server, and appliance to external resource.
© Copyright IBM Corp. 2015 Unit 7. DataPower cryptographic tools and SSL setup 7-21
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
External
resources
© Copyright IBM Corporation 2015
Figure 7-20. A crypto profile specifies details of the SSL connection WE711 / ZE7111.0
Notes:
TR-375528 *****
V10.1
Student Notebook
Uempty
Crypto profile
• Specifies the
DataPower end of the
SSL connection
• Particulars depend on
whether this profile is
for an “SSL client” or
an “SSL server” end of
the connection
Crypto profile
Connection
specifications
Crypto
identification credentials
Crypto
validation credentials
© Copyright IBM Corporation 2015
Notes:
The Ciphers field specifies what cipher specifications are supported at the DataPower end of the
connection. It is composed of one or more cipher suites.
The default cipher string is “HIGH:MEDIUM:!aNULL:!eNULL:@STRENGTH”. The higher preferences are
listed first. The default specifies: AES or 3DES (HIGH), 128-bit RC2 or RC4 (MEDIUM), no
non-authentication algorithms (anonymous DH) (!aNULL), no non-encryption algorithms (!eNULL),
sort list by encryption algorithm key length (@STRENGTH).
© Copyright IBM Corp. 2015 Unit 7. DataPower cryptographic tools and SSL setup 7-23
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Figure 7-22. Do not use insecure SSL options in the crypto profile WE711 / ZE7111.0
Notes:
IBM Support Portal: Security Bulletin: Vulnerability in SSLv3 affects DataPower (CVE-2014-3566)
•http://www.ibm.com/support/docview.wss?uid=swg21687189
IBM Support Portal: Do not enable weak cipher suites for IBM DataPower Gateway appliances.
•http://www.ibm.com/support/docview.wss?uid=swg21699042
TR-375528 *****
V10.1
Student Notebook
Uempty
Notes:
The cryptographic objects that are used by the certificates are linked, creating an SSL proxy profile.
© Copyright IBM Corp. 2015 Unit 7. DataPower cryptographic tools and SSL setup 7-25
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Crypto profile
Connection
specifications
Points to
Crypto
certificate and
identification credentials
private key
Crypto
validation credentials
Notes:
On the Configure XML Firewall page, you create an instance of an SSL server crypto profile that
references a crypto identification credential. A crypto identification credential consists of a
certificate-key pair that can be used in SSL connections.
TR-375528 *****
V10.1
Student Notebook
Uempty
Figure 7-25. Step 2: Configuring SSL server crypto profile WE711 / ZE7111.0
Notes:
Configure an SSL server crypto profile with cryptographic objects that link to the certificate-key pair:
• On the Configure XML Firewall page, you can specify the server SSL crypto profile under
Front End.
© Copyright IBM Corp. 2015 Unit 7. DataPower cryptographic tools and SSL setup 7-27
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Notes:
The Server Side SSL page is useful when you remember the file names for the key and certificate.
The Crypto Profile page is useful when you have the key, certificate, and credential objects.
This crypto profile uses only an identification credential object because the appliance is not
validating the client certificate. If client authentication is required, then a validation credential object
needs to be specified.
The Ciphers field specifies the symmetric key encryption algorithm that the crypto profile supports,
which is negotiated during an SSL handshake.
The Options field provides options to disable support for SSL and TLS versions.
Selecting the Send Client CA List enables the transmission of the client CA list to the client. This
option is useful when a validation credential is specified. This CA list consists of all the CA
certificates that are specified in a validation credential. To send a client CA list to clients, SSL
servers are not required.
TR-375528 *****
V10.1
Student Notebook
Uempty
2 Endpoint
application
SSL-encrypted servers
request
Crypto profile
SSL-encrypted
reply
© Copyright IBM Corporation 2015
Figure 7-27. Securing connection from appliance to external application server WE711 / ZE7111.0
Notes:
The application server can request and validate a certificate from the DataPower appliance.
The SSL client crypto profile specifies a validation credential to validate the certificate that the
application server provides.
© Copyright IBM Corp. 2015 Unit 7. DataPower cryptographic tools and SSL setup 7-29
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Crypto profile
Connection
specifications
Crypto
validation credentials
Notes:
On the Configure XML Firewall page, you create an instance of an SSL client crypto profile that
references a crypto validation credential. A crypto validation credential references one or more
crypto certificate objects.
TR-375528 *****
V10.1
Student Notebook
Uempty
Figure 7-29. Step 2: Configuring an SSL client crypto profile WE711 / ZE7111.0
Notes:
As before, if you do not have an SSL client crypto profile, you can use the ... button, or go to
Objects > Crypto Configuration > Crypto Profile.
The SSL Proxy object is covered in later slides.
© Copyright IBM Corp. 2015 Unit 7. DataPower cryptographic tools and SSL setup 7-31
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Reverse Forward
Endpoint
Client
application
servers
SSL server SSL client
crypto profile crypto profile
© Copyright IBM Corporation 2015
Notes:
Generally, the SSL proxy profile is automatically created when a crypto profile is defined. The name
of the generated SSL proxy profile is usually the same name as the service.
TR-375528 *****
V10.1
Student Notebook
Uempty
• Direction is indicated
as reverse
• Mutual authentication
is supported
Figure 7-31. SSL proxy profile when the appliance is the SSL server WE711 / ZE7111.0
Notes:
Set Client Authentication is optional to control when SSL client authentication is optional. When
set to on, client authentication is not required. When there is no client certificate, the request does
not fail. When set to off (Default), the SSL server requires client authentication only when the
server crypto profile has an assigned validation credential.
Set Always Request Client Authentication to control when to request SSL client authentication.
When set to on, the SSL server always requests client authentication. When set to off (Default), the
SSL server requests client authentication only when the server crypto profile has an assigned
validation credential.
© Copyright IBM Corp. 2015 Unit 7. DataPower cryptographic tools and SSL setup 7-33
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Figure 7-32. SSL proxy profile when the appliance is the SSL client WE711 / ZE7111.0
Notes:
TR-375528 *****
V10.1
Student Notebook
Uempty
Notes:
© Copyright IBM Corp. 2015 Unit 7. DataPower cryptographic tools and SSL setup 7-35
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
1 : 1 or 2
Crypto profile
1 : 0 or 1 1 : 0 or 1
Crypto Crypto
validation credentials identification credentials
Notes:
Numerous objects are involved in configuring SSL support. This graphic provides an opportunity to
review them.
TR-375528 *****
V10.1
Student Notebook
Uempty
User agent
A client that operates on behalf of a service when establishing a
connection to a remote server
• Commonly used for remote requests that are initiated from actions in
the service policy
• Example: Configure a user agent to run an SSL profile proxy if
matched by a matching expression
• Policies are applied by using a URL match expression
– Multiple policies can be associated to a user agent and can be triggered based
on different URL strings
User agent
Request policy
External
resources
Notes:
A user agent uses one or more policies to connect to an external server or back side service.
© Copyright IBM Corp. 2015 Unit 7. DataPower cryptographic tools and SSL setup 7-37
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Notes:
Other tabs exist in configuring a user agent. For more information about these tabs, see the product
documentation.
TR-375528 *****
V10.1
Student Notebook
Uempty
Notes:
Other tabs exist in configuring a user agent. For more information about these tabs, see the product
documentation.
© Copyright IBM Corp. 2015 Unit 7. DataPower cryptographic tools and SSL setup 7-39
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Notes:
The SSL proxy profile that is selected is a previously created SSL proxy profile object.
TR-375528 *****
V10.1
Student Notebook
Uempty
Unit summary
Having completed this unit, you should be able to:
• Explain how to use the DataPower tools to generate cryptographic
keys
• Create a crypto identification credential object that contains a
matching public and private key
• Create a crypto validation credential to validate certificates
• Set up certificate monitoring to ensure that certificates are up to date
• Configure an SSL proxy profile that accepts an SSL connection
request from a client
• Configure an SSL proxy profile that initiates an SSL connection from a
DataPower service
Notes:
© Copyright IBM Corp. 2015 Unit 7. DataPower cryptographic tools and SSL setup 7-41
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Checkpoint questions
1. True or False: The User Agent primarily handles the details for
network-related outbound calls from a service policy.
Notes:
Write your answers here:
1.
2.
3.
4.
TR-375528 *****
V10.1
Student Notebook
Uempty
Checkpoint answers
1. True.
2. D.
4. True.
Notes:
© Copyright IBM Corp. 2015 Unit 7. DataPower cryptographic tools and SSL setup 7-43
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Exercise 5
Notes:
TR-375528 *****
V10.1
Student Notebook
Uempty
Exercise objectives
After completing this exercise, you should be able to:
• Generate crypto keys by using the DataPower cryptographic tools
• Create a crypto identification credential by using a crypto key object
and a crypto certificate object
• Validate certificates by using a validation credential object
• Create an SSL proxy profile that accepts an SSL connection request
from a client
• Create an SSL proxy profile that initiates an SSL connection from a
DataPower service
Notes:
© Copyright IBM Corp. 2015 Unit 7. DataPower cryptographic tools and SSL setup 7-45
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Exercise overview (1 of 2)
• Create the files and objects that are needed to configure the SSL
connections for the services
Crypto profile for SSL client Crypto profile for SSL server
StudentClientCP StudentServerCP
Notes:
TR-375528 *****
V10.1
Student Notebook
Uempty
Exercise overview (2 of 2)
1. Add an HTTPS front side handler that acts as the SSL server
2. Use the HTTPS protocol in the back-end URL to act as the SSL client
3. Test with
SoapUI
Notes:
© Copyright IBM Corp. 2015 Unit 7. DataPower cryptographic tools and SSL setup 7-47
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
TR-375528 *****
V10.1
Student Notebook
Uempty
Unit 8. XML and web services security overview
References
IBM DataPower Gateway Knowledge Center:
http://www.ibm.com/support/knowledgecenter/SS9H2Y_7.1.0
© Copyright IBM Corp. 2015 Unit 8. XML and web services security overview 8-1
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Unit objectives
After completing this unit, you should be able to:
• Describe the features of the WS-Security specification
• Enable message confidentiality by using XML Encryption
• Provide message integrity by using XML Signature
Notes:
TR-375528 *****
V10.1
Student Notebook
Uempty
Notes:
Authentication is the act of verifying that the identity asserted by the client is valid. Normally, a
security token that is attached to the message makes a claim about the client identity. Plaintext user
name and password tokens, X.509 certificates, and Kerberos tickets are all examples of identity
claims.
Authorization is the process of deciding whether a client has access to a protected resource. This
process also determines the level of access that the server grants the client. In most cases, the
authorization decision requires that the client identity is known and verified. That is, authorization
occurs after authentication.
Integrity, also known as data integrity, makes sure that a message is not altered or tampered with
while it travels between the client and the server. Digital signatures and hash codes can prove
whether a message was modified in transit.
Confidentiality ensures that only authorized parties have access to protected resources. The
effect of confidentiality is to keep private data or resources secret. This quality is often implemented
through the encryption of data, in which only authorized parties have the means of making
obscured data into legible information.
© Copyright IBM Corp. 2015 Unit 8. XML and web services security overview 8-3
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Auditing is the process of maintaining irrefutable records for holding clients accountable to their
actions. Signed security logs provide one way to audit a security system. The concept of
nonrepudiation is tied closely to auditing. It is the ability of one party of the communication to prove
that the other party received its message. Nonrepudiation is often split into two concepts:
nonrepudiation of origin proves that one party sent a message, while nonrepudiation of receipt
proves that one party received a message.
Verifying the digital signature and the expiration date on the message enforces nonrepudiation of
origin. Nonrepudiation of receipt depends on the software environment.
TR-375528 *****
V10.1
Student Notebook
Uempty
Intermediate
Requester Web service
node
Security context
© Copyright IBM Corporation 2015
Notes:
WS-Security does not describe specific security protocols. This model can use different security
mechanisms, and can be configured to match the requirements of new ones as they are developed.
By separating the security constraints from the actual implementation, developers can change
security technologies without needing to adopt another web services security specification.
Each arrow between two boxes shows a point-to-point security context. Transport level security,
such as SSL/TLS, provides a security context that persists only from one intermediate node to
another.
The curved line that spans multiple boxes is an example of end-to-end security. WS-Security
provides this security context.
WS-Security provides message-level security. SSL/TLS secures the entire HTTP request, and is at
the transport layer. WS-Security allows security to be applied to specific message parts of the
request payload.
© Copyright IBM Corp. 2015 Unit 8. XML and web services security overview 8-5
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Components of WS-Security
• Associates security tokens with a message
– User name token profile
– X.509 token profile
– Kerberos token profile
– SAML token profile: Security Assertion Markup Language
– REL token profile: Rights Expression Language
• Confidentiality (XML encryption)
– Process for encrypting data and representing the result in XML
• Integrity (XML signature)
– Digitally sign the SOAP XML document, providing integrity and signer
authentication
• XML canonicalization
– Normalizes XML document
– Ensures that two semantically equivalent XML documents contain the same
octet stream
© Copyright IBM Corporation 2015
Notes:
An XML digital signature is based on the W3C recommendation specification for XML-signature
syntax and processing. For more information, see: http://www.w3.org/TR/xmldsig-core/
XML encryption is based on the W3C recommendation for XML encryption syntax and processing.
For more information, see: http://www.w3.org/TR/xmlenc-core/
The security token profiles that are listed are for WS-Security V1.1. For links to the list of
specifications, see: http://www.oasis-open.org/specs/index.php#wssv1.0
TR-375528 *****
V10.1
Student Notebook
Uempty
<wsse:Security
env:actor="http://www.example.com/secManager"
env:mustUnderstand="1"
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-
200401-wss-wssecurity-secext-1.0.xsd">
<!-- WS-Security header here -->
</wsse:Security>
</env:Header>
<env:Body>
<!-- SOAP message body here -->
</env:Body>
</env:Envelope>
Notes:
The actor and mustUnderstand are special attributes that the SOAP specification defines. The
actor attribute contains a URL of the targeted recipient for the SOAP header. The mustUnderstand
attribute is used to specify that the tags in the header must be understood; otherwise, a fault is
thrown.
© Copyright IBM Corp. 2015 Unit 8. XML and web services security overview 8-7
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Figure 8-6. Scenario 1: Ensure confidentiality with XML encryption WE711 / ZE7111.0
Notes:
By encrypting message content, the privacy of the content becomes decoupled from the transport
mechanism. For example, messages sent over an SSL connection are encrypted. They are thus
provided with some degree of privacy, but no further privacy is provided after the message exits the
SSL connection. By encrypting the content of the message, the message can travel across
transport boundaries, such as HTTP and WebSphere MQ, and remain private.
The <Envelope>, <Header>, and <Body> elements cannot be encrypted.
TR-375528 *****
V10.1
Student Notebook
Uempty
Notes:
© Copyright IBM Corp. 2015 Unit 8. XML and web services security overview 8-9
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Encrypted Plaintext
XML XML
message message
Notes:
TR-375528 *****
V10.1
Student Notebook
Uempty
Encrypt action
The Encrypt action performs full or field-level encryption
• Envelope Method: Controls
placement of generated
security elements
• Message and Attachment
Handling: Encrypt message,
attachment, or both
• Encryption Key Type: How the
symmetric key is protected
• Use Dynamically Configured
Recipient Certificate: Uses
passed certificate, if it exists
• One Ephemeral Key:
Causes all encryption in this
step to use the same
ephemeral key
• Recipient Certificate:
The certificate that is used to
encrypt the encryption key © Copyright IBM Corporation 2015
Notes:
The Advanced choice for Envelope Method and Message Type is not selectable.
An ephemeral key is a key that is generated each time encryption occurs. Basically, it is the
symmetric key that is used for encryption.
The DataPower device supports the following encryption schemas:
• The WSSec encryption (OASIS) standard puts the signature and key information in the SOAP
header.
• Standard XML encryption (W3C) puts the signature and key information in the body of
message.
• The WS-Security standard puts the signature and key information in the WS-Security header of
the SOAP message. This standard does not add elements to the body of the message.
Therefore, it does not violate the underlying schema.
• Standard XML encryption was originally designed to handle any XML message, including those
messages that are not formatted to the SOAP specification. It puts the signature and key
information in the body of the message, thus adding more elements to the body of the message.
© Copyright IBM Corp. 2015 Unit 8. XML and web services security overview 8-11
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
The DataPower SOA appliance supports both methods of encryption. The appliance can use either
standard for full message or partial encryption.
The following message types are supported:
• SOAP message: An encrypted SOAP document
• Raw XML document: An encrypted XML document (it cannot be used with WSSec encryption)
• Selected elements (field-level): A partially encrypted SOAP document
The following options are in the Message and Attachment Handling menu:
• Attachments only: Only the attachments of the message are encrypted.
• Message only: Only the message (root part) is encrypted.
• Message and attachments: Message (root part) and attachments are encrypted.
The encryption key type specifies how the symmetric encryption key is protected. Depending on the
selection, the fields in the page might change:
• Use Ephemeral Key Transported by Asymmetric Algorithm: The X509 key-cert pair transports
the ephemeral key with an asymmetric algorithm.
• Use Symmetric Key Directly: A security token protects the session key.
• Use Ephemeral Key Wrapped by a Symmetric Key: The ephemeral key is encrypted by a
symmetric key from a security token.
If Use Dynamically Configured Recipient Certificate is set to on, the Encrypt action uses a
certificate that is used in a previous Verify action. This option supports use of the certificate in a
Verify action for the request message as the encrypting certificate in an Encrypt action in the
response.
TR-375528 *****
V10.1
Student Notebook
Uempty
Decrypt action
• The Decrypt action
performs full or field-level
decryption
– Message Type: Specifies
how to decrypt the
message
– Decrypt Key: Private key
object that is used to
decrypt
Notes:
On the Advanced tab, you can override the style sheet that is used to decrypt. The default file that
is used is store:///decrypt.xsl.
© Copyright IBM Corp. 2015 Unit 8. XML and web services security overview 8-13
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Notes:
The XPath expression can be created from an XML file by selecting the elements to encrypt or
decrypt. The XPath expression for field-level decryption is different from the XPath expression for
encrypting the same field. Encryption occurs on an element in the original message, for example,
<name>. When it is time to decrypt, the field is no longer known as <name>, but as something else,
such as <EncryptedData>. Thus, the XPath expression to get to the apparently identical element
differs depending on whether you are encrypting the original field or decrypting the encrypted field.
TR-375528 *****
V10.1
Student Notebook
Uempty
XPath tool
• In the document crypto map, click XPath Tool to create an XPath
expression by using an XML file
– URL of Sample XML Document: Upload or select an XML document
– Namespace Handling: How the XPath statement matches namespace
declarations
– XPath: Generated XPath statement
Notes:
The content of the selected XML file is omitted from the slide and is shown below the three buttons
(Refresh, Done, and Cancel). Click the elements in the XML file to generate an XPath expression.
The three options for namespace handling are:
• local: This option compares only the local name (element name), ignoring the namespace.
• prefix: This option compares the qualified name, including the namespace prefix. It can be used
when the mapping from the namespace prefix to the URI is specified on the Namespace
Mappings tab on an object configuration page.
• uri: This option compares the local name and namespace URI.
© Copyright IBM Corp. 2015 Unit 8. XML and web services security overview 8-15
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Notes:
This example message does field-level encryption on the child elements of the <q0:findByName>
element. If full-message encryption is applied, then this element would also be encrypted.
Namespace declarations were removed in this example.
When XML encryption is applied to the original SOAP message, a web services security header is
inserted into the SOAP header with information about the key that was used to encrypt the
message body. In this example, the child element of <q0:findByName> is encrypted.
TR-375528 *****
V10.1
Student Notebook
Uempty
Figure 8-14. Scenario 2: Ensure integrity with XML signatures WE711 / ZE7111.0
Notes:
The XML digital signature (XMLDS) is a joint effort between the World Wide Web Consortium
(W3C) and Internet Engineering Task Force (IETF). For more information about signatures, see:
http://www.w3.org/signature
An XML signature is transport-independent; it can cross multiple transport protocol boundaries.
A message digest is a hash value that is generated by applying a digest algorithm to a message
part. A private key is used to generate a digital signature. Depending on the algorithm, either the
same private key or a public key is used to verify the signature.
A sender can choose to sign only specific portions of the XML tree rather than the complete
document.
Consider the following example:
<transaction-info>
<user-id>jsmith</user-id>
<action>buy</action>
<symbol>IBM</symbol>
</transaction-info>
© Copyright IBM Corp. 2015 Unit 8. XML and web services security overview 8-17
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
You can sign the value within the symbol element, the entire symbol element (including the value),
or a group of elements within transaction-info.
TR-375528 *****
V10.1
Student Notebook
Uempty
Notes:
A client signs a message by using its private key. The message is verified with the client public key
by using the client certificate, if asymmetric. The public key that is used to verify that the message is
associated with the private key that was used to sign the message.
© Copyright IBM Corp. 2015 Unit 8. XML and web services security overview 8-19
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Sign action
• The Sign action signs
specific elements or the
entire message by using
a crypto key object
– Envelope Method:
Determines placement of
the signature in a
message
– Message Type
– Key: Crypto key object
that is used to sign a
message
– Certificate: Crypto
certificate object that is
associated with the crypto
key object
© Copyright IBM Corporation 2015
Notes:
Digital signatures might occur anywhere in a message. The signature can be in either the header or
the body of the message, depending on the style that was chosen to sign the message. For
non-SOAP XML messages, the signature element might occur anywhere in the message.
The choice of envelope method determines the placement of the XML signature (from DataPower
WebGUI documentation):
• Enveloped Method: The signature is over the XML content that contains the signature as an
element. The content provides the root XML document element (not considered a good idea).
• Enveloping Method: The signature is over content that is found within an object element of the
signature. The object, or its content, is identified by using a reference through a URI fragment
identifier or transform (not considered a good idea).
• SOAPSec Method: The signature is included in a SOAP header entry.
• WSSec Method: The signature is included in a WS-Security security header.
If an envelope method of WSSec Method and a message type of either SOAP Message or
SOAP With Attachments is selected, then the page shows a Use Asymmetric Key option.
TR-375528 *****
V10.1
Student Notebook
© Copyright IBM Corp. 2015 Unit 8. XML and web services security overview 8-21
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Verify action
• The Verify action verifies
a digital signature
• Signature Verification
Type
– Use asymmetric only,
symmetric only, or either
• Optional Signer
Certificate
– Used instead of a passed
certificate
• Validation Credential
– One or more certificate
objects that are used to
validate the signer certificate
Notes:
By default, a digital signature is verified by using the certificate (public key) that is contained in the
signature. No additional configuration steps are required. The validation credential object validates
the included certificate. If the certificate that is supplied in the signature does not validate against
the validation credential object, the signature verification fails.
TR-375528 *****
V10.1
Student Notebook
Uempty
Notes:
The Verify action uses an advanced Check Timestamp Expiration property, which is on by
default. Valid signatures might expire and thus fail verification.
© Copyright IBM Corp. 2015 Unit 8. XML and web services security overview 8-23
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Notes:
The Verify action does not include a field-level radio button. In the WSSec envelope method, an
ID is inserted into the element of the message that is signed. For example, if the entire message is
signed, then the child element of the SOAP body contains the ID attribute. The ID attribute can be
used to determine the elements that are signed.
This ID might cause messages to fail schema validation.
TR-375528 *****
V10.1
Student Notebook
Uempty
Notes:
This message is condensed to fit on the slide.
Signing messages might rewrite attributes in the message. Notice the wsu:id attribute added by
the Sign action to the SOAP body. This action might cause the body of the message to invalidate
against a schema, depending upon how the schema is written.
© Copyright IBM Corp. 2015 Unit 8. XML and web services security overview 8-25
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Notes:
TR-375528 *****
V10.1
Student Notebook
Uempty
Unit summary
Having completed this unit, you should be able to:
• Describe the features of the WS-Security specification
• Enable message confidentiality by using XML Encryption
• Provide message integrity by using XML Signature
Notes:
© Copyright IBM Corp. 2015 Unit 8. XML and web services security overview 8-27
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Checkpoint questions
1. True or False: A document crypto map is used to specify an XPath
expression that contains the elements to encrypt, decrypt, sign,
and verify.
2. True or False: Encryption and decryption can occur at both
message and field levels, but sign and verify occur at the message
level only.
3. True or False: The validation credential object validates the signer
certificate, which is the public key that is used to generate the
digital signature. This certificate is usually included in the message,
but an alternative certificate can be specified in the Signer
Certificate field.
Notes:
Write your answers here:
1.
2.
3.
TR-375528 *****
V10.1
Student Notebook
Uempty
Checkpoint answers
1. False. A document crypto map is used to specify an XPath
expression that contains the elements to encrypt, decrypt, and sign.
The Verify action does not use a map since it can determine the
signed elements from the headers.
2. False. Both scenarios are supported, even though the Verify action
does not have a selected field-level radio button.
3. True.
Notes:
© Copyright IBM Corp. 2015 Unit 8. XML and web services security overview 8-29
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Exercise 6
Notes:
TR-375528 *****
V10.1
Student Notebook
Uempty
Exercise objectives
After completing this exercise, you should be able to:
• Configure a multi-protocol gateway to decrypt and encrypt an XML
message
• Configure a multi-protocol gateway to verify and sign an XML message
• Test encryption and digital signatures by using the SoapUI tool
Notes:
© Copyright IBM Corp. 2015 Unit 8. XML and web services security overview 8-31
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Exercise overview
Notes:
TR-375528 *****
V10.1
Student Notebook
Uempty
Completed exercise
SoapUI DataPower
Client.jks cert:///
KeysFromClient-priv key KeysFromDP-priv key
CertFromClient certificate CertFromDP certificate
CertFromDP certificate CertFromClient certificate
Client Request
1. Sign message with 1. Decrypt message
KeysFromClient-priv Signed / with KeysFromDP-
key Encrypted priv key
request Clear text
2. Encrypt message with 2. Verify signature with request
CertFromDP-cert CertFromClient-cert
certificate certificate
DataPower Response
1. Decrypt message with 1. Sign message with Clear text Web
KeysFromClient-priv KeysFromDP-priv key response Service
Signed /
key 2. Encrypt message with
Encrypted
2. Verify signature with response CertFromClient-cert
CertFromDP-cert certificate
certificate
© Copyright IBM Corporation 2015
Notes:
© Copyright IBM Corp. 2015 Unit 8. XML and web services security overview 8-33
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
TR-375528 *****
V10.1
Student Notebook
Uempty
Unit 9. Authentication, authorization, and auditing
(AAA)
References
IBM DataPower Gateway Knowledge Center:
http://www.ibm.com/support/knowledgecenter/SS9H2Y_7.1.0
© Copyright IBM Corp. 2015 Unit 9. Authentication, authorization, and auditing (AAA) 9-1
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Unit objectives
After completing this unit, you should be able to:
• Describe the AAA framework within the DataPower Appliance
• Explain the purpose of each step in an access control policy
• Authenticate and authorize web service requests with:
– WS-Security Username and binary security tokens
– HTTP Authorization header claims
– Security Assertion Markup Language (SAML) assertions
Notes:
TR-375528 *****
V10.1
Student Notebook
Uempty
Notes:
Authentication always precedes authorization. A policy cannot decide whether a request proceeds
if it does not know the identity of the requester. For example, a security guard first determines
whether someone is an employee of the company. After this step, the guard determines whether
that employee has access to the building. Together, authentication and authorization restrict access
to resources.
Although auditing does not directly protect resources against unauthorized access, this third
process has an important role in securing resources. A record of successful and unsuccessful
access attempts allows the security infrastructure to detect suspicious activity in the system.
Historical logs also enforce nonrepudiation; clients cannot deny accessing the system in the past.
In literature these three steps are commonly known as “AAA,” which is pronounced “triple A.”
© Copyright IBM Corp. 2015 Unit 9. Authentication, authorization, and auditing (AAA) 9-3
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
AAA framework
Extract Map
Authenticate
identity credentials
SAML
WS-Security
SSL client certificate
HTTP basic
authentication
Notes:
The AAA action combines three security processes into a single style sheet transform. In the first
step, the style sheet extracts the identity token from the message. To verify the claims that the
token makes, the style sheet either authenticates the token against an on-board policy or queries
an external access control server. As soon as the client identity is confirmed, the style sheet maps
the client credentials to one of the users or groups that the service defines.
In the second step, the style sheet extracts the requested resource from the message. For web
services, a resource represents a service or service operation. If the requested resource is an alias
for one or more back-end resources, the style sheet maps the alias to the actual resource names as
well.
When the style sheet determines the requested back-end resource and confirms the client identity,
it decides whether the client has permission to access the requested resource. In other words, the
style sheet authorizes access to a back-end resource.
The final step is auditing and accounting. The style sheet records any access attempts, successful
or unsuccessful, for monitoring and nonrepudiation. The style sheet can also do post processing
steps, such as generating various tokens for the outgoing SOAP message. A custom style sheet
can also be specified.
TR-375528 *****
V10.1
Student Notebook
© Copyright IBM Corp. 2015 Unit 9. Authentication, authorization, and auditing (AAA) 9-5
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Figure 9-4. AAA action and access control policy WE711 / ZE7111.0
Notes:
TR-375528 *****
V10.1
Student Notebook
Uempty
3. Map authentication
credentials (optional)
Identity Identity
Notes:
The access control policy steps relate directly to the processing stages within the AAA framework.
In the first step, the policy defines how the framework retrieves information about the client identity.
The framework can treat the requested URL, the client IP address, the HTTP header, or any part of
the message, as a client identifier. When it is extracted, the second step describes how to verify the
claimed identity that is stored in the message. If the authorization method (which is described on
the next slide) expects a different client identifier, the policy can apply a custom style sheet to
convert the authentication credentials.
© Copyright IBM Corp. 2015 Unit 9. Authentication, authorization, and auditing (AAA) 9-7
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Token
XML
© Copyright IBM Corporation 2015
Notes:
If the authentication step succeeds, the policy determines the resources that the client requests
before making a final decision on whether to authorize access. An optional mapping step matches
the resource request with a type expected by the authorization method.
When authentication and authorization succeed, monitoring and post processing steps can take
place. The monitoring step records whether the access control policy as a whole succeeds or fails.
Such information can be used for auditing purposes. Unlike the monitoring step, post processing
occurs only if the policy authorizes the resource request. This final step can add more security
tokens to the message header.
TR-375528 *****
V10.1
Student Notebook
Uempty
3 Map credentials
4 Extract resource
Map resource
5
6 Allow Deny
Authorize
Notes:
The numbers correspond to the access control policy steps detailed on the previous two slides.
Keep in mind that the output message is returned to the processing rule, not back to the actual
client itself. Similarly, an On Error action or an error rule suppresses or handles errors that are
generated from a AAA action.
The only part of the post processing step that occurs when authorization fails is the incrementing of
the authorization failures counter (if one exists).
Within the post processing step, monitors track the requests.
© Copyright IBM Corp. 2015 Unit 9. Authentication, authorization, and auditing (AAA) 9-9
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Notes:
In this scenario, the client includes a WS-Security user name token with a password or password
digest as a proof of identity. As a good practice, clients send plain text tokens, such as the
WS-Security user name token, within a secure channel, such as an SSL connection.
The access control policy on the DataPower SOA appliance verifies the user name and password
against a built-in user list. It assumes that all authenticated users have full access to any resource
protected by the policy.
TR-375528 *****
V10.1
Student Notebook
Uempty
Notes:
The WS-Security user name token provides a basic method to transport user credentials to a web
service. The password field can be in plain text, or the Secure Hash Algorithm (SHA1) can hash it.
Because SHA1 is a well-known algorithm, a hashed password provides a minimal level of security
by obfuscating the password. Messages with these identity credentials are sent only over a secure
connection.
For the sake of brevity, the URI for the wsse namespace declaration is truncated. For the URI, see
the WS-Security V1.1 specification.
Within the SOAP body, the child element describes the requested web service operation. In effect,
this element identifies the resource that is requested in this call.
© Copyright IBM Corp. 2015 Unit 9. Authentication, authorization, and auditing (AAA) 9-11
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Figure 9-10. Scenario 1: Identify and authenticate the client WE711 / ZE7111.0
Notes:
The choices for identity extraction are:
• HTTP Authentication header
• Password-carrying UsernameToken element from WS-Security header
• Derived-key UsernameToken element from WS-Security header
• BinarySecurityToken element from WS-Security header
• WS-SecureConversation identifier
• WS-Trust base or supporting token
• Kerberos AP-REQ from WS-Security header
• Kerberos AP-REQ from SPNEGO token
• Subject DN of SSL certificate from connection peer
• Name from SAML attribute assertion
• Name from SAML authentication assertion
TR-375528 *****
V10.1
Student Notebook
© Copyright IBM Corp. 2015 Unit 9. Authentication, authorization, and auditing (AAA) 9-13
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Notes:
The authorization choices are:
• AAA information file
• Allow any authenticated client
• Always allow
• Check membership in LDAP group
• Contact ClearTrust server
• Contact IBM Security Access Manager
• Contact Netegrity SiteMinder
• Contact NSS for SAF authorization
• Contact OAuth STS
• Custom template
• Generate SAML attribute query
TR-375528 *****
V10.1
Student Notebook
© Copyright IBM Corp. 2015 Unit 9. Authentication, authorization, and auditing (AAA) 9-15
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Notes:
HTTP BASIC-AUTH is the basic authentication scheme. See the following slide for an example of
an HTTP request message with a basic authentication header.
TR-375528 *****
V10.1
Student Notebook
Uempty
Notes:
In this scenario, the HTTP authorization header field is used for authentication. Remember that the
client encoded the user name and password in Base64. This encoding method is known, hence,
the client uses an SSL connection to keep the contents of this message private.
Base64 is a binary-to-text encoding scheme by printable (mostly alphanumeric) characters. As an
MIME content transfer encoding, it is used to encode binary data into email messages.
In the HTTP basic authentication scheme, the user name and password are concatenated with a
colon (:) before it is encoded byBase64. For example, the user name “Alice” and the password
“ond3mand” become “Alice:ond3mand”. In Base64 encoding, the user name and password string is
“QWxpY2U6b25kM21hbmQ=”
© Copyright IBM Corp. 2015 Unit 9. Authentication, authorization, and auditing (AAA) 9-17
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Figure 9-14. Scenario 2: Identify and authenticate the client WE711 / ZE7111.0
Notes:
TR-375528 *****
V10.1
Student Notebook
Uempty
Notes:
The Run Custom Post Processing Stylesheet setting applies a custom style sheet to the
outgoing request message. This setting does not require enablement for a built-in post processing
step, such as adding a WS-Security user name token.
The slide does not show the setting of the “Add WS-Security Username token” to on. When this
option is set, the page repaints to include the fields that are shown (“Include Password” and the
others).
The added WS-Security Username token for a username of “student”, a password of “web1sphere”,
and a password type of “Text” is:
<wsse:UsernameToken>
<wsse:Username>student</wsse:Username>
<wsse:Password
Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profi
le-1.0#PasswordText">web1sphere</wsse:Password>
<wsse:Nonce
EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message
© Copyright IBM Corp. 2015 Unit 9. Authentication, authorization, and auditing (AAA) 9-19
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
-security-1.0#Base64Binary">N2FmMzg3OTEtZDI4OS00MzkzLThmYWUtNzM3MzhkYmRmM2Zh</wsse
:Nonce>
<wsu:Created
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-util
ity-1.0.xsd"
>2015-03-24T21:16:44Z</wsu:Created>
</wsse:UsernameToken>
The same token, with a password type of “Digest” is:
<wsse:UsernameToken>
<wsse:Username>student</wsse:Username>
<wsse:Password
Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profi
le-1.0#PasswordDigest">JDqa4I7DaWicLrj+ykiSBQT0MFc=</wsse:Password>
<wsse:Nonce
EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message
-security-1.0#Base64Binary">YzVhNmQ3OTctZmE5Mi00NjdhLWFiYmYtZDUyNDVmNmRjNTEw</wsse
:Nonce>
<wsu:Created
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-util
ity-1.0.xsd"
>2015-03-24T21:25:12Z</wsu:Created>
</wsse:UsernameToken>
In both cases, the optional <Nonce> and <Created> elements are specified. These elements and
the password can be used to protect against replay attacks.
TR-375528 *****
V10.1
Student Notebook
Uempty
Notes:
For identity extraction methods, the policy runs all checked methods. The system runs the methods
in the order that is presented in the check box list. Afterward, the system concatenates all identities
that are found for authentication. This scheme allows different clients to use different identification
methods.
However, if a client includes more than one identifier in the message, both identifiers must pass the
authentication stage.
© Copyright IBM Corp. 2015 Unit 9. Authentication, authorization, and auditing (AAA) 9-21
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Figure 9-17. Scenario 3: Identify and authenticate the client WE711 / ZE7111.0
Notes:
TR-375528 *****
V10.1
Student Notebook
Uempty
Notes:
If Bind to LDAP server is selected, the page repaints to display entry fields for the LDAP details.
The targeted LDAP server can be a load balancer group that is composed of multiple LDAP
servers.
The DataPower to LDAP server connection is usually over an SSL connection. The SSL proxy
profile object defines the SSL connection information.
© Copyright IBM Corp. 2015 Unit 9. Authentication, authorization, and auditing (AAA) 9-23
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Notes:
TR-375528 *****
V10.1
Student Notebook
Uempty
Validation
AAAInfo.xml LTPA credential
Client Server
Notes:
The validation credential object references a list of certificates on the appliance that validate the
incoming digital signature. This object is also used when configuring client-side SSL.
© Copyright IBM Corp. 2015 Unit 9. Authentication, authorization, and auditing (AAA) 9-25
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Notes:
The DataPower WebGUI includes a set of wizard pages that make it easy to create a AAA XML file.
When you attempt to create a AAA Info file, or edit an existing one, a AAA Info file editor opens.
TR-375528 *****
V10.1
Student Notebook
Uempty
<aaa:AAAInfo xmlns:aaa="http://www.datapower.com/AAAInfo">
<aaa:FormatVersion>1</aaa:FormatVersion>
<aaa:Filename>local:///AddressInfo.xml</aaa:Filename>
<aaa:Summary>
AAA file to validate credentials for Address users
</aaa:Summary>
<aaa:Authenticate>
<aaa:Username>AddressAdmin</aaa:Username>
<aaa:Password>password</aaa:Password>
<aaa:OutputCredential>
AddressUser
</aaa:OutputCredential>
</aaa:Authenticate>
</aaa:AAAInfo>
Notes:
The Authenticate step uses this AAA XML file to validate the extracted identity. The incoming
identity has a user name of AddressAdmin and password of password.
© Copyright IBM Corp. 2015 Unit 9. Authentication, authorization, and auditing (AAA) 9-27
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Notes:
For more information, see the article WS-Policy security integration between DataPower and
WebSphere Application Server, which includes a section on using the LTPA token:
http://www.ibm.com/developerworks/websphere/library/techarticles/0911_rasmussen/
0911_rasmussen.html
TR-375528 *****
V10.1
Student Notebook
Uempty
Notes:
It is also possible to do authentication and authorization on an IBM Security Access Manager
system. IBM Security Access Manager can be configured to use its own user repository for
authentication instead of using a separate, external Lightweight Directory Access Protocol (LDAP)
server.
The list of external access controls on this slide is merely an example. For a full list of security
products and specifications that are supported, see the product documentation.
© Copyright IBM Corp. 2015 Unit 9. Authentication, authorization, and auditing (AAA) 9-29
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Notes:
TR-375528 *****
V10.1
Student Notebook
Uempty
Notes:
Federated Security Systems require an interoperable way of sending security information from one
system to another. The Security Assertion Markup Language (SAML) is designed specifically for
this purpose. It is analogous to how the SOAP specification defines a messaging model for
transferring information between web service clients and servers.
SAML allows clients or intermediaries to embed claims, or assertions, into the message. One
common use for assertions is single sign-on: after a security server authenticates a client, a SAML
authentication statement is tagged to the client request. Subsequent systems that process the
request need only to trust the assertion instead of authenticating the client again.
© Copyright IBM Corp. 2015 Unit 9. Authentication, authorization, and auditing (AAA) 9-31
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Notes:
In plain terms, here are some typical statements that the three types of SAML assertions make:
• Authentication statement: “I am Bob Smith.”
• Attribute statement: “Bob Smith is a payroll manager.”
• Authorization decision statement: “Payroll managers can run the Payroll Update web service.”
These assertions avoid repeating the same checks on the same message as it passes through
different systems. In addition, assertion statements delegate the authentication and authorization
task to a separate server.
The last point describes the HTTP binding for SAML. Remember that SAML is not only used for
web services. For example, a web application server might want to verify a SAML assertion in a
single sign-on (SSO) scenario. Without even examining the HTTP request message, the server
extracts and dereferences a SAML assertion from the URL query string.
TR-375528 *****
V10.1
Student Notebook
Uempty
Notes:
In this example, the request message contains a SAML authentication statement and a SAML
attribute statement. The authentication statement claims that the current requester is verified during
a previous processing step. The access control policy accepts this claim if and only if the digital
signature that was used to sign the claim is valid.
An application-specific SAML attribute describes the resource that the client requests. The policy
authorizes the request if the current requester is an authorized user.
© Copyright IBM Corp. 2015 Unit 9. Authentication, authorization, and auditing (AAA) 9-33
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
<saml:Assertion xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion"
xmlns:samlp="urn:oasis:names:tc:SAML:1.0:protocol"
AssertionID="IDd600a593-4e13-44d9-829a-3055600c46ca"
IssueInstant="2006-07-28T18:51:02Z"
Issuer=http://training.ibm.com/security/
MajorVersion="1" MinorVersion="1">
<saml:Conditions NotBefore="2006-07-28T18:51:02Z"
NotOnOrAfter="2006-07-28T18:54:02Z"/>
<saml:AuthenticationStatement
AuthenticationInstant="2006-07-28T18:51:02Z"
AuthenticationMethod="urn:oasis:names:tc:SAML:1.0:am:unspecified">
<saml:Subject>
<saml:NameIdentifier
Format="urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified"
NameQualifier="http://address.training.ibm.com">
admin
</saml:NameIdentifier>
Notes:
This example is a SAML assertion that is generated in the post-processing step of an access
control policy.
The Conditions element defines a window of time in which this statement is valid. This time limit
reduces the likelihood of a replay attack.
Within the AuthenticationStatement, the Subject element describes the identity of the client
through a NameIdentifier element.
TR-375528 *****
V10.1
Student Notebook
Uempty
<saml:SubjectConfirmation>
<saml:ConfirmationMethod>
urn:oasis:names:tc:SAML:1.0:cm:sender-vouches
</saml:ConfirmationMethod>
</saml:SubjectConfirmation>
</saml:Subject>
<saml:SubjectLocality IPAddress="127.0.0.1"/>
</saml:AuthenticationStatement>
</saml:Assertion>
Notes:
The SubjectConfirmation element describes which party backs up the claim. In this example, the
message sender vouches for the validity of this claim.
It is a good practice to sign SAML assertions digitally to maintain the integrity of the claim.
© Copyright IBM Corp. 2015 Unit 9. Authentication, authorization, and auditing (AAA) 9-35
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Notes:
This example is a SAML attribute statement, holding application-specific information.
Similar to a SAML authentication statement, the NameIdentifier element describes the subject
that added the attribute.
The Attribute element describes application-specific information. For example, a SAML attribute
element can encapsulate fields from an LDAP directory entry. The system can use this additional
information about the subject to make an authorization decision.
Again, it is a good practice to sign SAML assertions digitally to maintain the integrity of the claim.
TR-375528 *****
V10.1
Student Notebook
Uempty
Figure 9-32. Scenario 4: Identify and authenticate the client WE711 / ZE7111.0
Notes:
To verify the signature of the SAML assertion, the access control policy needs the validation
credential. If the validation credentials field is blank, then the certificate is not validated. In either
case, the signature is verified.
© Copyright IBM Corp. 2015 Unit 9. Authentication, authorization, and auditing (AAA) 9-37
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Notes:
When authorizing requests based on SAML attributes, you must specify one or more expected
attributes in a separate page. The following slide describes how to enter in the list of expected
SAML attributes.
TR-375528 *****
V10.1
Student Notebook
Uempty
Notes:
© Copyright IBM Corp. 2015 Unit 9. Authentication, authorization, and auditing (AAA) 9-39
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
• Authentication methods:
– Accept a SAML assertion with a valid signature
– Retrieve SAML assertions corresponding to a SAML browser artifact
– Contact a SAML server for a SAML authentication statement
• Authorization methods:
– Generate a SAML authorization query
– Generate a SAML attribute query
• Postprocessing:
– Generate a SAML V1.0, V1.1, or V2.0 assertion
Notes:
In addition to the previously covered scenarios, an access control policy can parse any token type
and make a SAML authorization or attribute query to an external server. To avoid repeating security
checks, the policy can generate a SAML assertion during the post processing stage.
TR-375528 *****
V10.1
Student Notebook
Uempty
Unit summary
Having completed this unit, you should be able to:
• Describe the AAA framework within the DataPower Appliance
• Explain the purpose of each step in an access control policy
• Authenticate and authorize web service requests with:
– WS-Security Username and binary security tokens
– HTTP Authorization header claims
– Security Assertion Markup Language (SAML) assertions
Notes:
© Copyright IBM Corp. 2015 Unit 9. Authentication, authorization, and auditing (AAA) 9-41
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Checkpoint questions
1. True or False: To authenticate a client without using an external
access control resource, compare the client’s credentials against a
custom DataPower AAA XML file or validate the digital signature that
is used to sign the credential.
Notes:
Write your answers here:
1.
2.
3.
TR-375528 *****
V10.1
Student Notebook
Uempty
Checkpoint answers
1. True.
2. True.
3. True.
Notes:
© Copyright IBM Corp. 2015 Unit 9. Authentication, authorization, and auditing (AAA) 9-43
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Exercise 7
Notes:
TR-375528 *****
V10.1
Student Notebook
Uempty
Exercise objectives
After completing this exercise, you should be able to:
• Configure an action to enforce authentication and authorization policies
• Configure an action to verify an SAML assertion token for
authentication and authorization purposes
Notes:
© Copyright IBM Corp. 2015 Unit 9. Authentication, authorization, and auditing (AAA) 9-45
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Exercise overview
• Configure BookingServiceProxy for authentication by using a AAA
action that gets the userid/password information from an HTTP
authentication header and authenticates with a AAAInfo file
• Send a request from SoapUI that contains an HTTP authentication
header and is authenticated with a AAAInfo file
• Configure the AAA policy to use a SAML attribute assertion
• Send a request from SoapUI that contains a message with a SAML
attribute assertion
Notes:
TR-375528 *****
V10.1
Student Notebook
Uempty
Unit 10. REST and JSON support for Web 2.0 and
mobile applications
References
IBM DataPower Gateway Knowledge Center:
http://www.ibm.com/support/knowledgecenter/SS9H2Y_7.1.0
© Copyright IBM Corp. 2015 Unit 10. REST and JSON support for Web 2.0 and mobile applications 10-1
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Unit objectives
After completing this unit, you should be able to:
• Use a DataPower appliance to proxy back-end applications for mobile
clients
• Describe the purpose of a REST architecture
• Add support to DataPower services for the REST application
programming interface (API)
• Describe how to integrate with systems by using RESTful services
• Use the DataPower appliance to proxy a RESTful service
Notes:
TR-375528 *****
V10.1
Student Notebook
Uempty
Notes:
© Copyright IBM Corp. 2015 Unit 10. REST and JSON support for Web 2.0 and mobile applications 10-3
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Ajax
Atom
JavaScript
RSS
XML
JSON Enterprise SOA
REST
Web-SOA
bridge
WSDL J2SE
Web SOA
SOAP Java EE
WS-* JMS
JDBC
Figure 10-3. Web SOA (Web 2.0) versus Enterprise SOA WE711 / ZE7111.0
Notes:
The enterprise SOA and web SOA have different standards, protocols, and techniques. At times, a
Web 2.0 client needs to access the enterprise SOA, so some bridging code is necessary. The
typical Web 2.0 client platform is a desktop web browser.
TR-375528 *****
V10.1
Student Notebook
Uempty
Notes:
Comet is a programming and design technique. It is a model in which a web server can push data
to the browser, without the browser explicitly requesting it.
JSON-RPC is a Remote Procedure Call (RPC) protocol that is coded in a JSON format.
Bayeux is a JSON-based protocol for publish/subscribe event management. It uses Ajax and
Comet.
RSS is a web feed format for supporting syndications, such as blogs and news. It uses an
XML-based structure. There are many versions of RSS, and not all are compatible.
The term “Atom” refers to two related standards. The Atom Syndication Format is an XML structure
for web feeds. The Atom Publishing Protocol is a protocol for creating and updating web resources.
Atom was developed as an alternative and improvement to RSS.
© Copyright IBM Corp. 2015 Unit 10. REST and JSON support for Web 2.0 and mobile applications 10-5
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Notes:
Desktop web browsers are no longer the single target client. Many clients now use smartphones
and tablets, in addition to their desktop browsers.
Mobile clients might continue to use a web browser interface, but they use it from their device
instead of a desktop.
Mobile applications can be developed that use the native capabilities of the device, and look
different from the web browser interface. These types of applications are usually written by using a
software development kit (SDK).
TR-375528 *****
V10.1
Student Notebook
Uempty
REST/JSON
applications
REST
JSON
XML/web services
applications
Browser © Copyright IBM Corporation 2015
Figure 10-6. DataPower as the reverse proxy for Web 2.0 / Mobile clients WE711 / ZE7111.0
Notes:
Regardless of whether the clients are on a mobile device or a desktop browser, they can all
communicate to the application by using REST and JSON.
The clients see only the DataPower service, and are not aware of the actual back-end application.
The back-end applications, regardless of technology, accept traffic only from the appliance. This
arrangement is commonly called a “reverse proxy.”
© Copyright IBM Corp. 2015 Unit 10. REST and JSON support for Web 2.0 and mobile applications 10-7
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Mobile/web
applications
Figure 10-7. Securing the reverse proxy with ISAM for Mobile WE711 / ZE7111.0
Notes:
By integrating with ISAM for Mobile, the Access Manager Reverse Proxy service can provide more
security support beyond forms authentication or HTTP basic authorization. This service and ISAM
for Mobile also supports more advanced protection such as One-Time Password (OTP),
Multi-factor Authentication (MFA), and Context-based access (CBA).
The Access Manager Reverse Proxy service itself can secure a directory tree-like structure of web
resources. Additionally, the Access Manager Reverse Proxy service can chain with a multi-protocol
gateway service to offer further mediation of the message contents.
The Access Manager Reverse Proxy service capabilities are similar to the capabilities of
WebSEAL. IBM Tivoli Access Manager WebSEAL is a web server that applies fine-grained security
policy to the Tivoli Access Manager protected web object space. WebSEAL can provide single
sign-on solutions and incorporate back-end web application server resources into its security policy.
The Access Manager Reverse Proxy service requires the ISAM Proxy module to be licensed and
installed on the appliance.
TR-375528 *****
V10.1
Student Notebook
Uempty
Introduction to REST
Representational State Transfer (REST) is an architectural style for
accessing resources across a network:
• Application state and functions are divided into resources
• Every resource is uniquely addressable with a universal syntax
• All resources are accessible with a uniform, generic interface
• A client/server architecture with a pull-based interaction style
• Each request from the client to the server must contain all necessary
information to understand the request
– REST architectures cannot rely on stored context on the server
• REST is a design pattern, not a standard
• In a Web 2.0 context, REST describes a way to design web
applications that:
– Address resources through URIs
– Access resources through HTTP methods
Notes:
REST originated from a PhD dissertation from Roy Thomas Fielding called “Architectural Styles
and the Design of Network-based Software Architectures.” For more information, see:
http://www.ics.uci.edu/~fielding/pubs/dissertation/top.htm
© Copyright IBM Corp. 2015 Unit 10. REST and JSON support for Web 2.0 and mobile applications 10-9
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
• DELETE • POST
– Remove a resource – Create a resource in this collection;
from the server let the server pick the resource’s URL
– Idempotent – Also for invoking a handler, “process
this”
– Has side effect
– Non-idempotent
– Usually has side effects
Notes:
A REST service is based on well-defined verbs, and well-defined rules about what operations are
allowed when using those verbs.
Running an idempotent request more than once yields the same result as would occur by running it
once. For example, a client might send a series of idempotent requests and then get disconnected
from the server without getting confirmation that the requests completed. If this situation happens,
the client can safely try the series of idempotent requests again without worrying that duplicate
records are created, or data is deleted that should not be.
For REST in a web environment, these verbs match with the HTTP methods.
TR-375528 *****
V10.1
Student Notebook
Uempty
Operations
• Add employee (Create)
• Query for information about employee or employees (Read)
• Modify an employee’s information (Update)
• Remove an employee (Delete)
• Create, read, update, and delete for salary history
– Give an employee a raise = update salary history
• Create, read, update, and delete for performance reviews
© Copyright IBM Corporation 2015
Notes:
Here is an example of simple service for processing employees. You defined the resources that are
exposed, and a description of the operations you want to perform on those resources.
© Copyright IBM Corp. 2015 Unit 10. REST and JSON support for Web 2.0 and mobile applications 10-11
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
* Because of access control, status codes might include 401 and 403
© Copyright IBM Corporation 2015
Notes:
Here is your design for the employee processing service. You defined the resources, defined the
formats, chose the operations, and defined the status codes.
The typical status codes that you encounter are:
• 200: OK
• 201: Resource created
• 204: No content, successful request but no body returned
• 3XX: Redirection
• 400: Bad request, malformed syntax of request
• 401: Unauthorized, a WWW-Authenticate header is returned with a challenge dialog box
• 403: Forbidden, the server refuses the request
• 404: Not found
• 500: Internal server error
TR-375528 *****
V10.1
Student Notebook
Uempty
POST /employee/
["John Smith", "Development"]
GET /employee/101/
time
DELETE /employee/101/
Notes:
A RESTful interaction shows a client interacting with HTTP and a RESTful URI, and describing
intent with the HTTP method.
© Copyright IBM Corp. 2015 Unit 10. REST and JSON support for Web 2.0 and mobile applications 10-13
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Figure 10-13. Example: Add employee REST request explained WE711 / ZE7111.0
Notes:
TR-375528 *****
V10.1
Student Notebook
Uempty
Figure 10-14. Example: Add employee REST response explained WE711 / ZE7111.0
Notes:
HTTP status code 201 is defined as “CREATED”.
© Copyright IBM Corp. 2015 Unit 10. REST and JSON support for Web 2.0 and mobile applications 10-15
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
WSP
SOAP SOAP
Existing
Web services service policy
client
Notes:
WSP is web service proxy.
MPGW is multi-protocol gateway.
The REST facade service also converts the SOAP response into a REST response.
TR-375528 *****
V10.1
Student Notebook
Uempty
MPGW
REST Request reformatting, SOAP
REST Other processing actions
client
Web services
back-end system
Notes:
© Copyright IBM Corp. 2015 Unit 10. REST and JSON support for Web 2.0 and mobile applications 10-17
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
MPGW
REST REST
More message processing
REST
client
REST-based
back-end system
Figure 10-17. Common DataPower REST patterns: REST enrichment WE711 / ZE7111.0
Notes:
The back-end system already has a RESTful interface, but extra processing of the message is
required.
TR-375528 *****
V10.1
Student Notebook
Uempty
Figure 10-18. Tools to support REST: Service or protocol handler related WE711 / ZE7111.0
Notes:
The first topic is on the DataPower tools to support REST that are configured at the service level or
the protocol handler level.
MPGW is multi-protocol gateway service.
XMLFW is XML firewall service.
© Copyright IBM Corp. 2015 Unit 10. REST and JSON support for Web 2.0 and mobile applications 10-19
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Figure 10-19. Front side handler support of HTTP method selection WE711 / ZE7111.0
Notes:
The selection of allowed methods has been available for many years, irrespective of the REST
model.
TR-375528 *****
V10.1
Student Notebook
Uempty
Notes:
More information is presented on JSON in this unit.
© Copyright IBM Corp. 2015 Unit 10. REST and JSON support for Web 2.0 and mobile applications 10-21
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Notes:
This option controls whether to force the processing of XML messages when their message body is
empty or missing in RESTful web services.
This option applies when the request or response type is XML, JSON, or Non-XML.
TR-375528 *****
V10.1
Student Notebook
Uempty
Notes:
These settings control the character length of the label, the string value, and the number value. It
also sets the maximum nesting depth of elements, and the total message size.
Messages that violate these limits are rejected.
© Copyright IBM Corp. 2015 Unit 10. REST and JSON support for Web 2.0 and mobile applications 10-23
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Figure 10-23. Tools to support REST: Service policy related WE711 / ZE7111.0
Notes:
The second topic is on the DataPower tools to support REST that are configured within a service
policy.
Fetch, Results, Results Async, and Log actions can make http:// calls, which allows these actions to
make REST-based calls.
TR-375528 *****
V10.1
Student Notebook
Uempty
Notes:
default indicates that either a GET or POST successfully matches.
© Copyright IBM Corp. 2015 Unit 10. REST and JSON support for Web 2.0 and mobile applications 10-25
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Figure 10-25. Changing the HTTP method in the processing rule WE711 / ZE7111.0
Notes:
TR-375528 *****
V10.1
Student Notebook
Uempty
Notes:
This action converts non-XML CGI-encoded input (an HTTP POST of HTML form or URI
parameters) into an equivalent XML message.
The choices for the encoding conversions are: Plain, URL-encoded, XML, URL-encoded XML,
Base 64, and JSON.
The JSON conversion is covered later.
© Copyright IBM Corp. 2015 Unit 10. REST and JSON support for Web 2.0 and mobile applications 10-27
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
curl -G
"http://dphost:port/EastAddressSearch/people/
?firstName=Victor&lastName=Collins&title=Mr"
Figure 10-27. Convert Query Params to XML action example WE711 / ZE7111.0
Notes:
The “-G” tells cURL to use an HTTP GET on the request.
TR-375528 *****
V10.1
Student Notebook
Uempty
Notes:
dp:http-request-method() is a metadata extension function.
The variable that contains the HTTP protocol method has both a slash notation
(var://service/protocol-method) and a dot notation (serviceVars.protocolMethod). In
GatewayScript, you can use either one.
Not all variables support the dot notation. For more information, see the product documentation.
© Copyright IBM Corp. 2015 Unit 10. REST and JSON support for Web 2.0 and mobile applications 10-29
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Figure 10-29. Programmatic access to the HTTP status code WE711 / ZE7111.0
Notes:
Specific HTTP status codes are usually part of the RESTful interface definition.
TR-375528 *****
V10.1
Student Notebook
Uempty
JSON
• JavaScript Object Notation
– Subset of JavaScript
– Minimal
– Lightweight
– Text-based
– Language-independent
– Easy to parse
– Not a document format
Notes:
XML can be cumbersome in JavaScript to navigate so you move towards using JSON as a
structured format. JSON, short for JavaScript Object Notation, is a lightweight computer data
interchange format. It is a text-based, human-readable format for representing simple data
structures, and associative arrays (called objects). The JSON format is often used for transmitting
structured data over a network connection in a process called serialization. Its main application is in
Ajax web application programming, where it serves as an alternative to the traditional use of the
XML format. JSON is a simple, common representation of data that can be used for communication
between servers and browser clients, communication between peers, and language-independent
data interchange.
© Copyright IBM Corp. 2015 Unit 10. REST and JSON support for Web 2.0 and mobile applications 10-31
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
"Hello world!\n"
A string is a sequence of zero or more Unicode
characters
true
A boolean is a literal value of either true or
false
Notes:
JSON values must be an object, array, number, or string, or one of the three literal names: false,
true, null.
TR-375528 *****
V10.1
Student Notebook
Uempty
Notes:
On the left of the figure is an XML representation of a Person. On the right of the figure is the JSON
equivalent.
© Copyright IBM Corp. 2015 Unit 10. REST and JSON support for Web 2.0 and mobile applications 10-33
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
JSONx
• Is an XML encoding of a JSON data structure
• Used by several IBM products
• Is an Internet Draft in the IETF
– tools.ietf.org/html/draft-rsalz-jsonx-00
• The root element is a <json:object> or <json:array> element
• Child elements are elements that are related to the JSON types
– <json:array>
– <json:boolean>
– <json:string>
– <json:object>
– <json:number>
– <json:array>
– <json:null>
Notes:
IETF is Internet Engineering Task Force.
TR-375528 *****
V10.1
Student Notebook
Uempty
Notes:
Person, details, and name are JSON objects.
City, state, street, firstName, lastName, and title are JSON strings.
Zipcode is a JSON number.
There are related JSONx elements to match the JSON data types.
© Copyright IBM Corp. 2015 Unit 10. REST and JSON support for Web 2.0 and mobile applications 10-35
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Notes:
Whether you choose a request type of Non-XML or of JSON depends on the needs of your service
policy.
TR-375528 *****
V10.1
Student Notebook
Uempty
Notes:
© Copyright IBM Corp. 2015 Unit 10. REST and JSON support for Web 2.0 and mobile applications 10-37
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Notes:
The Validate action is also used to validate the schema of JSON structures. The JSON schema
URL can reference either a local or a remote file.
The expected file type for a JSON schema is JSV or JSON.
DataPower version 7.1.0 supports several JSON schema specifications:
• JSON Schema: core definitions and terminology -
http://tools.ietf.org/html/draft-zyp-json-schema-04
• JSON Schema: interactive and non-interactive validation -
http://tools.ietf.org/html/draft-fge-json-schema-validation-00
TR-375528 *****
V10.1
Student Notebook
Uempty
{ {"type":"object",
"Person":{ "$schema": "http://json-schema.org/
draft-04/schema",
"details":{
"properties":{
"city":"Cleveland", "Person": {
"state":"OH", "type":"object",
"street":"36 Lincoln Ave", "properties":{
"details": {
"zipcode":44111
"type":"object",
}, "properties":{
"city": { "type":"string" },
"name":{ "state": { "type":"string" },
"firstname":"Sarah", "street": { "type":"string" },
"zipcode": { "type":"number" }
"lastname":"Chan",
}
"title":"Mrs" },
} "name": {
} "type":"object",
} (and so on)
Notes:
The schema does not show constraints like required items, numeric ranges, and other constraints.
© Copyright IBM Corp. 2015 Unit 10. REST and JSON support for Web 2.0 and mobile applications 10-39
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
• XQuery is a query language for XML data (like SQL for relational data)
– DataPower V6.0.0
added the support for
the JSONiq extension
(JSON support)
• Input Language:
– JSON
– XML
– XSD
• Transform Language:
– XQuery
Figure 10-39. Transform action that uses XQuery (JSON and XML) WE711 / ZE7111.0
Notes:
This option for the Transform action supports XQuery as the transformation language, rather than
XSLT.
XQuery is a language that is designed to query XML data, much as SQL is used to query relational
data. It uses XPath and XML elements, much like a style sheet, but it also supports an SQL-like
query function: for, let, where, order by, return (FLWOR). DataPower supplies several extension
functions to XQuery to allow manipulation of DataPower variables and protocol headers.
DataPower V6.0.0 included the JSONiq extension to XQuery. This extension added support for
JSON to XQuery.
DataPower Version 7.1.0 supports XQuery 1.0 and its related specifications. The JSONiq extension
support is for 0.4.42.
The Input Language indicates whether the input document is JSON or XML. The third option of
XSD indicates that the input document is XML, but it also displays another entry field that accepts
an XML schema file location. This schema is used to type the data (integer, number, text, for
example) for the XQuery processing, but it does not validate against the schema. To do that, you
must use a Validate action.
TR-375528 *****
V10.1
Student Notebook
Uempty The Transform Language indicates the language of the transformation file. The only valid option
currently is XQuery.
The URL Rewrite Policy rewrites external references that are contained within the input document.
© Copyright IBM Corp. 2015 Unit 10. REST and JSON support for Web 2.0 and mobile applications 10-41
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
XQuery/JSONiq example
• JSON input message
[{"firstname":"John", "lastname":"Smith", "order":"20223", "price":23.95},
{"firstname":"Alice", "lastname":"Brown", "order":"54321", "price":199.95},
{"firstname":"John", "lastname":"Smith", "order":"23420", "price":104.95},
{"firstname":"Bob", "lastname":"Green", "order":"90231", "price":300.00},
{"firstname":"Scott", "lastname":"Jones", "order":"54321", "price":99.95},
{"firstname":"Jim", "lastname":"Lee", "order":"89820", "price":46.50}]
• From the array, return the name of any customers who have
an order value of $100 or more, ordered by lastname
declare option jsoniq-version "0.4.42";
for $x in jn:members(.)
where $x("price") >= 100.00
order by $x("lastname")
return concat($x("firstname"), ' ', $x("lastname"), '
')
Alice Brown
Output message Bob Green
Scott Jones
John Smith © Copyright IBM Corporation 2015
Notes:
Regarding JSON, Xquery/JSONiq can be used for such operations as:
• Transforming JSON objects into a text report
• Converting JSON objects to XML elements
• Converting XML elements to JSON objects
• Transforming a JSON object into a new JSON object
'
' is an encoded newline character.
TR-375528 *****
V10.1
Student Notebook
Uempty
Notes:
© Copyright IBM Corp. 2015 Unit 10. REST and JSON support for Web 2.0 and mobile applications 10-43
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Figure 10-42. Sample GatewayScript: JSON input to SOAP output WE711 / ZE7111.0
Notes:
“session.input” identifies the input context for this action.
The “readAsJSON” method reads the context and places it into an object named “json”. If there is
an error on the read operation, an error message is written to the output context.
“debugger” enables the CLI debugger capability.
The input “json” object is read to retrieve the reference number and last name of the passenger.
Those values are placed into variables that are used later in the script.
Information on the request is written to the system log at the information level.
The SOAP message is literally constructed. The reference number and last name are retrieved and
placed as contents within the message. The SOAP message is written to the output context of the
action.
The typical spacing of the code is compressed to fit the slide.
TR-375528 *****
V10.1
Student Notebook
Uempty
• In the request:
– Match on HTTP method = GET
– Convert URI parameters to an XML structure
– Build the SOAP request
– Set the HTTP method to POST
– Set the back-end URL
– Set the back-end URI
• In the response:
– Match on all URLs
– Transform the SOAP response to a JSONx structure
– Transform the JSONx to JSON by using jsonx2json.xsl
© Copyright IBM Corporation 2015
Figure 10-43. Bridging REST and SOAP: Sample service policy #1 WE711 / ZE7111.0
Notes:
The request rule converts the REST request into a SOAP request for the web services back-end
system.
The response rule converts the SOAP response into a REST response that includes a JSON
structure.
This approach is an XML and style sheet focused approach.
© Copyright IBM Corp. 2015 Unit 10. REST and JSON support for Web 2.0 and mobile applications 10-45
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
• In the request:
– Match on HTTP method = GET
– Convert URI parameters to an XML structure
– Normalize the XML with an identity transform
– Set the HTTP method to POST
– Set the back-end URI
• In the response:
– Use XPath to match on the specific response
– Use XQuery and JSONiq to convert the SOAP response to a JSON response
Figure 10-44. Bridging REST and SOAP: Sample service policy #2 WE711 / ZE7111.0
Notes:
The request rule converts the REST request into a SOAP request for the web services back-end
system.
The response rule converts the SOAP response into a REST response that includes a JSON
structure.
This approach is a GatewayScript and XQuery focused approach.
TR-375528 *****
V10.1
Student Notebook
Uempty
Unit summary
Having completed this unit, you should be able to:
• Use a DataPower appliance to proxy back-end applications for mobile
clients
• Describe the purpose of a REST architecture
• Add support to DataPower services for the REST application
programming interface (API)
• Describe how to integrate with systems by using RESTful services
• Use the DataPower appliance to proxy a RESTful service
Notes:
© Copyright IBM Corp. 2015 Unit 10. REST and JSON support for Web 2.0 and mobile applications 10-47
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Checkpoint questions
1. True or False: Mobile clients differ from desktop clients only in the
capabilities of their web browsers.
4. List the non-XML types that the Convert Query Params to XML action
supports.
5. In a service policy, you can change the HTTP method by using the
action:
A. Convert query parameters
B. Header rewrite
C. Method rewrite
© Copyright IBM Corporation 2015
Notes:
Write your answers here:
1.
2.
3.
4.
5.
TR-375528 *****
V10.1
Student Notebook
Uempty
Checkpoint answers
1. False: Mobile clients can have mobile applications that are written for
the device, and do not use a browser interface.
4. The three types of non-XML data that the Convert Query Params to
XML action supports are HTTP POST, HTML form, or URI
parameters.
5. C. Method rewrite.
© Copyright IBM Corporation 2015
Notes:
© Copyright IBM Corp. 2015 Unit 10. REST and JSON support for Web 2.0 and mobile applications 10-49
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Exercise 8
Notes:
TR-375528 *****
V10.1
Student Notebook
Uempty
Exercise objectives
After completing this exercise, you should be able to:
• Create a service policy to handle JSON and REST requests and
responses
• Use a GatewayScript to build a SOAP request from HTTP query
parameters or JSON
• Enable and use the CLI debugger
• Define and use style sheet parameters
• Convert a SOAP response to a JSON-formatted data structure by using
XQuery/JSONiq
Notes:
© Copyright IBM Corp. 2015 Unit 10. REST and JSON support for Web 2.0 and mobile applications 10-51
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Exercise overview
• Receive a request that includes the input as JSON data in the HTTP
body, and convert it to a standard SOAP request for the back-end web
service. Convert the SOAP response to a JSON structure for the client.
• Test with SoapUI
• Add JSON schema validation, and test
• Use the CLI GatewayScript debugger
• Receive a REST GET request and convert it to a standard SOAP
request for the back-end web service. Convert the SOAP response to a
JSON structure for the client
• Test with SoapUI
Notes:
TR-375528 *****
V10.1
Student Notebook
Uempty
Unit 11. OAuth overview and DataPower
implementation
References
IBM DataPower Gateway Knowledge Center:
http://www.ibm.com/support/knowledgecenter/SS9H2Y_7.1.0
© Copyright IBM Corp. 2015 Unit 11. OAuth overview and DataPower implementation 11-1
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Unit objectives
After completing this unit, you should be able to:
• Describe the OAuth framework
• Describe why OAuth is useful in security scenarios
• Describe the OAuth three-legged scenario
• Explain the role that a DataPower appliance performs in an OAuth
framework
• Describe the OAuth configuration options on DataPower: the web
token service, the AAA action, the OAuth client profile, and the OAuth
client group
Notes:
TR-375528 *****
V10.1
Student Notebook
Uempty
What is OAuth?
• OAuth defines a way for a client to access server resources on behalf
of another party
• It provides a way for the user to authorize a third party to their server
resources without sharing their credentials
Notes:
The OAuth specification solves a specific problem: how to delegate access rights to a third-party
client that is working on behalf of the user. Before OAuth, third-party applications asked and stored
the user’s user name and password within the application. This process is risky because the server
cannot distinguish between the user and the third-party application. One analogy in the real world is
to hand over your house keys to a cleaning service. You must have a high degree of trust in the
client to give them complete access to your home.
With OAuth, the client does not use your credentials. Instead, an authorization service gives a
temporary pass to the client, so it can perform a limited set of tasks in a fixed time period. As the
user, you can tell the authorization service to revoke the temporary pass at any time.
Although OAuth is more complicated than handing over your credentials to the client, it is a safer
mechanism that gives the user control over the third-party client’s actions.
© Copyright IBM Corp. 2015 Unit 11. OAuth overview and DataPower implementation 11-3
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
• The valet can use your car with this key, with some restrictions:
– Speed restriction
– Distance restriction
– Cannot alter some car functions, such as radio stations
– Cannot open car storage areas
• When you allow the valet to borrow the valet key, you delegate access
to certain features of the car to a third party.
Notes:
When you purchase a car, you receive a main key and a valet key.
The valet can use your car with this key, with some restrictions. The car cannot exceed a certain
speed. The car might not be able to travel as far as with the regular key. The valet cannot change
the radio station settings. The valet cannot open car storage areas.
When you allow the valet to borrow the valet key, you delegate access to certain features of the car
to a third party.
TR-375528 *****
V10.1
Student Notebook
Uempty
1 2
Figure 11-4. Example: Allow third-party access to social account WE711 / ZE7111.0
Notes:
Whenever you sign up for a web-based application or a mobile application, you create an account
on the server with a user name and password. The process becomes tedious for the user when
they sign up for dozens of applications.
Social networks, such as Facebook and Twitter, already link your identity to a user account.
Therefore, many applications use your social network account to create an account.
There are three players in this scenario. You as the user; the third-party application as a client; and
the social network as a web-based service. You want the third-party application to access some
(but not all) of your information from the service. That is, you want the client to act on your behalf to
access resources on the service.
In this example, the third-party application, the Print Shoppe, wants to access your online photo
album from your social network account. The application opens a new page from the social network
site. After you log in to the social network, the social network service grants an authorization token
to the application. At no time does the third-party application see your user name or password on
the social network.
© Copyright IBM Corp. 2015 Unit 11. OAuth overview and DataPower implementation 11-5
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Figure 11-5. Example: Third-party access to online photo album WE711 / ZE7111.0
Notes:
Take a closer look at the three actors in the OAuth scenario. Alice is the owner of an online photo
album. As the user, Alice wants to print her photos with a third-party photo printing service. The
Print Shoppe is a third-party client application that wants to access Alice's photos from the online
service. Last, the social network is a service that securely stores Alice's photos. This service also
manages access to the photos from Alice and third-party applications that act on Alice's behalf.
TR-375528 *****
V10.1
Student Notebook
Uempty
Request access
Grant access to
with user
resources
credentials
Access granted
Notes:
Without OAuth, the user must give their user name and password to the third-party application. In
turn, the third-party application sends these credentials while posing as the user. For convenience's
sake, the application saves a copy of the user name and password.
There are several issues with this scenario. First, the service cannot distinguish between the owner
of the resource, and the third-party application. To the service, it is the same user that is accessing
the application. This practice is not safe; the user does not know what the application reads or
modifies on the service. Second, there is no simple way to revoke access for one particular
third-party application. The user must reset their password, which breaks access from all third-party
applications.
© Copyright IBM Corp. 2015 Unit 11. OAuth overview and DataPower implementation 11-7
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Figure 11-7. OAuth Step 1: Resource owner requests access WE711 / ZE7111.0
Notes:
In this scenario, Alice is the owner of a photo album that is hosted on an online photo service. Alice
wants to print a set of photos with a photo printing service. Alice is the resource owner, and the
photo printing service is a third-party OAuth client application. Alice starts the process when she
selects the "print from my photo album" option in the third-party application.
TR-375528 *****
V10.1
Student Notebook
Uempty
Figure 11-8. OAuth Step 2: OAuth client redirection to owner WE711 / ZE7111.0
Notes:
In the second step, the third-party application requires the resource owner's authorization before it
can access her online photo album. Instead of asking Alice directly for her user credentials, the
third-party client application redirects Alice's request to an authorization server.
© Copyright IBM Corp. 2015 Unit 11. OAuth overview and DataPower implementation 11-9
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Authorization server
Figure 11-9. OAuth Step 3: Authenticate owner with authorization server WE711 / ZE7111.0
Notes:
In the third step, the authorization server asks for Alice's user credentials to verify her identity.
TR-375528 *****
V10.1
Student Notebook
Uempty
Authorization server
Figure 11-10. OAuth Step 4: Ask resource owner to grant access to resources WE711 / ZE7111.0
Notes:
The authorization server returns a web form to ask Alice whether she grants the OAuth client
access to her resources.
© Copyright IBM Corp. 2015 Unit 11. OAuth overview and DataPower implementation 11-11
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Authorization server
Figure 11-11. OAuth Step 5: Resource owner grants client access to resources WE711 / ZE7111.0
Notes:
The resource owner, Alice, submits the web form to allow or deny access to her resources.
TR-375528 *****
V10.1
Student Notebook
Uempty
Authorization server
Figure 11-12. OAuth Step 6: Authorization server sends authorization grant code to client WE711 / ZE7111.0
Notes:
The authorization server never transmits the resource owner's user name and password to the
OAuth client. Instead, the server sends an authorization grant code: a token that allows the OAuth
client to access Alice's resources on her behalf.
© Copyright IBM Corp. 2015 Unit 11. OAuth overview and DataPower implementation 11-13
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Authorization server
Figure 11-13. OAuth Step 7: Client requests access token from authorization server WE711 / ZE7111.0
Notes:
The OAuth client sends three pieces of information to the authorization server: an authorization
grant code, the client ID, and the client secret or client certificate. If the OAuth client is a public
client, then it does not send the client secret or certificate.
TR-375528 *****
V10.1
Student Notebook
Uempty
Authorization server
Figure 11-14. OAuth Step 8: Authorization server sends authorization token to client WE711 / ZE7111.0
Notes:
Optionally, the authorization server can also return a refresh token. After the current access token
expires, the OAuth client sends the refresh token to the authorization server to request another
access token.
© Copyright IBM Corp. 2015 Unit 11. OAuth overview and DataPower implementation 11-15
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Authorization server
Figure 11-15. OAuth Step 9: OAuth client sends access token to resource server WE711 / ZE7111.0
Notes:
It is possible that the authorization server and the resource server are the same server.
TR-375528 *****
V10.1
Student Notebook
Uempty
Authorization server
Figure 11-16. OAuth Step 10: Resource server grants access to OAuth client WE711 / ZE7111.0
Notes:
Optionally, the authorization server can also return a refresh token. After the current access token
expires, the OAuth client sends the refresh token to the authorization server to request another
access token.
© Copyright IBM Corp. 2015 Unit 11. OAuth overview and DataPower implementation 11-17
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
An entity capable of granting access The server that issues access tokens
to a protected resource. When the to the client after successfully
resource owner is a person, it is authenticating the resource owner
referred to as a user. and obtaining authorization.
Notes:
These items are the role definitions that are directly from the specification.
TR-375528 *****
V10.1
Student Notebook
Uempty
Resource owner
Notes:
Although some implementations of OAuth combine the roles into what appears to be a single
“server,” the roles and protocols are still the same.
© Copyright IBM Corp. 2015 Unit 11. OAuth overview and DataPower implementation 11-19
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Figure 11-19. OAuth 2.0 roles in the DataPower world (1 of 2) WE711 / ZE7111.0
Notes:
These names are the OAuth roles as they can be implemented in a DataPower environment.
DataPower does separate the authorization server function from the resource server function,
contrary to many online systems that perform the two functions within the same system.
A web token service is defined as an authorization server and a token endpoint. The authorization
behavior is as you expect. The token endpoint refers to the service’s ability to supply an access
token back to the client.
TR-375528 *****
V10.1
Student Notebook
Uempty
Resource server
MPGW
OAuth client
Resource application
Client code
in web server MPGW
Figure 11-20. OAuth 2.0 roles in the DataPower world (2 of 2) WE711 / ZE7111.0
Notes:
The resource server is also considered as the enforcement point (EP) of the secured access to the
actual back-end application.
The resource application can be another service on the appliance, or an application service that is
running on a server in the trusted domain.
DataPower also supports scenarios where the authorization server is not a DataPower service
while the resource server is on DataPower, and the reverse situation.
Tivoli Federated Identity Manager also provides an OAuth authorization server implementation. A
DataPower-based resource server can interact with the Tivoli Federated Identity Manager-based
authorization server. The DataPower resource server sends a WS-Trust request to Tivoli Federated
Identity Manager to have the access token validated.
© Copyright IBM Corp. 2015 Unit 11. OAuth overview and DataPower implementation 11-21
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
OAuth client
Resource server
Client code in
web server MPGW
Notes:
1. The OAuth 2.0 specification does not specify how the access token is formed or validated.
DataPower defines its own implementation of the token format and validation, so both the web
token service and the resource server use the same implementation.
2. The required parameters for the actual OAuth client are defined in an OAuth client profile object
that the web token service and the resource server can access.
TR-375528 *****
V10.1
Student Notebook
Uempty
OAuth client
Resource server
Client code in
web server MPGW
Notes:
This diagram is a sample flow of the grant type of authorization code. There are more grant types:
implicit, resource owner password credentials, and client credentials. For more information, see the
specification.
The user requests the resource from the client.
© Copyright IBM Corp. 2015 Unit 11. OAuth overview and DataPower implementation 11-23
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
OAuth client
Resource server
Client code in
web server MPGW
Notes:
TR-375528 *****
V10.1
Student Notebook
Uempty
3. Client returns
resource to user
Notes:
© Copyright IBM Corp. 2015 Unit 11. OAuth overview and DataPower implementation 11-25
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Authorization request
The OAuth client issues a request for an authorization grant from the
authorization server, on behalf of the user
The parameters:
• response_type: A value of “code” identifies it as a request for an
authorization grant
• client_id: The client identifier of the initiating OAuth client
– This parameter is the client identifier that the authorization server knows each
particular OAuth client by
• redirect_uri: A URL that refers to the OAuth client “entry point”
– The authorization server uses this URL for an HTTP redirection on the response
• scope: The scope of the access request
• state: A value that the OAuth client can use to maintain state between the
request and the callback
– The authorization server includes this value when redirecting the user agent
(browser) back to the client
– The parameter should be used for preventing cross-site request forgery
Notes:
TR-375528 *****
V10.1
Student Notebook
Uempty
Authorization response
The authorization server responds with an authorization grant code to
the OAuth client, by using an HTTP redirection to the user’s browser
(user agent)
The parameters:
• code: The authorization code that the authorization server generates
– The authorization code must expire shortly after it is issued to mitigate the risk of
leaks, and the client must not reuse it
• state: The “state” parameter that was present in the client
authorization request
The parameters are returned in the URI string as part of the Location
header in the redirection
Notes:
© Copyright IBM Corp. 2015 Unit 11. OAuth overview and DataPower implementation 11-27
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
The parameters:
• grant_type: The value must be set to “authorization_code”
• code: The authorization code that was received from the authorization
server
• redirect_uri: The “redirect_uri” parameter that was included in
the authorization request
– The authorization server requires that the values must be identical
• client_id: The client identifier of the initiating OAuth client
• client_secret: The client secret that is defined in the OAuth client
Notes:
TR-375528 *****
V10.1
Student Notebook
Uempty
The parameters:
• access_token: The access token that the authorization server
generates
• token_type: The type of the token
• expires_in: The lifetime in seconds of the access token
• refresh_token: (optional) The refresh token, which can be used to
obtain new access tokens by using the same authorization grant code
• scope: The scope of the request
Notes:
© Copyright IBM Corp. 2015 Unit 11. OAuth overview and DataPower implementation 11-29
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Resource request
• The OAuth client sends the request to the resource server, and
includes the access token
• The specification does not explicitly indicate the parameters on the call,
but it does indicate what must happen:
– The resource server must validate the access token
– The resource server must ensure that the token is not expired
– The resource server must validate that the token scope covers the requested
resource
• The methods that the resource server uses to validate the access
token are beyond the scope of the specification but generally involve
an interaction or coordination between the resource server and the
authorization server
Notes:
TR-375528 *****
V10.1
Student Notebook
Uempty
• The AAA policies in the web token service and the resource server
use the OAuth client profile to get details on a client that accesses the
services:
– Client ID, client credentials, Web token service
redirection URLs Authorization server/
– Style sheets for more processing Token endpoint
Resource server
OAuth client
MPGW
Client code in web server
Figure 11-30. OAuth client and the OAuth Client Profile object WE711 / ZE7111.0
Notes:
© Copyright IBM Corp. 2015 Unit 11. OAuth overview and DataPower implementation 11-31
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Notes:
With the customized OAuth option, you can write your own OAuth client behavior in a style sheet.
There are four options for OAuth 2.0 authorization grant types:
• With the authorization code, the authorization server sends back a custom redirect URI and an
authorization code after it authenticates the resource owner. The authorization code prevents
replay attacks. The client application opens the redirect URI with the authorization code to
retrieve an access token for a resource.
• With the implicit grant type, the authorization server does not send back an authorization code.
It sends back an access token after the resource owner authorizes the client application. This
grant type is available for public clients only.
• With the resource owner password credentials grant type, the client application sends the user
name and password for a user on the resource server. This grant type assumes a high level of
trust between the client application and the resource server.
• With the client credentials grant type, the client application sends its own credentials when it
accesses server resources under its own control, or to resources that are previously arranged
with the resource server. This grant type is available to confidential client types only.
TR-375528 *****
V10.1
Student Notebook
Uempty Authorization code and Implicit grant grant types are for three-legged OAuth flows. Resource
owner password credential and Client credential are for two-legged OAuth flows.
© Copyright IBM Corp. 2015 Unit 11. OAuth overview and DataPower implementation 11-33
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Text-based password
Regular expression to
check the scope of
the request
Notes:
With Customized scope check, you can use a style sheet to do the scope checking, rather than
using the Scope field entry.
TR-375528 *****
V10.1
Student Notebook
Uempty
Notes:
With Verify client credential, you can verify the client identity along with using the access token.
Use validation URL is used when you want to use a remote server to validate the access token
rather than using the DataPower resource server. This situation occurs when the authorization
server is not a DataPower web token service.
© Copyright IBM Corp. 2015 Unit 11. OAuth overview and DataPower implementation 11-35
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Caching mechanism
Expiration time in
seconds
Notes:
Caching specifies the caching mechanism to be used:
• Replay Only: Uses replay cache to prevent replay attacks
• Token Cache: Uses system memory to support revocation
• Custom: Uses a style sheet that defines how to handle revocation
Other options for adding HTTP headers for resource owner, client ID, scope, and customized
information are not shown in this screen capture.
TR-375528 *****
V10.1
Student Notebook
Uempty
Figure 11-35. DataPower OAuth objects: OAuth Client Group WE711 / ZE7111.0
Notes:
© Copyright IBM Corp. 2015 Unit 11. OAuth overview and DataPower implementation 11-37
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Processing
policy that is
implemented
in the service
Figure 11-36. DataPower OAuth objects: Web Token Service WE711 / ZE7111.0
Notes:
You can create your own DataPower service to act as the authorization server and token endpoint.
It is much easier to use the web token service type that DataPower provides.
The Client credential set specifies the character encoding of the basic authentication values.
“Protocol” indicates that the encoding is derived from what is specified in the HTTP protocol.
TR-375528 *****
V10.1
Student Notebook
Uempty
Notes:
The OAuth Client Profiles and OAuth Client Groups have no effect until they are referenced from a
AAA policy.
© Copyright IBM Corp. 2015 Unit 11. OAuth overview and DataPower implementation 11-39
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Figure 11-38. AAA policy for the web token service WE711 / ZE7111.0
Notes:
In the top screen capture, “HTTP authentication header” is also selected. That choice is why the
authentication realm is identified.
The oauth-scope-metadata contains the scope of the request.
TR-375528 *****
V10.1
Student Notebook
Uempty
• In the Resource extraction phase, you select URL sent by client and
Processing metadata, and specify the oauth-scope-metadata
Figure 11-39. AAA policy for the resource server (1 of 2) WE711 / ZE7111.0
Notes:
For V6.0 and later, the firmware verifies that the scope agreed to in the access token matches the
actual requested scope (resource extraction phase).
© Copyright IBM Corp. 2015 Unit 11. OAuth overview and DataPower implementation 11-41
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Figure 11-40. AAA policy for the resource server (2 of 2) WE711 / ZE7111.0
Notes:
TR-375528 *****
V10.1
Student Notebook
Uempty
Unit summary
Having completed this unit, you should be able to:
• Describe the OAuth framework
• Describe why OAuth is useful in security scenarios
• Describe the OAuth three-legged scenario
• Explain the role that a DataPower appliance performs in an OAuth
framework
• Describe the OAuth configuration options on DataPower: the web token
service, the AAA action, the OAuth client profile, and the OAuth client
group
Notes:
© Copyright IBM Corp. 2015 Unit 11. OAuth overview and DataPower implementation 11-43
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Checkpoint questions
1. True or False: With OAuth, resource owners allow third-party access
to the resource without sharing their credentials.
2. True or False: Three-legged OAuth is the traffic and data pattern that
OAuth is designed to solve.
Notes:
Write your answers here:
1.
2.
3.
4.
TR-375528 *****
V10.1
Student Notebook
Uempty
Checkpoint answers
1. True.
2. True.
3. A, C, and E.
Notes:
© Copyright IBM Corp. 2015 Unit 11. OAuth overview and DataPower implementation 11-45
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Exercise 9
Notes:
TR-375528 *****
V10.1
Student Notebook
Uempty
Exercise objectives
After completing this exercise, you should be able to:
• Define an OAuth Client Profile and an OAuth Client Group object
• Create a AAA policy to support the OAuth protocol
• Configure a DataPower web token service
• Configure a DataPower implementation of an OAuth resource server
Notes:
© Copyright IBM Corp. 2015 Unit 11. OAuth overview and DataPower implementation 11-47
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Application function:
• User enters the ID of a bag to request its status
• Application responds with the current details on the bag, and the time
stamp of the request
1. Initial request
Notes:
TR-375528 *****
V10.1
Student Notebook
Uempty
1. Initial request
Resource owner
Browser
Browser
2. Response
OAuth client
JavaScript code
ID of bag to find:
in web server
Search button
Notes:
The OAuth client knows:
• Client ID
• Client secret
• Scope
• State
• Web token service URL
• Resource server URL
• Its own URL
© Copyright IBM Corp. 2015 Unit 11. OAuth overview and DataPower implementation 11-49
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Browser
student/ web1sphere
5. Send login page
Notes:
Notice that the OAuth client is not involved in the login and grant interactions. The OAuth client
never sees the ID and password of the user.
TR-375528 *****
V10.1
Student Notebook
Uempty
Browser
9. Sends 302 redirect response; location
header has OAuth client entry point plus (redirected)
URI: auth grant code, state
Notes:
The user granted access permission to the OAuth client. Now the web token service is verifying the
OAuth client before giving it an access token.
Notice that the browser does not see the access token.
© Copyright IBM Corp. 2015 Unit 11. OAuth overview and DataPower implementation 11-51
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Resource server
MPGW
OAuth client
BaggageService 15. JSON response
returned to OAuth JavaScript code
MPGW client in web server
Notes:
The user granted access permission to the OAuth client. Now the web token service is verifying the
OAuth client before giving it an access token.
Notice that the browser does not see the access token.
TR-375528 *****
V10.1
Student Notebook
Uempty
Unit 12. DataPower caching
References
IBM DataPower Gateway Knowledge Center:
http://www.ibm.com/support/knowledgecenter/SS9H2Y_7.1.0
TR-375528 *****
Student Notebook
Unit objectives
After completing this unit, you should be able to:
• List some of the caching options in DataPower
• Describe the two caching approaches for documents: on-appliance
and side cache
• Configure a document cache policy
• Use the DataPower x-dp-cache-key HTTP header
• Describe how to integrate a DataPower XC10 appliance and IBM
WebSphere eXtreme Scale into DataPower caching
Notes:
TR-375528 *****
V10.1
Student Notebook
Uempty
Caching in DataPower
• Services in DataPower should not attempt to save any state
– Appliance is designed to be stateless
• However, caching is supported in many places to reduce message
throughput time
– Cache sizes are limited
– Cache entries expire or are replaced
• Cached resources
– Services/developer-related
• Document
• Style sheet
• AAA policy (authentication and authorization results)
– Operations/administrator-related
• DNS (responses from DNS servers)
• LDAP (LDAP connection pool)
• RBM (LDAP authentication)
Notes:
The services and developer-related cache resources are the resources that a developer might
configure in the development of DataPower services.
The XML manager object that is associated with each service specifies the style sheet and
document cache options.
The “Advanced” part of the AAA policy configuration wizard shows the caching options.
The Operations-relayed caching options are not covered in this course.
“DNS” is domain name server.
“RBM” is role-based management.
TR-375528 *****
Student Notebook
• Side caching
2 3 5
1 4
6
Improved
Client response time DataPower XI/XG/XB/IDG Provider
appliances © Copyright IBM Corporation 2015
Figure 12-3. Document caching: On and off the appliance WE711 / ZE7111.0
Notes:
The web application and web services caching uses the document cache on the appliance. The
purpose is to find responses that are cached on the appliance and return them from the cache. By
avoiding a call to the application servers, you greatly reduce the response time to the client,
resource usage on the appliance, and load on the application servers.
The client requests a resource (1). If the resource is not in the document cache, the request is sent
to the application server (2). The response is cached, and then sent to the client. On a subsequent
request for the same resource (1), the response is found already in the cache, and it is returned
immediately to the client (3).
The on-appliance document cache is restricted in size. For larger caching requirements, you can
implement side-caching. In this scenario, the cache resides in an off-appliance cache such as an
XC10 appliance or an IBM WebSphere eXtreme Scale server. The flow for this scenario is similar to
the on-appliance scenario, except you must code some of the caching behavior in the service. On
first request for a resource (1), the service sends a REST call to the cache (2). If the resource is not
there (3), the service sends the request to the application server (4). On response, the service
writes the resource to the side cache by using a REST call (5), and then returns it to the client (6).
TR-375528 *****
V10.1
Student Notebook
Uempty On the second request (1), the REST call from the service (2) retrieves the resource (3), and the
response is sent to the client (6), bypassing the request to the application server.
TR-375528 *****
Student Notebook
Maximum
number of style
sheets
Figure 12-4. Document and style sheet caching in the XML manager WE711 / ZE7111.0
Notes:
TR-375528 *****
V10.1
Student Notebook
Uempty
Notes:
You can use wildcards to define a match pattern as follows:
• *: The string wildcard matches 0 or more occurrences of any character.
• ?: The single character wildcard matches one occurrence of any single character.
• []: The delimiters bracket a character or number range or set of specific values.
If two different policies have the same priority, the first policy in the alphabetized list is selected.
If you specify an XC10 grid object, the DataPower firmware manages the REST calls to the XC10
appliance for the document cache. This option gives you the benefits of off-appliance caching with
the simplicity of a document cache policy. No extra style sheet coding is needed.
TR-375528 *****
Student Notebook
Notes:
If HTTP cache validation is enabled, the cache accepts the HTTP request headers:
If-Modified-Since, If-Unmodified-Since, If-Match, and If-None-Match.
TR-375528 *****
V10.1
Student Notebook
Uempty
Notes:
TR-375528 *****
Student Notebook
• Document Status lists the URL and cache key for the cache entries
Notes:
The reference to "kibibytes" in the max size and used size columns is an error. It should be
"kilobytes". This error is in plan to be corrected.
TR-375528 *****
V10.1
Student Notebook
Uempty
DataPower XI/XG/XB/IDG
appliances
1 3
5 Large
response
Improved time
Client response time ? + Provider
2 4
REST
Notes:
TR-375528 *****
Student Notebook
Figure 12-10. XC10 integration in document cache logic flow WE711 / ZE7111.0
Notes:
TR-375528 *****
V10.1
Student Notebook
Uempty
Figure 12-11. XC10 integration URL Opener user interface WE711 / ZE7111.0
Notes:
TR-375528 *****
Student Notebook
• The IMDG
– Dynamically caches, partitions, replicates, and manages application data and
business logic throughout multiple servers
• eXtreme Scale 7.1.1 Knowledge Center: Accessing data with the REST
data service
http://www.ibm.com/support/knowledgecenter/SSTVLU_7.1.1/
com.ibm.websphere.extremescale.doc/txsrestprogram.html
Notes:
TR-375528 *****
V10.1
Student Notebook
Uempty
Notes:
TR-375528 *****
Student Notebook
Unit summary
Having completed this unit, you should be able to:
• List some of the caching options in DataPower
• Describe the two caching approaches for documents: on-appliance
and side cache
• Configure a document cache policy
• Use the DataPower x-dp-cache-key HTTP header
• Describe how to integrate a DataPower XC10 appliance and IBM
WebSphere eXtreme Scale into DataPower caching
Notes:
TR-375528 *****
V10.1
Student Notebook
Uempty
Checkpoint questions
1. True or False: To specify a cache key other than the URL, specify the
x-dp-cache-key private header along with the request.
2. If a service response is cacheable and still valid, DataPower
functions by (Select 4):
A. Performing a cache lookup
B. Using the cached response to fulfill the request
C. Checking whether the cached entry’s lifetime is expired
D. Loading the response in a cached bitmap
E. Reaching out to the origin server to fulfill the request
Notes:
Write your answers here:
1.
2.
TR-375528 *****
Student Notebook
Checkpoint answers
1. True. To specify a cache key other than the URL, specify the x-dp-
cache-key private header along with the request.
2. A, B, C, and D. If a service response is cacheable and still valid,
DataPower functions by:
A. Performing a cache lookup
B. Using the cached response to fulfill the request
C. Checking whether the cached entry’s lifetime is expired
D. Loading the response in a cached bitmap
Notes:
TR-375528 *****
V10.1
Student Notebook
Uempty
Exercise 10
Notes:
TR-375528 *****
Student Notebook
Exercise objectives
After completing this exercise, you should be able to:
• Create and configure an XML Manager
• Create and configure a document cache policy
• Use the x-dp-cache-key HTTP header
Notes:
TR-375528 *****
V10.1
Student Notebook
Uempty
Unit 13. Integrating with IBM MQ
References
IBM DataPower Gateway Appliances Version 7.1 Knowledge Center:
www.ibm.com/support/knowledgecenter/SS9H2Y_7.1.0
© Copyright IBM Corp. 2015 Unit 13. Integrating with IBM MQ 13-1
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Unit objectives
After completing this unit, you should be able to:
• Create a multi-protocol gateway with an IBM MQ front-side handler
• Configure an IBM MQ back-end URL
• Manage transactionality between IBM MQ queue managers
Notes:
TR-375528 *****
V10.1
Student Notebook
Uempty
IBM MQ fundamentals
• A queue manager manages a container for messages that are sent
over an IBM MQ network
– In a publish/subscribe model, queues represent a message destination for
messages that are organized in FIFO order
– Queue managers send messages over a communications link known as a
channel
– An IBM MQ client (such as the MQ front side handler) must poll the queue
manager for new messages
– The queue manager itself does not initiate connections to the clients
Channel
IBM MQ Queue Manager
GET queue
Queue Q1 (request)
PUT queue
Queue Q2 (response)
Notes:
IBM MQ allows asynchronous message communication across a network. If HTTP communication
is analogous to telephone calls, then message delivery over IBM MQ is analogous to a courier
service. For point-to-point communications, messages are deposited in a queue and used by a
service later. The queue manager maintains a set of queues in one node on the network. Separate
queues store and forward request and response messages.
FIFO stands for first-in first-out. Queues mainly work in a FIFO fashion unless a special weighting
for messages is implemented.
IBM MQ does all network communications over a channel. More specifically, the software program
that allows network communication between an IBM MQ client and the IBM MQ queue manager is
known as a client channel. The channel is a program that runs on the same host as the IBM MQ
queue manager that provides network connectivity, rather than the connection itself. If a client
application is local to the queue manager, then a channel is not necessary, but it is allowed. The
DataPower appliance is always remote to the queue manager. Hence, communication is always
over a channel.
© Copyright IBM Corp. 2015 Unit 13. Integrating with IBM MQ 13-3
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
IBM MQ message
• IBM MQ messages are divided Message descriptor
into two parts: <MQMD>
– Message descriptor: Contains message ID
and control information
Application
– Application data: Message payload data
• Application data
– Contains application-specific data, such as an XML message
Notes:
Controlling information within an IBM MQ message can include the message priority, reply queue
name, correlation ID, and more.
Every message has a message identifier, which is determined from the value of the field MsgId in
its message descriptor. When an application puts a message on a queue, either the application can
supply a message identifier, or it can ask the queue manager to generate a unique one.
The correlation identifier is normally used to provide an application with some means of matching a
reply with the original message. Therefore, in a reply message the value of the CorrelId field is
normally copied from the MsgId field of the original message.
TR-375528 *****
V10.1
Student Notebook
Uempty
Transactions
• A transaction is a sequence of operations that either commit or roll
back their work
– A transaction rolls back if any one of the operations in the transaction fails
– A transaction commits if all the operations in the transaction succeed
• A local unit of work is defined as when only the queue manager
resources are being updated
• A global unit of work is defined as when resources of other resource
managers are also being updated
Consistent state
UPDATE Q1 (MQGET)
UPDATE Q2 (MQPUT)
COMMIT
Consistent state
© Copyright IBM Corporation 2015
Notes:
The terms transaction and unit of work are interchangeable.
It can happen that failure occurs during a unit of work, or the application might determine that it
cannot complete the unit of work for any reason. In such cases, the changes to resources that are
already made are backed out, or rolled back.
The point at which changes to the resources within a unit of work are committed or backed out is
known as a point of synchronization, or a sync point. At a sync point, the data within the
resources is in a consistent state from the point of view of the business and its applications.
Resource managers such as IBM MQ queue manager can participate in a global unit of work, which
involves the processing of resources from multiple resource managers. A transaction manager is
required to coordinate such a transaction. It uses the two-phase commit protocol, with a prepare
and commit phase. The prepare phase ensures that all resources marked for commitment can be
redistributed. The commit phase sends a request to all resource managers to commit their work.
The standard interface that is used between the transaction and resource manager is the X/Open
XA interface. Global units of work are sometimes referred to as XA transactions.
© Copyright IBM Corp. 2015 Unit 13. Integrating with IBM MQ 13-5
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Notes:
Support “fire and forget” or one-way messaging by setting the reply queue to an empty string and
the message type to pass-through.
TR-375528 *****
V10.1
Student Notebook
Uempty
Multi-protocol gateway
HTTP
IBM MQ
Queue
HTTPS Manager
IBM MQ MQ
Queue
Manager
© Copyright IBM Corporation 2015
Notes:
Contact your IBM MQ administrator for the host name, port, and queue names in your application.
Setting up an IBM MQ queue manager is beyond the scope of this presentation.
The DataPower appliance can obtain responses that are associated to a request. The DataPower
appliance polls the reply-to queue to find a correlated response message. The gateway examines
the correlation ID value in the IBM MQ header of messages on the reply-to queue. When this ID is
the same as the message ID assigned to the request, the gateway takes the message as the
response.
If such a message is found, the multi-protocol gateway can again apply any configured processing
policy actions to the response and returns the reply to the requesting HTTP client. This message
includes error responses from the back-end application server. If no response is found, the MPGW
generates an error to the front side client.
The web service proxy can also use the MQ front side handler.
© Copyright IBM Corp. 2015 Unit 13. Integrating with IBM MQ 13-7
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Notes:
In IBM MQ, a component that is called a queue manager manages distributed send and receive
queues. The queue manager provides messaging services for communicating applications by
periodically monitoring and polling queues, by ensuring that sent messages are directed to the
correct receive queue, or that messages are routed to another queue manager. This queue
manager object on the device corresponds to a queue manager that is running on another host on
the network. The properties set here enable communication between the device and the queue
manager.
TR-375528 *****
V10.1
Student Notebook
Uempty
* A poison message is any message that the receiving application does not
know how to process
Figure 13-8. WebSphere MQ queue manager overview: Main tab WE711 / ZE7111.0
Notes:
© Copyright IBM Corp. 2015 Unit 13. Integrating with IBM MQ 13-9
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Figure 13-9. WebSphere MQ queue manager overview: Connections tab WE711 / ZE7111.0
Notes:
TR-375528 *****
V10.1
Student Notebook
Uempty
Figure 13-10. WebSphere MQ queue manager overview: CCSI tab WE711 / ZE7111.0
Notes:
© Copyright IBM Corp. 2015 Unit 13. Integrating with IBM MQ 13-11
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Figure 13-11. WebSphere MQ queue manager overview: MQCSP tab WE711 / ZE7111.0
Notes:
TR-375528 *****
V10.1
Student Notebook
Uempty
Notes:
A WebSphere MQ queue manager object allows a back side handler on the DataPower SOA
appliance to access an IBM MQ queue manager. The same object also allows IBM MQ queue
managers to connect to a DataPower service through a front side handler.
The Queue Manager Name field is necessary only if a non-default queue manager name is
assigned to this queue manager.
SYSTEM.DEF.SVRCONN represents the default server connection channel.
The user name field is used to provide a plain text string that identifies the client to the IBM MQ
queue manager. You provide a user name with administrative permissions on the local operating
system.
During the installation of IBM MQ, it creates a user in the local Windows registry that is called
MUSR_MQADMIN in the IBM MQ user group, which has local OS administrative permissions. In Linux,
the default user is “mqm”.
The default port number, if it is not specified in the host name field, is 1414.
© Copyright IBM Corp. 2015 Unit 13. Integrating with IBM MQ 13-13
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
6. Configure an
automatic retry interval
to automatically
reconnect to the
Queue Manager
© Copyright IBM Corporation 2015
Notes:
Units of Work
When set to 0 (zero), the default, it causes the appliance to get and put messages with no provision
for rollback. Either the operation succeeds or not. Undeliverable messages are silently discarded,
which leaves higher-level protocols with the responsibility to detect and retransmit lost packets.
When set to 1, the DataPower appliance uses sync points. A sync point commits and rolls back
each IBM MQ message, not the entire transaction. When specified, the DataPower appliance does
not remove the message that it gets from a queue until it uses that message (such as placing the
message on a server queue for processing) to complete its transaction. If the transaction fails and
the message is left available on the queue, the DataPower appliance can attempt to get the
message and process it again.
Only the values 0 (zero) and 1 are valid.
Automatic Retry
Define whether to attempt to reconnect to the remote server after a connection failure. When set to
on, the DataPower appliance automatically attempts to reconnect to the remote host, which is on
by default.
TR-375528 *****
V10.1
Student Notebook
© Copyright IBM Corp. 2015 Unit 13. Integrating with IBM MQ 13-15
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Notes:
Total Connection Limit: Specify the total number of open connections to allow. Use an integer in
the range 1 – 5000.
Initial Connections: Specify the number of connections to open immediately when the MQ Queue
Manager object starts. Use an integer in the range 0 – 5000.
SSL Proxy Profile: Select an SSL proxy profile.
SSL Key Repository: Specify the location of the key database file in which keys and certificates
are stored. Use this property with the SSL Cipher property to enable SSL communication when the
SSL artifacts were created with IBM Global Security Kit (GSKit).
SSL Cipher Specification: Select the cipher suite for SSL communication when using an SSL key
repository. The cipher suite must match the ciphers in use by the IBM MQ Queue Manager.
TR-375528 *****
V10.1
Student Notebook
Uempty
Figure 13-15. Step 1: Use SSL in mutual authentication mode WE711 / ZE7111.0
Notes:
To set up SSL between the DataPower WebSphere MQ client and an IBM MQ queue manager,
both parties exchange keys that are used during SSL communication.
The first step is to enable SSL for the WebSphere MQ queue manager. In DataPower, you generate
the certificate key pair that is imported into IBM MQ. DataPower generates certificates in the PEM
format, which IBM MQ does not support. You convert the PEM format into the pkcs12 format. You
can use the OpenSSL tool to convert between certificate formats.
When the certificate key pair is converted, you import it into the IBM MQ key database. Finally, you
export the IBM MQ key database and import it into DataPower. When the key database is imported,
you can select it in the SSL Key Repository field.
For more information, see the technote “Configuring DataPower WebSphere MQ client to use SSL
in mutual authentication mode” at:
http://www.ibm.com/support/docview.wss?fdoc=aimwdp&rs=2362&uid=swg21260155
© Copyright IBM Corp. 2015 Unit 13. Integrating with IBM MQ 13-17
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Notes:
The administrator on the IBM MQ queue manager defines the names of the Get and Put queues.
The publish/subscribe mode uses different fields on the web page.
There is an option to support an asynchronous Put operation (Async Put on or off).
TR-375528 *****
V10.1
Student Notebook
Uempty
Notes:
The MQHelper button is displayed if the back-end transport is static.
The queue manager can be the same as the one that is used in the front side handler.
When the Transaction option is set to on, DataPower does not consider the message successfully
posted onto the queue until it receives a response from the queue manager. With the option set to
off, no confirmation is requested, and successful posting of the message is assumed.
Although it has a different name, the Transaction option is similar to the units of work field in the
WebSphere MQ queue manager object.
The User Identifier setting allows the IBM MQ back-end transport to add a value to the user
identifier header field. This setting adds PMO=2052 to the URL. Header injection or some
processing action must set the actual header value.
The back-end URL for an IBM MQ uses a URI syntax specific to DataPower. For example, the
settings in the slide would create a URL of: dpmq://AddressQM/EastAddress/services/
AddressSearch?RequestQueue=SEARCH_REQ;ReplyQueue=SEARCH_RESP
© Copyright IBM Corp. 2015 Unit 13. Integrating with IBM MQ 13-19
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
1. Rather than Get Queue and Put Queue fields, a Topic String needs to
be entered
2. Messages are published to a Topic String
3. Subscribers are delivered messages that were published to the Topic
Strings to which they are subscribed
4. Specify Subscription Name for durable subscription
5. If response is needed, specify Publish Topic String
6. If both Get Queue and Subscribe Topic String are present, the Get
Queue overrides
7. If both Put Queue field and Publish Topic String are present, the Put
Queue overrides
Notes:
Publish/subscribe applies to IBM MQ V7.
TR-375528 *****
V10.1
Student Notebook
Uempty
Notes:
The helper constructs a DataPower IBM MQ URL like:
dpmq://QM/?SubscribeTopicString=yyyy;SubscriptionName=zzz
In the MQHelper dialog box:
• If both the RequestQueue and PublishTopicString are entered, the RequestQueue overrides.
• If both the ReplyQueue and SubscribeTopicString are entered, the ReplyQueue overrides.
• If the IBM MQ URL is entered manually, whatever is entered, the latest in the URL string
overrides.
© Copyright IBM Corp. 2015 Unit 13. Integrating with IBM MQ 13-21
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Message properties
• Name-value pairs that are associated with the message (IBM MQ V7)
Notes:
Messages are retrieved from the queue only if the message property satisfies the selector
statement.
A selector can also be specified in the IBM MQ URL.
TR-375528 *****
V10.1
Student Notebook
Uempty
Notes:
Request rule in order: Enforces first-in first-out serial processing of messages for actions in the
request rule. The appliance initiates and completes request rule processing for messages in the
order in which they were pulled from the front-end request queue. The appliance starts the request
rule for the second message in the request queue only after it completes the processing of the first
message. The back-end request queue accepts whatever message arrives first, except when you
enforce the back-end system to order serial processing. In that case, the appliance buffers
messages so that it sends messages to the back-end request queue in the same order in which
they were pulled from the front-end request queue.
Back-end in order: Enforces the serial processing of messages that are delivered to the back-end
request queue. If necessary, the appliance buffers messages to complete the request rule that
processes out of order. It also delivers messages to the back-end request queue in the same order
in which they were pulled from the front-end request queue.
Response rule in order: Enforces serial processing of messages for actions in the response rule.
The appliance initiates and completes response rule processing for messages in the order in which
they were pulled from the back-end reply queue. The appliance starts the response rule for the
second message in the reply queue only after it completes the processing of the first message. The
© Copyright IBM Corp. 2015 Unit 13. Integrating with IBM MQ 13-23
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
appliance always buffers messages so that it sends messages to the front-end reply queue in the
same order in which they were pulled from the back-end reply queue.
TR-375528 *****
V10.1
Student Notebook
Uempty
Notes:
The settings in the WebSphere MQ queue manager object determine what the backout settings are
for a specific queue manager, unless the handler option can potentially override the setting.
© Copyright IBM Corp. 2015 Unit 13. Integrating with IBM MQ 13-25
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Use values in
FSH retrieves backout OFF queue manager
settings? object, if set
ON
NO
NO Backout disabled
© Copyright IBM Corporation 2015
Figure 13-23. Decision tree for the backout settings WE711 / ZE7111.0
Notes:
TR-375528 *****
V10.1
Student Notebook
Uempty
• Enables manipulation of
IBM MQ headers without
requiring a style sheet
• Allows modification of
MQMD request headers,
MQMD response
headers, queue manager
and reply queue for
response, message
retrieval by message ID,
or correlation ID
Notes:
The message ID for the current message can be retrieved from
var://service/message-identifier. You can enter that variable into the entry field on the page.
It is similar to the correlation ID and var://service/correlation-identifier.
© Copyright IBM Corp. 2015 Unit 13. Integrating with IBM MQ 13-27
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Notes:
TR-375528 *****
V10.1
Student Notebook
Uempty
• Front side
– Units of Work parameter in
WebSphere MQ Queue Manager
object
• Back side
– Backend URL:
Sync query parameter,
transactional query parameter
Notes:
A client application generally assumes that a message was PUT successfully, and that a
transaction is not explicitly started. It is possible to request acknowledgment of the receipt of the
message on the queue.
A transaction (unit of work) can be requested if, for example, multiple messages are PUT to queues
within the same transaction.
DataPower does propagate a transaction between two different IBM MQ queue managers.
© Copyright IBM Corp. 2015 Unit 13. Integrating with IBM MQ 13-29
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
IBM MQ
Queue
Manager A
FRONT.GET
FRONT.PUT
Notes:
TR-375528 *****
V10.1
Student Notebook
Uempty
IBM MQ
Queue
Manager B
GET
Notes:
Sync=true is necessary if Queue Manager B is using transactions.
Sync = true|false cannot be set by the IBM MQ URL Builder. You must edit the back-end URL field
to add the Sync parameter.
© Copyright IBM Corp. 2015 Unit 13. Integrating with IBM MQ 13-31
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Notes:
Existing MQMD headers can be accessed from the variable:
var://context/contextname/_extension/header/MQMD
TR-375528 *****
V10.1
Student Notebook
Uempty
Notes:
If the primary queue manager becomes available again, it returns to “primary” status.
© Copyright IBM Corp. 2015 Unit 13. Integrating with IBM MQ 13-33
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Unit summary
Having completed this unit, you should be able to:
• Create a multi-protocol gateway with an IBM MQ front-side handler
• Configure an IBM MQ back-end URL
• Manage transactionality between IBM MQ queue managers
Notes:
TR-375528 *****
V10.1
Student Notebook
Uempty
Checkpoint questions
1. True or False: IBM MQ support is available only on the multi-protocol
gateway.
2. True or False: The DataPower MQ client implementation supports
one-way messaging.
3. Match the definitions between local and global units of work:
Description Definition
C. DataPower supports
Notes:
Write your answers here:
1.
2.
3. (1)
(2)
© Copyright IBM Corp. 2015 Unit 13. Integrating with IBM MQ 13-35
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Checkpoint answers
1. False. The Web Service Proxy can also use an MQ front side
handler.
2. True.
3. 1 – B and C,
2 – A.
Notes:
TR-375528 *****
V10.1
Student Notebook
Uempty
Exercise 11
Notes:
© Copyright IBM Corp. 2015 Unit 13. Integrating with IBM MQ 13-37
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Exercise objectives
After completing this exercise, you should be able to:
• Create an IBM MQ front-side handler (FSH) that gets messages from a
queue and puts responses on a queue
• Describe and configure an IBM MQ queue manager object
• Create an IBM MQ multi-protocol gateway proxy that receives HTTP
messages on the front end while communicating by using an IBM MQ
queue out the back end
• Use various techniques to route the IBM MQ message to the correct
queue: static, dynamic using a style sheet (XSL), and dynamic using a
GatewayScript
• Send messages from a multi-protocol gateway service to a queue in
IBM MQ in a request/response messaging pattern
Notes:
This exercise shows you how to add support for IBM MQ to a multi-protocol gateway service. You
add an MQ front side handler to the BookingServiceProxy service that you created in an earlier
exercise. You create another MPGW service to demonstrate calling an IBM MQ queue from the
back side of a service. This MPGW service is used as an IBM MQ client, similar to the IBM MQ
client RFHUtil, to get and put messages from queues.
TR-375528 *****
V10.1
Student Notebook
Uempty
Exercise overview
DataPower
SoapUI student_domain
Request
BookingServiceProxy
Multi-Protocol Gateway
Reply
Uses
FLY_domain
Notes:
© Copyright IBM Corp. 2015 Unit 13. Integrating with IBM MQ 13-39
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Exercise overview 1 of 2
SoapUI
BookingMQclient
WebSphere MQ
Front-side Multi-protocol
Queue Manager
handler gateway
Request In
HTTP WebSphere MQ
Reply Out
BookingServiceProxy
FLY Service
WebSphere MQ Front-side Multi-protocol
Queue Manager handler gateway
HTTP(S)
In
WebSphere MQ
Out
Web server
Notes:
An MPGW BookingMQclient is created. Then, an MQ FSH is added to the existing
BookingServiceProxy MPGW.
The BookingMQclient receives an HTTP SOAP request message, and places the message on an
IBM MQ put queue. The BookingServiceProxy polls the IBM MQ Get queue, reading the message
and sending the message to the FLY Service backend web service. The FLY Service web service
processes the message and sends the message back to the BookingServiceProxy MPGW that
places the message on the get queue. The BookingMQclient reads the Get queue and send the
response message over HTTP back to the requesting SoapUI client.
The MQ portion of processing is known as a request/reply scenario.
TR-375528 *****
V10.1
Student Notebook
Uempty
Exercise overview 2 of 2
SoapUI
MQ configuration:
• SoapUI – MQ Request sending an
SOAP message over HTTP
• BookingMQclient MPGW with MQ
back-end destination
• BookingServiceProxy MPGW with
MQ Polling FSH
Response
Request
• MQ Request/Reply paradigm
Notes:
© Copyright IBM Corp. 2015 Unit 13. Integrating with IBM MQ 13-41
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
TR-375528 *****
V10.1
Student Notebook
Uempty
Unit 14. Web service proxy service
References
IBM DataPower Gateway Appliances Version 7.1 Knowledge Center:
www.ibm.com/support/knowledgecenter/SS9H2Y_7.1.0
© Copyright IBM Corp. 2015 Unit 14. Web service proxy service 14-1
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Unit objectives
After completing this unit, you should be able to:
• Describe the web service proxy architecture
• List and explain the configuration steps that are needed to create a
web service proxy
• Create and configure a web service proxy policy at various levels of
the WSDL file
Notes:
TR-375528 *****
V10.1
Student Notebook
Uempty
Notes:
It is not necessary for the client to know the endpoint address of the web service. It is always
forwarded to the web service proxy. If the web service endpoint changes, only modifications to the
web service proxy are required. The client is unaffected.
Performing security, validation, and transformation on the DataPower appliance for web service
proxy requests improves application performance because it is done at a hardware level. It is
offloaded from the application server, which would perform these tasks in software. You can also
apply a standard security policy for your web service proxy on the DataPower appliance because all
requests pass through the appliance.
© Copyright IBM Corp. 2015 Unit 14. Web service proxy service 14-3
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
HTTP(S): SOAP
WS-Policy
WSDL
Notes:
The Web Service Proxy provides all of the same services as a Multi-Protocol Gateway service;
however, it provides automatic configuration based on one or more Web Service Definition
Language (WSDL) files. WSDL files might be obtained through subscriptions to a Universal
Description, Discovery, and Integration (UDDI) or WebSphere Service Registry and Repository
(WSRR). DataPower supports enforcement of WSRR sophisticated Service Level Definition and
Service Level Agreement policies. A single Web Service Proxy object can act as a single point of
entry for multiple WSDLs, automatically routing (or redirecting) the requests to the appropriate
backend service.
The Web Service Proxy automatically applies schema validation to both inbound and outbound
messages, further assuring message validity. Processing and security policies can be applied not
only at the entire service level, but for individual operations within the service as well.
TR-375528 *****
V10.1
Student Notebook
Uempty
Web
Client Web service proxy services
(WS-Proxy)
WS-Proxy WSDL
Service:
host.com/Operation
Operation A WSDL 1
Operation B Operation A
Operation C ahost.co.com:7000/Service
WSDL 2
Operation B
ahost.co.com:7001/Service
WSDL 3
Operation C
ahost.co.com:7002/Service
© Copyright IBM Corporation 2015
Notes:
The web service proxy has a WSDL file that lists the operations it supports. These operations can
be aggregated from multiple WSDL files that are in different locations.
The web service proxy maintains a mapping of a local endpoint and remote endpoint for each
WSDL file.
© Copyright IBM Corp. 2015 Unit 14. Web service proxy service 14-5
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Notes:
You can schema validate request, response, and fault messages by using a user policy. It is
automatically created when you create a web service proxy.
The web service proxy is built on top of the XML firewall. Therefore, it provides all of the functions of
an XML firewall, such as encryption, validation, AAA, and more.
UDDI is a service repository that is used to search for WSDL files of a service.
Creating a WSDL cache policy enables the proxy WSDL file to be updated automatically when the
underlying WSDL changes.
You can create an SLM peer group to share SLM data and enforce SLM policy between multiple
DataPower appliances.
TR-375528 *****
V10.1
Student Notebook
Uempty
• WSDL files
– Uploads or associates a WSDL document with a web service proxy
– Configures the proxy and remote URI (address, port) of services that are
contained in WSDL document
• SLM Policy
– Monitors and shapes traffic that enters the web service proxy
• Services
– Lists services that are defined in each WSDL document
– Can publish services to a UDDI registry
• Policy
– Configures a web service proxy policy
• SLA Policy Details
– View WSDL attachments that relate to a service level agreement
• Proxy Settings
– Specifies a method of forwarding to a service, security, XML
manager, and HTTP settings © Copyright IBM Corporation 2015
Notes:
There are configuration options for each tab in the web service proxy GUI.
The WSDL files, services, policy, and proxy settings tabs are covered in this unit.
SLM policy is covered in more detail in another unit.
Various policies (WS-Policy and WS-MediationPolicy, for example) can be specified in individual
files, but point to an attachment point in a WSDL file. The SLA Policy Details tab is not covered in
this course.
© Copyright IBM Corp. 2015 Unit 14. Web service proxy service 14-7
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Notes:
The XML Threats and Monitors tabs are covered in other units.
TR-375528 *****
V10.1
Student Notebook
Uempty
3. Upload the WSDL document and add it to the web service proxy
5. Specify a service policy that consists of rules for the web service
(optional)
© Copyright IBM Corporation 2015
Figure 14-8. Web service proxy basic configuration steps WE711 / ZE7111.0
Notes:
The URI consists of an address and port.
Step 5 is optional because the appliance generates a default service policy. The default service
policy applies at the proxy level for each service. You can override the default service policy with a
more specific policy at a fine-grained level for each service, port, or operation. Only one policy is
executed per request or response.
You can also do these additional configuration steps:
1. Configure how the proxy forwards requests to the back-end web service. By default, the URI
defined in the WSDL document is used to determine the back-end web service.
2. Select the SOAP action policy to specify how to consume messages with a SOAPAction
header.
3. Configure security settings, such as proxy-wide AAA settings, the decryption key, and the SSL
proxy profile, to a back-end service.
© Copyright IBM Corp. 2015 Unit 14. Web service proxy service 14-9
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Notes:
A WSDL document describes the service operations that can be invoked together with their
messaging protocol, transport, and endpoint address.
Each operation contains an input and output message, whose types are defined by using the XML
schema type system.
TR-375528 *****
V10.1
Student Notebook
Uempty
Notes:
This diagram shows the general structure of a WSDL and the relationships of the elements to each
other.
© Copyright IBM Corp. 2015 Unit 14. Web service proxy service 14-11
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
– Using the vertical navigation bar, click Services > Web Service Proxy >
New Web Service Proxy
• You are first prompted for the name of the web service proxy
Notes:
You can use either approach in creating a web service proxy. The web pages are identical.
From the web service proxy catalog list, you click Add to create a service. You are first prompted
for the new service name.
TR-375528 *****
V10.1
Student Notebook
Uempty
Figure 14-12. An alternative: Web service proxy object editor WE711 / ZE7111.0
Notes:
The WSDL cache policy and some attachment processing specifications are example
configurations that are possible only by using this editor.
© Copyright IBM Corp. 2015 Unit 14. Web service proxy service 14-13
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Figure 14-13. Step 3: Add WSDL document to web service proxy WE711 / ZE7111.0
Notes:
The Configure Web Service Proxy page is displayed.
The Edit WSDL or Subscription, Add WSDL, Add UDDI Subscription, Add WSRR
Subscription, and Add WSRR Saved Search Subscription options act like a button when they
are selected.
Click Upload to upload a WSDL file to the DataPower appliance. The WSDL file can be uploaded to
the local: directory (which is accessible in the current domain) or to the store: directory (which
is accessible in all domains). The preference is for the “local” files to be in the local: directory.
When you upload a WSDL file, the WSDL file URL is automatically populated.
You can upload and add multiple WSDL files.
You can also enter an HTTP URL into the WSDL file URL, and the web page populates the fields
with information from the WSDL file.
TR-375528 *****
V10.1
Student Notebook
Uempty
Notes:
The Local section contains necessary information for the client to call a service on the web service
proxy. You create a local endpoint handler to specify a port number that listens for requests of a
particular service and forwards to the remote destination. The endpoint handler is another name for
a front side protocol handler. These handlers can be managed individually from Objects >
Protocol Handlers.
Under Local, the URI field is what the client uses prefaced with the host name of the DataPower
appliance and the port that is specified in the Local Endpoint Handler object.
The Remote section contains information about the web service endpoint address that the web
service proxy calls. Make sure that you change the default host name of localhost to the correct
host name.
The Remote section Protocol choice lists the various protocols available on the back side of the
service. Depending on the particular protocol that is selected, the other fields adjust:
• DPMQ
• DPTIBEMS
• DPWASJMS
© Copyright IBM Corp. 2015 Unit 14. Web service proxy service 14-15
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
• HTTP
• HTTPS
• MQ
• TIBEMS
The protocols and URLs are defined as part of the documentation of the url-open extension
element. For more information, see the DataPower Knowledge Center.
TR-375528 *****
V10.1
Student Notebook
Uempty
Notes:
Other choices for local endpoint handlers not visible in the menu in the slide are MQ, SFTP Server,
Stateless Raw XML, and Stateful Raw XML.
The Local IP address of 0.0.0.0 means that the endpoint handler listens for requests on all of
the appliance interfaces.
Make sure that the port number you specify here is unique.
Endpoint handlers and front side handlers are synonymous terms, and are configured in the same
way.
© Copyright IBM Corp. 2015 Unit 14. Web service proxy service 14-17
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Figure 14-16. Step 6: Add the WSDL to the service WE711 / ZE7111.0
Notes:
Clicking Add adds the selected WSDL to the service.
As soon as a WSDL is added, it can be edited or removed by selecting the appropriate icon to the
right of the WSDL.
Clicking Next commits the WSDL to the service.
TR-375528 *****
V10.1
Student Notebook
Uempty
Notes:
The WSDL is now part of the service.
More WSDLs or subscriptions can be added to the service.
© Copyright IBM Corp. 2015 Unit 14. Web service proxy service 14-19
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Notes:
A subscription to a registry might also retrieve a WSDL file.
Generally, the registries are polled for the WSDL file on a timed basis, and can also be explicitly
polled.
A WSRR Saved Search can be configured to send a WSDL file update from WebSphere Service
Registry and Repository to the service.
TR-375528 *****
V10.1
Student Notebook
Uempty
Notes:
The appliance automatically generates the services in this tab when you add a WSDL file to the
web service proxy.
Universal Description, Discovery, and Integration (UDDI) is an XML-based registry that is used to
search for WSDL documents.
UDDI is implemented as a web service that you can publish and search for web services.
The DataPower appliance does not provide a UDDI registry, only a connection.
The View Operations opens another window that lists the operations that are defined in the
WSDLs exposed by this service.
© Copyright IBM Corp. 2015 Unit 14. Web service proxy service 14-21
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Figure 14-20. Retrieve the client WSDL from the service WE711 / ZE7111.0
Notes:
The original WSDL used in defining the WS Proxy contains a location that is no longer correct for
the web service that this service proxies.
When you append ?wsdl to the URL that the client uses to access the web service on the
appliance, the appliance returns a WSDL with:
• The appliance IP address
• The service port
• The URI that the client uses to access the web service
These values are not the values in the original WSDL.
TR-375528 *****
V10.1
Student Notebook
Uempty
• You can specify a different host name or port to place in the WSDL
– Clear Use Local to enter your own values
– Now retrieved by ?wsdl
<wsdl:port binding="..." name="BookingService">
<address
location="http://booking.FLY.com:6999/BookingService" />
</wsdl:port>
Figure 14-21. Modifying the location in the client WSDL WE711 / ZE7111.0
Notes:
The WSDL retrieved by ?wsdl contains the IP address and port of the appliance and web service
proxy service.
By clearing the Use Local check box, you can explicitly specify the host name, port, and URI that
are included in the retrieved WSDL.
This feature becomes especially useful if you have a load balancer that fronts the appliance. By
using the explicit approach, you can specify the load balancer details in the retrieved WSDL so the
clients send their requests to the correct host name, port, or URI on the load balancer. The load
balancer must be configured to forward requests to the appliance host name, port, or URI.
•
•
•
© Copyright IBM Corp. 2015 Unit 14. Web service proxy service 14-23
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Figure 14-22. Step 7: Configuring web service proxy policy WE711 / ZE7111.0
Notes:
The Policy tab shows the rules that are defined at the various levels within any WSDLs defined for
this service.
Default proxy-level rules are provided.
Clicking Processing Rules opens the policy editor in a lower section of the page.
A toggle is available to show the portType and binding nodes in the WSDL levels. The default is to
not display them in the policy tree.
The more links display more help text on the page.
TR-375528 *****
V10.1
Student Notebook
Uempty
Figure 14-23. Configure web service proxy policy rule WE711 / ZE7111.0
Notes:
You can add, view, or modify rules by selecting Processing Rules at the intended level.
To show or hide the levels of the WSDLs, click the plus sign (+) or the minus sign (-).
The default proxy-level rule contains two actions, an SLM action and a Results action. The SLM
action is a checkpoint event that calls the web service proxy SLM policy. You can verify the SLM
action by double-clicking it and noting the SLM policy name. Click the SLM Policy tab to verify that
the proxy name listed in the page is the same as the SLM action.
© Copyright IBM Corp. 2015 Unit 14. Web service proxy service 14-25
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Adding a rule
1. Add a rule to the findByName operation by clicking Processing Rules
2. Click New Rule in policy editor (default name can be typed over)
3. When finished, click Apply at the Web Service Proxy (page) level
1
Notes:
The number and type of rules that are defined at that level in the WSDL are displayed next to the
Processing Rules button.
You create and configure the actions in the rule as you normally would.
All rules that are configured at this level are in the Configured Rules section of the policy editor.
Clicking Apply at the page (service) level commits this rule to the policy.
TR-375528 *****
V10.1
Student Notebook
Uempty
Notes:
Click any of the icons at each level to view the user policy dialog box.
The first check mark enables the component. Each option that is shown in the dialog box maps to
an icon with a green check mark or red X.
Each policy level contains a user policy that can be enabled or disabled.
The web service proxy policy and user policy are separate from each other; the user policy is
executed before the web service proxy policy.
© Copyright IBM Corp. 2015 Unit 14. Web service proxy service 14-27
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Notes:
Reusable rules are useful for applying a common set of actions at many levels of the web service
proxy. More actions can be added before or after the reusable rules. With reusable rules, you can
more easily manage a set of actions that repeat across many levels of the web service proxy.
Reusable rules can be defined in the other service type processing policies, such as an XML
firewall policy.
TR-375528 *****
V10.1
Student Notebook
Uempty
Notes:
In this presentation, only the proxy settings are examined, in later slides. See the various service
guides for information about the settings that are contained in the Advanced Proxy Settings,
Headers, Parameters, WS-Addressing, and WS-ReliableMessaging tabs.
The XML threat protection settings are explained in the XML threat protection presentation.
© Copyright IBM Corp. 2015 Unit 14. Web service proxy service 14-29
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
WS-Policy
• WS-Policy is a specification that defines metadata to enable
interoperability between web service consumers and web service
providers
• The WS-Policy specifications enable organizations to automate their
service governance models by creating a concrete instance of web
service governance
• Behaviors:
– Parse WSDL with policy elements already included in the WSDL and recognize
standardized policy “domains” (WS-Security Policy, WS-ReliableMessaging
Policy)
– DataPower supports retrieving WSDL by using WebSphere Service Registry and
Repository queries
– DataPower supports retrieving WSDL by using a UDDI interface
Notes:
WS-Policy is used to assert policies on security, quality of service (QoS), required security tokens,
privacy, and other items. A web service can stipulate what it can provide, and a consumer can
stipulate its requirements.
TR-375528 *****
V10.1
Student Notebook
Uempty
Conformance policy
• Defines which profiles to use to validate whether received messages
are in conformance to the selected interoperability profiles
• When a client sends nonconforming requests for a conforming back-
end server:
– The conformance policy can be used to fix nonconforming requests during
message processing
• For signed and encrypted nonconforming data:
– The cryptographic protection must be removed before and after conformance
correction
• It can be added to a WS-Proxy in the Policy editor
Notes:
Supported profiles:
• WS-I Basic Profile Version 1.0
• WS-I Basic Profile Version 1.1
• WS-I Attachments Profile Version 1.0
• WS-I Basic Security Profile Version 1.0
Any conformance correction must be coded in a stylesheet; the firmware does not automatically
provide it.
© Copyright IBM Corp. 2015 Unit 14. Web service proxy service 14-31
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Notes:
Ignored requirements are entered as a text string. For example, BSP1.0:R4221 would ignore
requirement R4221 in the Basic Security Profile V1.0.
Record report options include:
• Never: Never record reports
• Failure: Record reports with conformance failures
• Warning: Record reports with conformance warnings
• Always: Record reports for all outcomes
Reject nonconforming messages include:
• Never: Never reject messages
• Failure: Reject messages with conformance failures
• Warning: Reject messages with conformance warnings or failures
TR-375528 *****
V10.1
Student Notebook
Uempty
Service priority
• The policy editor has a Priority field
– Sets priority for resource allocation and scheduling
Notes:
The priority has no effect until the appliance encounters a resource constraint.
© Copyright IBM Corp. 2015 Unit 14. Web service proxy service 14-33
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Proxy settings (1 of 4)
• Click the Proxy Settings tab to view the proxy settings
– Many options have default values
• Type
– Dynamic Backend: Web service proxy determines the back-end server during
service processing
– Static Backend: Web service proxy forwards to a single back-end server
– Static from WSDL (default): Service section in the WSDL file determines the
back-end server
Notes:
When the web service proxy receives requests from a client, it forwards them to a back-end server
for a service request.
The Type section specifies how that back-end server is determined. A back-end server is identified
with a URL and port. The default option is Static from WSDL, which uses the WSDL file to
determine the back-end server. The Dynamic Backend option determines the back-end server
during document processing, and the Static Backend option always forwards to a single back-end
server.
If the Static Backend type is selected, the page reloads, and you are supplied fields in which you
can enter the back-end information. Several URL Helper buttons (WebSphere MQ, TibcoEMS,
WebSphereJMS, and IMS Connect) are presented to help build the back-end URL.
TR-375528 *****
V10.1
Student Notebook
Uempty
Proxy settings (2 of 4)
• Decrypt Key
– Selects a cryptographic key object to decrypt the message payload
• EncryptedKeySHA1 Cache Lifetime
– Cache Lifetime for the decrypted generated key
• Preserve EncryptedKey Chain
– Whether to output the element chain that is
used to decrypt
• Decrypt with Key from EncryptedData
– Enable decrypt action to attempt decryption
with the key that is inside the EncryptedData
element
• Client Principal
– The client principal name when decrypt is required
– Used when the encryption uses a Kerberos
session key or uses a key that is derived from the session key
• Server Principal
– The server principal name when decrypt is required
– Used when the encryption uses a Kerberos session key or uses a key that is
derived from the session key © Copyright IBM Corporation 2015
Notes:
The message payload refers to the message body.
Encrypting a message introduces new elements into the SOAP message that would cause
automatic message validation to fail because a typical schema validation does not check for these
elements.
An example SOAP message with encrypted payload might look like:
<SOAP:Body>
<EncryptedData ...>
Using a cryptographic key ensures that a message can pass automatic validation by decrypting the
message payload before validation. The entire message must be encrypted, not only fields within
the message.
EncryptedKeySHA1 Cache Lifetime is the cache lifetime for the decrypted generated key. Setting
the value to 0 means that the decrypted generated key is not cached.
Preserve EncryptedKey Chain, if it is on, outputs the chain of elements that the decrypted
Encrypted Data uses, such as xenc:EncryptedKey or wsc:DerivedKeyToken. Otherwise, all
© Copyright IBM Corp. 2015 Unit 14. Web service proxy service 14-35
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
xenc:EncryptedKey elements are removed after decryption, and even some of the encrypted data
might not be decrypted successfully.
Decrypt with Key from EncryptedData: In scenarios in which the key is inside an EncryptedData
element (such as “encrypted SAML Assertion”), the decrypt action cannot locate the key to decrypt
the corresponding EncryptedData elements. Select on to enable the decrypt action to attempt
decryption with the key that is inside the EncryptedData element.
The Client Principal field contains the full name of the client principal when the web service proxy
must automatically decrypt encrypted requests. Use this property when the encryption uses a
Kerberos session key, or a key that was derived from the session key.
In a similar fashion, the Server Principal field specifies the full name of the server principal when
the web service proxy must automatically decrypt encrypted responses.
TR-375528 *****
V10.1
Student Notebook
Uempty
Proxy settings (3 of 4)
• Kerberos Keytab
– Select the Kerberos keytab file that
contains the principals
Notes:
Select the Kerberos Keytab object that contains the principals for the Kerberos Keytab list. The
web service proxy uses these principals to automatically decrypt encrypted requests and
responses.
The WSDL file for a service defines the value that a SOAPAction header must contain for a SOAP
request. The SOAPAction header is defined in the HTTP header, not the SOAP header.
The SOAP Action Policy setting specifies how to validate messages with a SOAPAction HTTP
header.
A WS-Management agent can monitor the web service proxy without any monitors that are defined
on the Monitors tab.
© Copyright IBM Corp. 2015 Unit 14. Web service proxy service 14-37
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Proxy settings (4 of 4)
• XML Manager: Assigns an XML manager to the web service proxy
• Authorization AAA Policy: Selects or creates a AAA policy to apply to
all service endpoints configured for this web service proxy
– AAA policy can also be applied at a fine-grained level in the Policy tab
Notes:
The Authorization AAA policy specifies how incoming messages are authenticated and authorized.
The last A is for Audit.
The proxy AAA policy is applied for all service endpoints within the proxy.
TR-375528 *****
V10.1
Student Notebook
Uempty
– Provides
monitoring at a
fine-grained level
– Controls traffic
that enters the
web service
proxy by using
the Throttle and
Shape action
Figure 14-36. Web service proxy: SLM Policy tab WE711 / ZE7111.0
Notes:
Under Request, you can count the number of transactions that occur with a specific interval (in
seconds). If the transaction limit is exceeded, you can specify an action to:
• Notify: Generate a log message when the transaction limit is exceeded.
• Throttle: Any transactions above the limit are rejected, and log messages are generated.
• Shape: The first 2500 transactions in excess of the maximum transaction rate are queued for
later transmission, and subsequent transactions in excess of the 2500 limit are rejected. Log
messages are generated.
Under Failure, you can specify the same information as Request, except that these settings apply
to error messages.
© Copyright IBM Corp. 2015 Unit 14. Web service proxy service 14-39
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Notes:
TR-375528 *****
V10.1
Student Notebook
Uempty
Notes:
© Copyright IBM Corp. 2015 Unit 14. Web service proxy service 14-41
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Unit summary
Having completed this unit, you should be able to:
• Describe the web service proxy architecture
• List and explain the configuration steps that are needed to create a
web service proxy
• Create and configure a web service proxy policy at various levels of
the WSDL file
Notes:
TR-375528 *****
V10.1
Student Notebook
Uempty
Checkpoint questions
1. True or False: A web service proxy and an SLM policy can be defined
at a fine-grained level.
2. Which of the following levels can be configured with a web service
proxy policy?
A. Proxy
B. Message
C. Service
D. Port
3. True or False: A WSDL must be uploaded onto the appliance when
creating a web service proxy.
4. List the three options under the SOAPAction policy:
A. lax: This option validates messages with an empty SOAPAction HTTP
header or an empty string within the SOAPAction HTTP header.
B. strict: The message must contain an exact match of the SOAPAction header
that is provided in the WSDL file.
C. off: The SOAPAction HTTP header is ignored.
D. lazy: The SOAPAction allows all messages through.
© Copyright IBM Corporation 2015
Notes:
Write your answers here:
1.
2.
3.
4.
© Copyright IBM Corp. 2015 Unit 14. Web service proxy service 14-43
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Checkpoint answers
1. True.
2. A, C, and D.
4. A, B, and C.
Notes:
TR-375528 *****
V10.1
Student Notebook
Uempty
Exercise 12
Notes:
© Copyright IBM Corp. 2015 Unit 14. Web service proxy service 14-45
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Exercise objectives
After completing this exercise, you should be able to:
• Configure a web service proxy to virtualize an existing web service
• Configure the service policy within the web service proxy
Notes:
Future Update Configure Kerberos - Integrate Bus Messenger
TR-375528 *****
V10.1
Student Notebook
Uempty
Exercise overview
SoapUI DataPower
Request student_domain
BookingServiceWSProxy
Web Service Proxy
Reply
Uses
FLY_domain
WSDL
BookingService.wsdl
Notes:
© Copyright IBM Corp. 2015 Unit 14. Web service proxy service 14-47
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
TR-375528 *****
V10.1
Student Notebook
Uempty
Unit 15. Service level monitoring
References
IBM DataPower Gateway Appliances Version 7.1 Knowledge Center:
www.ibm.com/support/knowledgecenter/SS9H2Y_7.1.0/
com.ibm.dp.doc/welcome.html
© Copyright IBM Corp. 2015 Unit 15. Service level monitoring 15-1
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Unit objectives
After completing this unit, you should be able to:
• Identify the SLM functions that the DataPower Appliance provides
• Create an SLM policy object by using the WebGUI
• Create a custom SLM Statement
• Use the SLM Policy tab in the web service proxy to create a basic
SLM policy
Notes:
TR-375528 *****
V10.1
Student Notebook
Uempty
Monitored
Monitor
traffic
operation2
operation3
criteria, admin action
operation4
Notes:
Service level monitoring (SLM) within DataPower is a subset of service level management at the
enterprise level. Service level management means monitoring and managing the availability and
quality of the relevant services that are being provided. In this context, it generally implies the
availability and performance of the associated web services.
There might be a service level agreement (SLA) between the client and the service provider.
DataPower SLM is a tool to help deliver on the agreement. SLM is available for web service proxies
and multi-protocol gateways.
© Copyright IBM Corp. 2015 Unit 15. Service level monitoring 15-3
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
SLM policy
SLM statement
SLM statement
SLM statement
Notes:
SLMs differ from message monitors in that they are not directly associated with a service. Rather,
the SLM is implemented by using an SLM policy, which, in turn, is associated with the service.
Statements that measure execution durations are configured for messages that pass through the
appliance during a configured measurement window and that also match a set of selection criteria.
TR-375528 *****
V10.1
Student Notebook
Uempty
Notes:
The first two approaches have been supported for many years.
WS-MediationPolicy is an IBM proposed web service standard for quality of service (QoS)
specifications. WS-MediationPolicy statements can be a policy attachment for a WSDL, and they
can be stored in WebSphere Service Registry and Repository. WS-MediationPolicy statements
auto-generate SLM-related processing rules. These rules execute before the developer-specified
rules within the web service proxy. WS-MediationPolicy is not explained in any detail in this course.
© Copyright IBM Corp. 2015 Unit 15. Service level monitoring 15-5
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Figure 15-5. Approach 1: Add an SLM action to a request rule WE711 / ZE7111.0
Notes:
The SLM action screen capture is from a web service proxy.
Compare this action with the SLM action object, which is explained later.
TR-375528 *****
V10.1
Student Notebook
Uempty
1 2 3 4 5
Credential Resource
Schedule Action Threshold
class class
Notes:
A threshold and an SLM statement are not separate objects. They are specifications. A threshold is
a specification within an SLM statement. An SLM statement is a specification within an SLM policy
object.
Depending on what criteria are needed for a specific SLM statement, only certain SLM objects are
needed. For example, if you are monitoring only the target resource, then the SLM credential and
SLM schedule objects are not needed.
© Copyright IBM Corp. 2015 Unit 15. Service level monitoring 15-7
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Notes:
An SLM credential class is used to select messages for inclusion in the SLM policy statement. A
credential class obtains a credential (that is, a user identity) from a message.
The Credential Type determines the method that is used to obtain the identity. Examples are
Client IP, Mapped Credential, Extracted Identity, and IP from Header. It can also be a custom
style sheet. If the service is using the MQ transport protocol, you can also use the name of the MQ
application that is contained in the message. If Mapped Credential or Extracted Identity is used,
a previous AAA policy must exist to provide these values.
The Match Type setting determines the method that is used to match the credential that is
obtained. For a Match Type of Per Extracted Value, all configured SLM policies apply to each
extracted value. A list of all unique values of the specified type are extracted and reported. For a
Type of Exact, an SLM policy applies only to values that match. Another field appears that lists the
accepted values. For the Type of Regular Expression, an SLM policy applies only to values that
match. Instead of a list of specific values to match, a field appears that lists PCRE-style expressions
to determine whether a presented value matches.
TR-375528 *****
V10.1
Student Notebook
Uempty The Credential Value setting determines specific values when it is an exact match or regular
expression type. If a match is made, the message is included in the set of messages that the SLM
policy affects.
© Copyright IBM Corp. 2015 Unit 15. Service level monitoring 15-9
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
• A resource class
consists of:
– Resource Type:
Specifies a method
that is used to
identify the resource
– Match Type:
Specifies how a
successful match is
determined
– Resource Value:
Values to match
Notes:
An SLM resource class is used to select messages for inclusion in the SLM policy statement. A
resource class obtains a resource identifier from a message.
The Resource Type determines the method that is used to obtain the resource. Examples are
Mapped Resource, Destination URL, WSDL Operation, and XPath Expression. The list is
extensive; consult the product documentation for a complete list. If Mapped Resource is used, a
previous AAA policy must exist to provide these values.
The Match Type setting determines the method that is used to match the resource that is obtained,
which is the same as for the credential class.
If a match is made, the message is included in the set of messages that the SLM policy affects.
TR-375528 *****
V10.1
Student Notebook
Uempty
Notes:
Here are some Resource Type examples:
• WSDL: Specifies that a WSDL file defines membership in this resource class
• WSDL Service: Specifies that WSDL service names define membership in this resource class
• WSDL Operation: Specifies that WSDL operations define membership in this resource class
• Destination URL: Specifies the URL output to the destination server, which might not be
identical to the URL that the client requests
© Copyright IBM Corp. 2015 Unit 15. Service level monitoring 15-11
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
• Schedule elements
– Week Days
– Start Time
– Duration
– Start Date
– End Date
– Time Zone
© Copyright IBM Corporation 2015
Notes:
An SLM schedule restricts the hours and days of operation of an SLM statement. Schedules allow
the application of different policies during the different clock hours of a 24-hour day. If no schedule
is specified, this policy statement is enforced always.
Use the check boxes to specify the days of the week that are included in the SLM schedule.
The Start Time and Duration apply to all selected days.
The Start Date and Stop Date indicate which dates this schedule is in effect. The Stop Date is
non-inclusive.
The Time Zone (not visible in the screen capture) offers the choice of all the worldwide time zones,
or “appliance local time”. This setting indicates what time zone the Start Time is applied to.
TR-375528 *****
V10.1
Student Notebook
Uempty
Notes:
An SLM action defines a behavior that is triggered when a threshold value is attained. It specifies
the administrative operations or sanctions that are taken when the configured threshold is
exceeded.
Default SLM Action objects:
• Log only: After the action is triggered, it writes a log entry and continues to process subsequent
transactions.
• Reject: After the action is triggered, it writes a log entry and rejects traffic until the monitored
entity is within conformance levels.
• Shape: After the action is triggered, it writes a log entry. The next 2500 transactions are queued
for later transmission when the monitored entity is within conformance levels. After 2500
transactions are queued, further transactions are rejected.
Do not confuse the SLM action object that is used within an SLM statement with the SLM
processing action that is used in a processing rule to enable SLM monitoring.
© Copyright IBM Corp. 2015 Unit 15. Service level monitoring 15-13
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
SLM statement (1 of 2)
• An SLM statement can
consist of:
– Credential Class: Defines a
possible client group subject
to this SLM statement
– Resource Class: Identifies
a possible resource group
subject to this SLM
statement
– Schedule: Time frame
during which this SLM
statement is enforced
– SLM Action: Administrative
action (sanction) to take if
threshold violated (required)
• SLM statements exist only
within the SLM policy
object
Notes:
An SLM statement establishes criteria for selecting messages, sets a measurement interval, sets
thresholds, and determines the action to take when the threshold is exceeded for the selected
messages.
Messages are selected based on a credential class, a resource class, or both. If neither is
configured, all messages are selected.
The Identifier field gives this SLM statement a unique name within the SLM policy object that it is a
part of. It also is displayed in any log entries that are generated because this statement is in effect.
SLM statements are not objects that can be created, reviewed, or edited as stand-alone objects.
They are available only within the SLM policy object.
TR-375528 *****
V10.1
Student Notebook
Uempty
SLM statement (2 of 2)
Thresholds
• Usage level that triggers
an SLM action
Threshold fields
• Threshold Interval Type
– Fixed: A discrete block
of time, for example,
8 a.m. to 9 a.m.
– Moving: A moving
window, for example,
the last 60 minutes
– Concurrent: Use
concurrent number of
transactions
• Threshold Algorithm: Greater than, less than, token bucket, high-low threshold
• Threshold Type: Count all, count errors, back-end/internal/total latency,
request/response/total message payload
• Threshold Level: Value that triggers the threshold © Copyright IBM Corporation 2015
Notes:
The threshold algorithm specifies how the threshold is evaluated within the current interval. Greater
Than and Less Than are simple relational operations. Token-bucket is based on a rate and allows
bursting. High and low thresholds trigger at the high threshold and continue to trigger until the low
threshold is achieved.
The high-low-thresholds algorithm allows the user to specify when to start the sanction and when to
stop in cases where those two values are not the same. The threshold level is the “high” starting
point. The High Low Release Level (not shown) configures the “low” stopping point.
Threshold Type specifies how the Threshold Level is applied to the count.
Reporting Aggregation Interval is the base aggregation level in minutes for the reporting
statistics. This property is independent of the thresholding interval.
Maximum Records Across Intervals is the total number of records for a reporting interval. A
single reporting aggregation interval can contain multiple records; for example, one record per
resource or credential. With this property, you can define a maximum memory-consumption
threshold. The default is 5000.
© Copyright IBM Corp. 2015 Unit 15. Service level monitoring 15-15
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Auto Generated by GUI is a read-only property that, when on, indicates that the WebGUI created
from the statement is part of a default SLM configuration (SLM Policy tab in a web service proxy).
Maximum Credentials-Resource Combinations is the maximum number of records for the
combination of credentials and resources. This property limits the maximum number of
combinations and allows the setting of a maximum memory-consumption threshold. The default is
5000.
TR-375528 *****
V10.1
Student Notebook
Uempty
Notes:
The Evaluation Method field allows control over execution of the statements within the policy.
• Execute all statements: Causes the policy to execute all policy statements regardless of what
action those statements take
• Terminate at first action: Causes the policy to stop executing any statement after the first
statement that takes an action because a threshold is met
• Terminate at first reject (the default): Causes the policy to stop executing any statement after
the first statement that rejects a message because a threshold is met
An SLM policy can be enforced across a group of appliances that handle load-balanced traffic that
is destined for the same resources by using a Peer Group.
Peer groups establish a data sharing protocol among appliances so that each appliance includes
the traffic that passed through the other peers when calculating whether a threshold is reached.
SLM monitors are the only monitor types that do so.
© Copyright IBM Corp. 2015 Unit 15. Service level monitoring 15-17
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Notes:
TR-375528 *****
V10.1
Student Notebook
Uempty
Figure 15-16. Getting SLM statements into the Statement list WE711 / ZE7111.0
Notes:
This graphic is the right side of the WebGUI page from the previous slide.
© Copyright IBM Corp. 2015 Unit 15. Service level monitoring 15-19
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Figure 15-17. Approach 2: Specify SLM criteria to the levels of the WSDL (1 of 2) WE711 / ZE7111.0
Notes:
For the auto-generated SLM statements, you specify the measurement interval, the threshold
value, and the SLM action to take if the threshold is exceeded.
The Graph button is explained in a later slide.
The screen capture shows a service-level policy for the findByName operation of 200 transactions
per 60 seconds, which if exceeded results in a notify action. It also dictates that five failed
transactions within 60 seconds get logged. For the findByLocation operation, a lower limit of 150
transactions per 60 seconds results in the throttle action.
TR-375528 *****
V10.1
Student Notebook
Uempty
Figure 15-18. Approach 2: Specify SLM criteria to the levels of the WSDL (2 of 2) WE711 / ZE7111.0
Notes:
This graphic is the lower part of the SLM Policy tab for a web service proxy.
Configuring SLM peers is an administrative task.
SLM Statements lists only custom SLM statements that exist within the SLM policy that has the
same name as the web service proxy. The specifications on this page define the default SLM policy
object that is created for the web service proxy.
If you click Create New Statement, the page refreshes with a section that contains the same fields
as exist in an SLM statement configuration page.
© Copyright IBM Corp. 2015 Unit 15. Service level monitoring 15-21
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Notes:
The SLM graph is displayed by selecting the appropriate Graph radio button in the web service
proxy SLM Policy tab.
The possible time intervals are last 10 minutes, last 30 minutes, last hour, and last 3 hours.
This option is only for development time monitoring. For production monitoring, use software such
as the IBM Tivoli Monitoring Family.
TR-375528 *****
V10.1
Student Notebook
Uempty
– The default
web service
proxy request
policy
contains an
SLM action
Notes:
For both a web service proxy and a multi-protocol gateway, an SLM action must be in a rule of the
service policy for any SLM monitoring to occur.
Each request to a web service proxy executes the most specific rule that it can find, starting at the
port-operation level. Only one rule is executed per request. The default proxy rule contains an SLM
action for the request rule. Therefore, all web service requests participate in service level
monitoring by default. However, if a more specific rule is defined, the default proxy level rule is not
executed. Hence, no SLM action is “inherited.” For the more specific rule to support SLM
monitoring, it must also contain its own SLM action.
For a multi-protocol gateway, there is no such rule “inheritance.” Each rule must contain its own
SLM action to participate in SLM monitoring.
© Copyright IBM Corp. 2015 Unit 15. Service level monitoring 15-23
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Unit summary
Having completed this unit, you should be able to:
• Identify the SLM functions that the DataPower Appliance provides
• Create an SLM policy object by using the WebGUI
• Create a custom SLM Statement
• Use the SLM Policy tab in the web service proxy to create a basic SLM
policy
Notes:
TR-375528 *****
V10.1
Student Notebook
Uempty
Checkpoint questions
1. What are the five constructs that make up the SLM Statement
object?
A. Credential class, resource class, schedule, threshold, and action
B. Service policy, processing rules, actions, rules, and filter
C. Client class, resource class, schedule, threshold, and sanction
Description Definition
Notes:
Write your answers here:
1.
2.
(1)
(2)
3.
© Copyright IBM Corp. 2015 Unit 15. Service level monitoring 15-25
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Checkpoint answers
1. A
2. 1 – A, 2 – B
3. True
Notes:
TR-375528 *****
V10.1
Student Notebook
Uempty
Exercise 13
Notes:
© Copyright IBM Corp. 2015 Unit 15. Service level monitoring 15-27
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Exercise objectives
After completing this exercise, you should be able to:
• Specify service level monitoring criteria for a web service proxy
• Inspect and edit an SLM policy object
• Explain the need for an operation-level SLM action in a web service
proxy
• Create a custom log target for SLM events
Notes:
TR-375528 *****
V10.1
Student Notebook
Uempty
Exercise overview
• Test the existing BookingServiceWSProxy by using the load test facility
in SoapUI
• Create a log target for SLM log messages
• Add SLM criteria to the web service proxy
• Test the SLM action by using the SoapUI load test
• Add an SLM action to a port-operation request rule
• Use the SoapUI load test to test the operation-level SLM action
Notes:
The SoapUI load test sends a message a specific number of times within a specific interval.
© Copyright IBM Corp. 2015 Unit 15. Service level monitoring 15-29
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
TR-375528 *****
V10.1
Student Notebook
Uempty
Unit 16. Patterns for service configuration
References
IBM DataPower Gateway Appliances Version 7.1 Knowledge Center:
www.ibm.com/support/knowledgecenter/SS9H2Y_7.1.0/
com.ibm.dp.doc/welcome.html
© Copyright IBM Corp. 2015 Unit 16. Patterns for service configuration 16-1
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Unit objectives
After completing this unit, you should be able to:
• Explain what a DataPower pattern is, and describe its purpose
• Describe how a pattern is created
• Generate a new service from a pattern
Notes:
TR-375528 *****
V10.1
Student Notebook
Uempty
What is a pattern?
• A pattern is an importable and exportable DataPower object that is a
template of an existing service configuration (the “source service”)
• It is used to generate new services that are based on the source
service, but differ by a limited set of variables or specifications
• The pattern presents only the limited set of variables and specifications
• The new service is generated as a set of new DataPower objects
• The generated service can be further modified as needed
• There is no backward or forward connection between the generated
service and the generating pattern
• A pattern creator creates a pattern; a pattern deployer generates a
new service from a pattern
• Patterns can be further edited, cloned, and deleted
• A separate “Blueprint Console” GUI is used to work with patterns
• Several sample patterns are supplied with the firmware
© Copyright IBM Corporation 2015
Notes:
© Copyright IBM Corp. 2015 Unit 16. Patterns for service configuration 16-3
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Back-end URL
box, the pattern creator identifies
Handler
Service policy
the “source service” Rules
– An existing service that is the model Actions
for modified versions
• Up to three services can be
selected to be “chained”
together in the same pattern
• As the source service is
scanned, the “points of
variability” (POVs) are listed,
Pattern
and the creator selects which
Metadata
ones must be visible to the
deployer
POV
POV
POV
POV
POV
POV
– A POV is some configuration
variable that the pattern framework
allows to be exposed
© Copyright IBM Corporation 2015
Notes:
There is a list of the configuration variables in a service and its related objects that a pattern can
expose. The pattern creation dialog box displays them.
The pattern creator decides to expose the variable in the pattern, or locks the value so the deployer
cannot change it.
Service chaining within a pattern is available in firmware V7.1 and later.
TR-375528 *****
V10.1
Student Notebook
Uempty
Deploying a pattern
Pattern
Metadata
• The pattern deployer chooses
POV
POV
POV
POV
POV
POV
the appropriate pattern, and
selects “Deploy”
Back-end URL
• The service is generated as a
Handler
Service policy
set of new DataPower objects Rules
Actions
Notes:
The deployer can use only the POVs that the pattern creator exposed in the pattern. The
non-exposed POVs are hidden from the deployer.
© Copyright IBM Corp. 2015 Unit 16. Patterns for service configuration 16-5
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Notes:
TR-375528 *****
V10.1
Student Notebook
Uempty
Notes:
© Copyright IBM Corp. 2015 Unit 16. Patterns for service configuration 16-7
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Menu bar
Tabs
Shortcuts
Notes:
TR-375528 *****
V10.1
Student Notebook
Uempty
Notes:
“Save configuration” shows only in domains where the user has write permissions.
© Copyright IBM Corp. 2015 Unit 16. Patterns for service configuration 16-9
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Figure 16-9. The Blueprint Console: Getting Started tab WE711 / ZE7111.0
Notes:
The “manage appliance” functions are available in the default domain only. The option is not shown
in other domains.
TR-375528 *****
V10.1
Student Notebook
Uempty
Notes:
The list displays all the services in the domain, regardless of whether they were created from a
pattern or not.
Click the service to open the WebGUI configuration page for that service.
The BookingServiceProxy has three front side handlers: MQ, HTTP, and HTTPS.
“dp_public_ip” is a host alias that is specified in the service or handler definition. If you hover over
the “Front side URL” entries, the IP address of that host alias as defined on this appliance appears
in the hover help.
The icon entries for the Actions column open the system log for that service.
© Copyright IBM Corp. 2015 Unit 16. Patterns for service configuration 16-11
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Toolbar
List of Documentation on
patterns selected pattern as
in this written by the pattern
domain creator
© Copyright IBM Corporation 2015
Notes:
Because “REST Proxy” is one of the supplied sample patterns, you must be in the default domain
to be able to see it in the patterns list. Therefore, because it is the default domain, the Manage tab
is also visible.
TR-375528 *****
V10.1
Student Notebook
Uempty
Delete a pattern
Notes:
The supplied sample patterns in the default domain cannot be edited. They can be copied.
“Web application” is another of the supplied patterns in the default domain.
© Copyright IBM Corp. 2015 Unit 16. Patterns for service configuration 16-13
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Notes:
The available functions under this tab are primarily administrative functions that appliance
administrators perform.
• Appliance: System settings, time settings, language
• Data storage: RAID array
• Lifecycle management: Domains
• Network: Ethernet interfaces
• Network access: Telnet Service, SSH Service, Web Management Service, XML Management
Interface
• User access: User Account, User Group, RBM Settings
The screen capture is the User Account page for the User access selection.
TR-375528 *****
V10.1
Student Notebook
Uempty
2. Click Deploy
Notes:
© Copyright IBM Corp. 2015 Unit 16. Patterns for service configuration 16-15
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Notes:
TR-375528 *****
V10.1
Student Notebook
Uempty
Notes:
© Copyright IBM Corp. 2015 Unit 16. Patterns for service configuration 16-17
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Points of variability
• The pattern creation wizard exposes only a limited subset of the
configuration options for a multi-protocol gateway or a web service
proxy:
– Front side handler specifics
– WebSphere Service Registry and Repository subscription, WebSphere Service
Registry and Repository saved search subscription
– Multi-protocol gateway back-end URL
– Authentication with LTPA token, SSL certificate
– Authorization and authentication with LDAP
– Authorization and authentication with IBM Security Asset Manager
– Identity extraction from OAuth
• The pattern creator decides which POVs in the source service are
exposed to a pattern deployer
Notes:
IBM Security Asset Manager was previously called Tivoli Access Manager.
TR-375528 *****
V10.1
Student Notebook
Uempty
Unit summary
Having completed this unit, you should be able to:
• Explain what a DataPower pattern is, and describe its purpose
• Describe how a pattern is created
• Generate a new service from a pattern
Notes:
© Copyright IBM Corp. 2015 Unit 16. Patterns for service configuration 16-19
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Checkpoint questions
1. True or False: If a pattern is updated, all services that are generated
from that pattern are also updated.
Notes:
Write your answers here:
1.
2.
TR-375528 *****
V10.1
Student Notebook
Uempty
Checkpoint answers
1. False. As soon as a service is generated from a pattern, there is no
further connection between the pattern and the service.
2. False. The sample patterns are in the default domain, but patterns
can be created and deployed in any domain.
Notes:
© Copyright IBM Corp. 2015 Unit 16. Patterns for service configuration 16-21
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Exercise 14
Notes:
TR-375528 *****
V10.1
Student Notebook
Uempty
Exercise objectives
After completing this exercise, you should be able to:
• Use the DataPower Blueprint Console
• Import a pattern
• Specify the values for the points of variability in the pattern
• Deploy the pattern into a generated service
Notes:
© Copyright IBM Corp. 2015 Unit 16. Patterns for service configuration 16-23
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
TR-375528 *****
Student Notebook
Exercise overview
Pattern
Metadata
POV
POV
POV
POV
POV
POV
application domain
Back-end URL
Handler
Service policy
Rules
Actions
Notes:
TR-375528 *****
V10.1
Student Notebook
Uempty
Unit 17. Course summary
TR-375528 *****
Student Notebook
Unit objectives
After completing this unit, you should be able to:
• Explain how the course met its learning objectives
• Access the IBM Training website
• Identify other IBM Training courses that are related to this topic
• Locate appropriate resources for further study
Notes:
TR-375528 *****
V10.1
Student Notebook
Uempty
Notes:
TR-375528 *****
Student Notebook
Notes:
TR-375528 *****
V10.1
Student Notebook
Uempty
Course review (1 of 3)
• The XG45, XI52, and IDG appliances secure XML and web service
applications through two main services:
– Multi-protocol gateway (MPGW)
– Web service proxy (WS-Proxy)
• Clients can connect to the back-end service through the multi-protocol
gateway, over a number of different transport and application protocols
– Protocol handlers are available for HTTP and HTTPS protocols, FTP, raw XML
messages, TIBCO EMS, and IBM MQ systems
• A service policy within the MPGW or WS-Proxy controls much of the
behavior of a service
• Services use the cryptographic tools to configure SSL communication,
XML encryption, and digital signatures
• The Encrypt, Decrypt, Verify, and Sign processing actions provide
XML encryption and digital signatures down to the message field level
Notes:
TR-375528 *****
Student Notebook
Course review (2 of 3)
• The Authentication, Authorization, and Auditing processing action
restricts access to resources
– A wide range of message-level security specifications are supported, including
WS-Security, SAML, OAuth, XACML, SPNEGO, LTPA, Kerberos, and others
• The MPGW supports JSON-structured data and can operate as part of
a RESTful interface
– An MPGW can be used to bridge between a REST client and a web services
back end
• DataPower participates in the OAuth framework as a resource server
or authorization server
• The DataPower OAuth configuration options are:
– Web token service, AAA action options, OAuth client profile, OAuth client group
• An appliance can use a side cache or on-appliance cache to store
response documents to HTTP or HTTPS requests
Notes:
TR-375528 *****
V10.1
Student Notebook
Uempty
Course review (3 of 3)
• IBM MQ is a protocol that is commonly used for DataPower front-end
or back-end transport
– IBM MQ header manipulation and transactionality are supported
• The Web Service Proxy provides features tailored to web service
applications
– Service-level monitoring and processing policies can be applied at the service
definition, interface (portType), and operation levels
– Web service virtualization acts as a single endpoint for a group of operations that
different back-end services implement
• Message monitors and service-level monitors can filter, shape, and
throttle traffic through a DataPower appliance
• DataPower Patterns streamline the creation of services
Notes:
TR-375528 *****
Student Notebook
<lab_files>/Solutions
• Remember to change
– Port numbers
– Back-end server (Network > Interface > DNS Settings > Static Hosts)
– Front IP addresses (Network > Interface > Host Alias)
Notes:
TR-375528 *****
V10.1
Student Notebook
Uempty
Notes:
The 12-minute webcast was developed to teach DataPower developers how to define a user
account, user group, and application domain. The individual developer who is working on
DataPower Virtual Edition for Developers V7 might need to perform these typically administrative
functions.
TR-375528 *****
Student Notebook
Notes:
Always check the IBM website for current education offerings.
An SPVC is a self-paced virtual class. It offers the standard classroom material in both visual and
audio form. Depending on the course, it might also include hands-on exercises or demonstrations.
TR-375528 *****
V10.1
Student Notebook
Uempty
Unit summary
Having completed this unit, you should be able to:
• Explain how the course met its learning objectives
• Access the IBM Training website
• Identify other IBM Training courses that are related to this topic
• Locate appropriate resources for further study
Notes:
TR-375528 *****
Student Notebook
TR-375528 *****
V10.0
Student Notebook
AP
Appendix A. List of abbreviations
A
AAA authentication, authorization, and auditing
ACL access control list
ADT Android Development Tools
AES Advanced Encryption Standard
AMP Appliance Management Protocol
APAR authorized program analysis report
API application programming interface
AP-REQ Authentication Protocol - Request
AS Applicability Statement
ASCII American Standard Code for Information Interchange
B
B2B business-to-business
BPM business process management
C
CA certificate authority
CBA context-based access
CBR content-based routing
CCS coded character set
CCSID coded character set ID
CGI Common Gateway Interface
cHTML Compact HTML
CLI command-line interface
CN common name
COBOL Common Business Oriented Language
CR carriage return
CRL certificate revocation list
CSR certificate signing request
CSS cascading style sheet
TR-375528 *****
Student Notebook
D
DAP Directory Access Protocol
DB database
DER Distinguished Encoding Rules
DES Data Encryption Standard
DH Diffie-Hellman
DHCP Dynamic Host Configuration Protocol
DIME Direct Internet Message Encapsulation
DIT directory information tree
DL/I Data Language/I
DMZ A firewall configuration for securing local area networks
DN distinguished name
DNS Dynamic Name Server
DOM Document Object Model
DOP data-oriented programming
DoS denial-of-service
DP DataPower
DPL distributed program link
DSS Digital Signature Standard
DTD document type definition
DVD digital versatile disc
E
EAR enterprise archive
ebMS ebXML Message Service
ECMA European Computer Manufacturers Association
EDI Electronic Data Interchange
EDIFACT Electronic Data Interchange for Administration, Commerce, and Transport
EDIINT Electronic Data Interchange-Internet Integration
EJB Enterprise JavaBeans
EMS Enterprise Messaging System
EON Edge of Network
EP enforcement point
ESB enterprise service bus
TR-375528 *****
V10.0
Student Notebook
F
FEPI Front End Programming Interface
FIFO first-in first-out
FIPS Federal Information Processing Standard
FIX Financial Information Exchange
FLWOR for, let, where, order by, return
FO formatting object
FSH front side handler
FTP File Transfer Protocol
FTPS FTP over SSL
G
GB gigabyte
GDB GNU Project Debugger
GNU GNU's Not UNIX
GSKit Global Security Kit
GSS Generic Security Services
GUI graphical user interface
H
HMAC hash message authentication code
HR human resources
HREF hypertext reference
HSM Hardware Security Module
HSRP Hot Standby Router Protocol
HTML Hypertext Markup Language
HTTP Hypertext Transfer Protocol
HTTPS HTTP over SSL
I
ICAL IMS Call
TR-375528 *****
Student Notebook
J
J2SE Java Platform, Standard Edition
JAXP Java API for XML Processing
JDBC Java Database Connectivity
JFAP JetStream Formats and Protocols
JKS Java Key Store
JMS Java Message Service
JNDI Java Naming and Directory Interface
JRE Java runtime environment
JSON JavaScript Object Notation
JVM Java virtual machine
K
KB kilobyte
L
LAN local area network
LDAP Lightweight Directory Access Protocol
LDIF LDAP Data Interchange Format
TR-375528 *****
V10.0
Student Notebook
M
MAC message authentication code
Mb megabit
MB megabyte
MDB message-driven bean
MFA message filter action
MIB Management Information Base
MIME Multipurpose Internet Mail Extensions
MM message monitor
MMXDoS multiple message XML denial-of-service
MP3 MPEG-1 or MPEG-2 Audio Layer III
MPGW multi-protocol gateway
MQ Message Queue
MQCSP MQ connection security parameter
MQFSH MQ front side handler
MQFTE MQ File Transfer Edition
MQMD message queuing message descriptor
MQOD message queuing object descriptor
MT message type
MTOM Message Transmission Optimization Mechanism
N
NAT network address translation
NFS Network File System
NG New Generation
NIC network interface card
npm node package manager
NSS Network Security Services
NSTISSC National Security Telecommunications and Information Systems Security
Committee
NTP Network Time Protocol
TR-375528 *****
Student Notebook
O
OASIS Organization for the Advancement of Structured Information Standards
OAuth Open standard for Authorization
OID Object ID
OSI Open Systems Interconnection
OTMA Open Transaction Management Access
OTP One-Time Password
P
PAM Pluggable Authentication Module
PC personal computer
PCF Processing Control File
PCRE Perl-compatible regular expressions
PDF Portable Document Format
PDP policy decision point
PED PIN Entry Device
PEM Privacy-Enhanced Mail
PEP policy enforcement point
PI processing instruction
PIN personal identification number
PKCS Public Key Cryptography Standard
PKI public key infrastructure
PKIX Public Key Infrastructure for X.509 Certificates (IETF)
PMR program maintenance request
POP Post Office Protocol
POV point of variability
POX plain old XML
Q
QoS quality of service
R
RADIUS Remote Authentication Dial-In User Service
RAID Redundant Array of Independent Disks
RAM random access memory
TR-375528 *****
V10.0
Student Notebook
S
SAF System Authorization Facility
SAML Security Assertion Markup Language
SAS Serial Attached SCSI
SAX Simple API for XML
SCP Secure Copy Protocol
SCSI Small Computer System Interface
SDK software development kit
SFTP Secured File Transfer Protocol
SHA1 Secure Hash Algorithm, Version 1
SIBus service integration bus
SLA service level agreement
SLES SUSE Linux Enterprise Server
SLM service level management
SLM service level monitoring
SMS session management server
SMTP Simple Mail Transfer Protocol
SNMP Simple Network Management Protocol
SOA service-oriented architecture
SOAP Usage note: SOAP is not an acronym; it is a word in itself (formerly an acronym for
Simple Object Access Protocol)
TR-375528 *****
Student Notebook
T
Tcl Tool Control Language (often pronounced as “tickle”)
TCO total cost of ownership
TCP Transmission Control Protocol
TCP/IP Transmission Control Protocol/Internet Protocol
TDES Triple Data Encryption Standard
TFIM Tivoli Federated Identity Manager
TIA Telecommunications Industry Association
TIBCO The Information Bus Company
TIM Tivoli Identity Manager
TLS Transport Layer Security
TTL Time to Live
U
UDDI Universal Description, Discovery, and Integration
UDP User Datagram Protocol
UNIX Uniplexed Information and Computing System
URI Uniform Resource Identifier
URL Uniform Resource Locator
USB Universal Serial Bus
UTC Coordinated Universal Time
V
VIP virtual IP address
TR-375528 *****
V10.0
Student Notebook
AP VM virtual machine
VLAN virtual local area network
VRRP Virtual Router Redundancy Protocol
W
W3C World Wide Web Consortium
WAFW web application firewall
WAMC WebSphere Appliance Management Center
WML Wireless Markup Language
WS web services
WSDL Web Services Description Language
WSDM Web Services Distributed Management
WSP web service proxy
WS-Proxy web service proxy
WSRR WebSphere Service Registry and Repository
WTX IBM WebSphere Transformation Extender
WWW World Wide Web
X
XA Extended Architecture
XACML Extensible Access Control Markup Language
XCF cross-system coupling facility
XDoS XML denial of service
XHTML Extensible Hypertext Markup Language
XMI XML Management Interface
XML Extensible Markup Language
XMLDS XML digital signature
XMLFW XML firewall
XML-PI XML processing instructions
XPath XML Path Language
XSD XML Schema Definition
XSL Extensible Stylesheet Language
XSLT Extensible Stylesheet Language Transformation
TR-375528 *****
Student Notebook
Y
Z
z/OS zSeries operating system
TR-375528 *****
V10.0
Student Notebook
EXempty
Appendix B. Resource guide
Completing this WebSphere Education course is a great first step in building your WebSphere,
CICS, and SOA skills. Beyond this course, IBM offers several resources to keep your WebSphere
skills on the cutting edge. Resources available to you range from product documentation to support
websites and social media websites.
Training
• IBM Training website
- Bookmark the IBM Training website for easy access to the full listing of IBM training
curricula. The website also features training paths to help you select your next
course and available certifications.
- For more information, see: http://www.ibm.com/training
• IBM Training News
- Review or subscribe to updates from IBM and its training partners.
- For more information, see: http://bit.ly/IBMTrainEN
• IBM Certification
- You can demonstrate to your employer or clients your new WebSphere, CICS, or
SOA mastery through achieving IBM Professional Certification. WebSphere
certifications are available for developers, administrators, and business analysts.
- For more information, see: http://www.ibm.com/certify
• Training paths
- Find your next course easily with IBM training paths. Training paths provide a visual
flow-chart style representation of training for many WebSphere products and roles,
including developers and administrators.
- For more information, see:
http://www.ibm.com/services/learning/ites.wss/us/
en?pageType=page&c=a0003096
TR-375528 *****
Student Notebook
• Facebook:
- Become a fan of IBM Training on Facebook to keep in sync with the latest news and
career trends, and to post questions or comments.
- Find IBM Training at: facebook.com/ibmtraining
• YouTube:
- Go to the IBM Training YouTube channel to learn about IBM training programs and
courses.
- Find IBM Training at: youtube.com/IBMTraining
Support
• WebSphere Support portal
- The WebSphere Support website provides access to a portfolio of support tools.
From the WebSphere Support website, you can access several downloads,
including troubleshooting utilities, product updates, drivers, and authorized program
analysis reports (APARs). To collaboratively solve issues, the support website is a
clearing house of links to online WebSphere communities and forums. The IBM
support website is now customizable so you can add and delete portlets to the
information most important to the WebSphere products you work with.
- For more information, see: http://www.ibm.com/software/websphere/support
• IBM Support Assistant
- The IBM Support Assistant is a local serviceability workbench that makes it easier
and faster for you to resolve software product issues. It includes a desktop search
component that searches multiple IBM and non-IBM locations concurrently and
returns the results in a single window, all within IBM Support Assistant.
- IBM Support Assistant includes a built-in capability to submit service requests; it
automatically collects key problem information and transmits it directly to your IBM
support representative.
- For more information, see: http://www.ibm.com/software/support/isa
• WebSphere Education Assistant
- IBM Education Assistant is a collection of multimedia modules that are designed to
help you gain a basic understanding of IBM software products and use them more
effectively. The presentations, demonstrations, and tutorials that are part of the IBM
Education Assistant are an ideal refresher for what you learned in your WebSphere
Education course.
- For more information, see:
http://www.ibm.com/software/info/education/assistant/
TR-375528 *****
V10.0
Student Notebook
WebSphere Services
• IBM Software Services for WebSphere are a team of highly skilled consultants with
broad architectural knowledge, deep technical skills, expertise on suggested practices,
and close ties with IBM research and development labs. The WebSphere Services team
offers skills transfer, implementation, migration, architecture, and design services, plus
customized workshops. Through a worldwide network of services specialists, IBM
Software Service for WebSphere makes it easy for you to design, build, test, and deploy
solutions, helping you to become an on-demand business.
• For more information, see:
http://www.ibm.com/developerworks/websphere/services/
TR-375528 *****
Student Notebook
TR-375528 *****
V10.0
backpg
Back page
TR-375528 *****
WE711G Miguel Pachas SYNOPSIS(1)
TR-375528 *****
As a global IT solutions distributor, Avnet Technology Solutions transforms technology into business solutions for customers around
the world. It collaborates with customers and suppliers to create and deliver services, software and hardware solutions that
address the changing needs of end-user customers. The group serves customers and suppliers in North America, Latin America and
Caribbean, Asia Pacific, and Europe, Middle East and Africa. It generated US $11.0 billion in annual revenue for fiscal year 2014.
Avnet Technology Solutions is an operating group of Avnet, Inc. For more information, visit http://www.ats.avnet.com.
© 2015 Avnet, Inc. All rights reserved. The Avnet Technology Solutions logo and SolutionsPath are registered trademarks and
PayNow, CloudReady and Accelerating Your Success are trademarks of Avnet, Inc. All other products, brands and names are
Accelerating Your Success ™
trademarks or registered trademarks of their respective owners.