Configuring data change for HAT configuration in IAG

Applies To: Intelligent Application Gateway (IAG)

When configuring host address translation (HAT) in Whale Communications Intelligent Application Gateway (IAG) 2007 portals, data change is used in responses and is preformed prior to content parsing. It can be used as follows:

  • Token-to-token replacement is used to replace text strings within text buffers (for example, because in <SCRIPT> tags, the filter can only manipulate absolute paths if they are contained in a standard function, use this type of replacement in server-specific scripts, where URLs are contained within non-standard function calls).

  • Signature injection is used to inject the IAG unique signature before or after a specific text string. For example: if, within an unknown XML element, the text buffer includes a relative link, use this method to add the signature before the link.

You configure data change in the Application Access Portal configuration file by using the <DATA_CHANGE> element, described below.

For more information about HAT, see About host address translation (HAT) in IAG portals.

<DATA_CHANGE>

Description

Used to manipulate the content of the response before data is sent to the client, as follows:

  • Search and replace data strings within text buffers

  • Inject the IAG unique signature before or after data strings within text buffers

Can be applied per server or a number of servers or per application type or types.

Usage

  • <DATA_CHANGE> is optional.

  • Only one <DATA_CHANGE> element can be configured in the AAP configuration file.

Attributes & Attribute Values

None.

Child Elements

  • <DATA_CHANGE> can contain an unlimited number of <SERVER> elements.

  • <DATA_CHANGE> can contain an unlimited number of <APPLICATION> elements.

[<DATA_CHANGE>] > [<SERVER>]

<SERVER>

Description

Child element of <DATA_CHANGE>. Defines the server and URL in which data is changed.

Usage

An unlimited number of <SERVER> elements can be nested under <DATA_CHANGE>.

Attributes & Attribute Values

None.

Child Elements

<SERVER> must contain the following:

  • One <SERVER_NAME> element.

  • One or more <URL> elements.

Optionally, <SERVER> can also contain one <PORT> element.

[<DATA_CHANGE>] > [<APPLICATION>]

<APPLICATION>

Description

Child element of <DATA_CHANGE>. Defines the application type in which data is changed.

Usage

An unlimited number of <APPLICATION> elements can be nested under <DATA_CHANGE>.

Attributes & Attribute Values

None.

Child Elements

<APPLICATION> must contain the following:

  • One <APPLICATION_TYPE> element.

  • One or more <URL> elements.

[<DATA_CHANGE>] > [<SERVER>] > [<SERVER_NAME>]

<SERVER_NAME>

Description

Child element of <SERVER>. Defines the server in which data is changed.

Usage

  • Only one <SERVER_NAME> element must be nested under each <SERVER> element.

  • Can be defined using one of the following methods:

    • Server name or a range of names by using regular expressions.

    • Subnet by using the mask attribute. For example:

      For subnet class A:

      <SERVER_NAME mask="255.0.0.0">63.0.0.0</SERVER_NAME``>

      For subnet class B:

      <SERVER_NAME mask="255.255.0.0">160.12.0.0</SERVER_NAME>

      For subnet class C:

      <SERVER_NAME mask="255.255.255.0">192.168.1.0</SERVER_NAME>

      Note: In this syntax, enter the actual IP address, not regular expressions.

Tip

For examples of the use of both methods in a <SERVER_NAME> element, refer to Sample Code: <DATA_CHANGE>.

Attributes & Attribute Values

Attribute Values Type or comments

mask

subnet mask

Optional. Used to define a subnet mask.

Child Elements

None.

[<DATA_CHANGE>] > [<SERVER>] > [<PORT>]

<PORT>

Description

Child element of <SERVER>. Specifies the port number, on the server defined in <SERVER_NAME>, on which data is changed.

Usage

  • Optional.

  • Only one <PORT> element can be nested under each <SERVER> element.

Attributes & Attribute Values

None.

Child Elements

None.

[<DATA_CHANGE>] > [<APPLICATION>] > [<APPLICATION_TYPE>]

<APPLICATION_TYPE>

Description

Child element of <APPLICATION>. Type of application where data is changed.

Note

For instructions on where you can find the name of the application type, as it should be entered here, see the section "Finding an application type" in About the Editor console.

Usage

Only one <APPLICATION_TYPE> element must be nested under each <APPLICATION> element.

Attributes & Attribute Values

None.

Child Elements

None.

[<DATA_CHANGE>] > [<SERVER>]¦[<APPLICATION>] > [<URL>]

<URL>

Description

Child element of <SERVER> or of <APPLICATION>. Defines the URL and the required data change.

Usage

  • At least one <URL> element must be nested under each <SERVER> or <APPLICATION> element.

  • An unlimited number of <URL> elements can be nested under each <SERVER> or <APPLICATION> element.

Attributes & Attribute Values

None.

Child Elements

<URL> must contain the following:

  • One <NAME> element.

  • One or more of the following elements or element-pairs:

    • <ADD_SIGNATURE> element.

    • <SEARCH> and <REPLACE> element-pair, described in <SEARCH> and in <REPLACE>.

      Note

      <SEARCH> and <REPLACE> elements always come in pairs; for every <SEARCH> element, there must be a <REPLACE> element.

[<DATA_CHANGE>] > [<SERVER>]¦[<APPLICATION>] > [<URL>] > [<NAME>]

<NAME>

Description

Child element of <URL>. Defines the name of the URL.

Usage

  • Only one <NAME> element must be nested under each <URL> element.

  • Takes regular expressions.

Attributes & Attribute Values

None.

Child Elements

None.

[<DATA_CHANGE>] > [<SERVER>]¦[<APPLICATION>] > [<URL>] > [<ADD_SIGNATURE>]

