How do the Parameters and Options Fields Listed in the ASM API rule_mod command alter an HTTP or HTTPS monitor

Document ID : KB000031339
Last Modified Date : 14/02/2018
Show Technical Document Details

Problem:

How do the Parameters and Options Fields Listed in the ASM API rule_mod command alter an HTTP or HTTPS monitor?

 

Solution:

The ASM API provides a rule_mod command (https://api.cloudmonitor.ca.com/1.6/rule_mod?doc) which allows a user to modify a monitor’s configuration without signing into the ASM UI. While most of the fields listed in the API function independent of monitor, the Parameters and Options fields for this call function differently depending on the monitor type being modified by the call. This KB will specifically discuss the two parameters for HTTP and HTTPS monitors.

The parameters field is a text field that allows a user to specify additional parameters as part of a monitor run. For HTTP and HTTPS monitors, this field corresponds to “Match string or regular expression” in the ASM UI. This field allows a user to specify a pattern or text that should be present in source of the page returned. Should this text be missing, the monitor will fail on that check.

The Options Field allows a user to specify monitor specific options as list in the UI. For HTTP monitors, these options are “Customer HTTP Request Headers”, “Avoid Compression”, “Redirect Limit”, and “Use NTLM”. To specify these in the options in the API, the following variables are used separated by the ‘&’ character:

 

Parameter examples below: - UI Field - API variable name - API acceptable values

-Customer HTTP Request Headers - WMhdr= <accepts valid http request headers>
-Avoid Compression- nozip=< 1 enables avoiding compression or 0 to allow compression>
-Redirect Limit - redir=<accepts an integer between 0 and 10>
-Use NTLM - ntlm=<1 to enable NTLM and 0 to disable>

 

An HTTPS monitor adds the following two options:

Parameter examples below: - UI Field - API variable name - API acceptable values


-Verify Certificate- nocert=< 0 to enable certificate validation and 1 to disable certificate validation>
-Encryption  - sec=<tls, sslv3, sslv2, and leave blank for negotiate>

 

For example, running rule_mod with the following options…


WMhdr=Accept-language: en-us&nozip=1&redir=7&ntlm=1&nocert=0&sec=tls

 

…will result in the following monitor configuration:
 MonitorOptions.png