<ADD_SIGNATURE>

Description

Child element of <URL>. Defines the injection of the IAG unique signature by defining a data string, where the signature is added before or after the string.

Usage

  • An unlimited number of <ADD_SIGNATURE> elements can be nested under each <URL> element.

  • You can use plain text or regular expressions in order to define the data string where the signature is added. To use regular expressions, apply the mode attribute described below.

Attributes & Attribute Values

Attribute Values Type/Comments

encoding

base64

Optional.

location

before, after

Mandatory. Location where the signature is added, in relation to the string you define in this element.

mode

regex

Optional. Indicates that regular expressions are used to define the string.

Tip

In order to edit encoded text, use the Editor to convert from and to

base64.

Child Elements

None.

Description

Child element of <URL>. Defines a string to search.

Usage

  • An unlimited number of <SEARCH> elements can be nested under each <URL> element.

  • For every <SEARCH> element, there must be a <REPLACE> element, described in <REPLACE>.

  • You can search for plain text or use regular expressions. To use regular expressions, apply the mode attribute as described below.

Attributes & Attribute Values

Attribute Values Type/Comments

encoding

base64

Optional. Used when an entire script, not only the URL, is searched.

Tip

In order to edit encoded text, use the Editor to convert from and to base64, as described in Editor.

mode

regex,

regexparam

Optional. Indicates that regular expressions are used to define the string.

  • regex: the entire string is replaced.

  • regexparam: some parameters in the string are retained while other items in the string are replaced.

    See below for an example of how to use the “regexparam” value.

Example of how the “regexparam” value is used:

This example describes how you use a single search and replace action in order to

identify these strings:

ThisWillRemain12_REPLACEME_ThisWillAlsoRemain56

ThisWillRemain22_REPLACEME_ThisWillAlsoRemain66

ThisWillRemain32_REPLACEME_ThisWillAlsoRemain76

and replace them with these corresponding strings:

*NEW*ThisWillRemain12*NEWTEXT*ThisWillAlsoRemain56*MORENEW*

*NEW*ThisWillRemain22*NEWTEXT*ThisWillAlsoRemain66*MORENEW*

*NEW*ThisWillRemain32*NEWTEXT*ThisWillAlsoRemain76*MORENEW*

In order to achieve this, you define the <SEARCH> and <REPLACE> elements as follows:

  • In the <SEARCH> element:

    • Enclose the items that will not be changed within parentheses, including the regular expressions used to identify the string.

      Tip

      This example demonstrates the use of the \d+ expression; you can use any regular expression here.

    • Leave the text that you are replacing outside the parentheses.

      The above example is implemented using this <SEARCH> element:

      <SEARCH encoding="" mode="regexparam">

      (ThisWillRemain\d+)_REPLACEME_(ThisWillAlsoRemain\d+) </SEARCH>

  • In the corresponding <REPLACE> element, type the new text, interspersed by $1, $2... $n, where $1 corresponds to the contents of the first set of parentheses, $2 corresponds to the contents of the second set of parentheses, and so on.

    The above example is implemented using this <REPLACE> element:

    <REPLACE encoding="">*NEW*$1*NEWTEXT*$2*MORENEW* </REPLACE>

Child Elements

None.

[<DATA_CHANGE>] > [<SERVER>]¦[<APPLICATION>] > [<URL>] > [<REPLACE>]

<REPLACE>

Description

Child element of <URL>. Defines the string that replaces the string defined in <SEARCH>.

Usage

  • An unlimited number of <REPLACE> elements can be nested under each <URL> element.

  • For every <REPLACE> element, there must be a <SEARCH> element, described in <SEARCH>.

Attributes & Attribute Values

Attribute Values Type/Comments

encoding

base64

Optional. Used when an entire script, not only the URL, is replaced.

Tip

In order to edit encoded text, use the Editor to convert from and to base64, as described in Editor.

Child Elements

None.

Sample Code: <DATA_CHANGE>

<DATA_CHANGE>

<SERVER>

<SERVER_NAME mask="">192\.168\.1\.75</SERVER_NAME>

<PORT>443</PORT>

<URL>

<NAME>/whale\.html</NAME>

<ADD_SIGNATURE encoding="" location="before">test/id/

user</ADD_SIGNATURE>

<ADD_SIGNATURE encoding="" location="after"

mode="regex">

ows_FileRef=AA(\d+);#</ADD_SIGNATURE>

<ADD_SIGNATURE encoding="" location="before"

mode="regex">

test/\d+/id/user\d+/file\.htm</ADD_SIGNATURE>

</URL>

</SERVER>

<SERVER>

<SERVER_NAME mask="255.255.255.0">192.168.1.0<SERVER_NAME>

<URL>

<NAME>/whale\.html</NAME>

<SEARCH encoding="">/images/</SEARCH>

<REPLACE encoding="">https://192.168.1.75/images/

</REPLACE>

</URL>

</SERVER>

<APPLICATION>

<APPLICATION_TYPE>OWA2003</APPLICATION_TYPE>

<URL>

<NAME>/exchange/.*/Inbox/.*\.EML\?cmd=preview

</NAME>

<ADD_SIGNATURE encoding="" location="before">

/exchweb/bin/redir.asp

</ADD_SIGNATURE>

</URL>

<URL>

<NAME>/exchange/.*/Inbox/.*\.EML\?cmd=preview</NAME>

<SEARCH encoding="" mode="regexparam">

(ThisWillRemain\d+)_REPLACE_(ThisWillAlsoRemain\d+)

</SEARCH>

<REPLACE encoding="">*NEW*$1*NEWTEXT*$2*MORENEW*</

REPLACE>

</URL>

</APPLICATION>

</DATA_CHANGE>