Get Instance by ID

This article explains the legacy version of WAF that underwent end-of-life on June 30, 2021. Our new version of WAF expands upon all of the capabilities offered by WAF (Legacy) and Rate Limiting (Legacy) with a simplified and centralized setup. Please upgrade to the latest version of WAF at your earliest convenience.

WAF Essential cannot be configured via our APIs. However, you may leverage our APIs to retrieve WAF and Rate Limiting event log data.

Retrieves a WAF instance by its system-defined ID.

Request

A request to retrieve a WAF instance is described below.

HTTP Method Request URI

GET

https://api.transactcdn.com/v2/mcc/customers/AccountNumber/waf/config/instances/InstanceID

Define the following variables when submitting the above request:

VariableA variable represents a value that must be replaced. A variable consists of either a URL segment (e.g., "0001" in /0001/) or a query string value (e.g., "3" in mediaTypes=3). Description

AccountNumber

Required

Replace this variable with a customer account number. This account number may be found in the upper left-hand corner of the TCC.

InstanceID

Required

Replace this variable with the system-defined ID of the desired instance.

Use the Get All Instances endpoint to retrieve a list of all available instances and their system-defined IDs.

Request Headers

This endpointIdentifies a request's connection point to our REST API service. only takes advantage of common request headers.

Request Body

Request body parameters are not required by this endpoint.

Response

The response to the above request includes an HTTP status code, response headers, and a response body.

Status Code

A status code indicates whether the request was successfully performed.

Response Headers

The response for this endpoint only includes standard HTTP response headers.

View common response headers.

Response Body

The response body for a successful request contains the following response parameters:

Name Data Type Description

name

String

Indicates the name of the requested WAF instance.

id

String

Identifies a WAF instance by its system-defined ID.

prod_profile_id

String

Identifies a profile that will be applied to production traffic by its system-defined ID.

prod_profile_name

String

Indicates the name of the profile identified by the prod_profile_id response parameter.

prod_profile_action

Deprecated

String

The prod_profile_enforcements parameter has the final authority on the type of action that will be applied to production traffic when a request violates the profile defined by the prod_profile_name parameter.

This parameter has been deprecated in favor of the prod_profile_enforcements parameter.

Identifies the action that will be taken on production traffic when a request violates the profile defined by prod_profile_name parameter.

Valid values are:

  • alert: Indicates that request violations will be tracked via the WAF dashboard.
  • block: Indicates that request violations will be blackholed. Additionally, these violations will be tracked via the WAF dashboard.

audit_profile_id

String

Identifies a profile that will audit production traffic by its system-defined ID.

This response parameter is null when an audit profile is unassigned for the requested instance.

audit_profile_name

String

Identifies a profile that will audit production traffic by its name.

This response parameter is null when an audit profile is unassigned for the requested instance.

enabled_date

String

Indicates the date and time (UTC) at which the instance was last modified.

Syntax:

m\/d\/YYYY HH:MM:SS AM|PM

prod_profile_enforcements

Array

This array contains objects that describe the type of action that will be applied to threats detected as a result of this instance configuration.

If this parameter reports an empty array, then the deprecated prod_profile_action parameter determines how detected threats will be handled.

name

String

prod_profile_enforcements array

Identifies the type of action that will be applied to production traffic when a request violates the profile defined by the prod_profile_name parameter.

Valid values are:

  • Block Request
  • Alert Only
  • Redirect (HTTP 302)
  • Custom Response

type

String

prod_profile_enforcements array

Identifies the type of action that will be applied to production traffic when a request violates the profile defined by the prod_profile_name parameter.

Valid values are:

  • block-request: Block Request
  • nop: Alert Only
  • redirect-302: Redirect (HTTP 302)
  • custom-response: Custom Response

url

String

prod_profile_enforcements array

Redirect Only

This parameter is only relevant when this instance has been configured to redirect (i.e., redirect-302 action) malicious traffic.

Identifies the URL to which requests identified as malicious traffic will be redirected.

display_default_error_page

Boolean

prod_profile_enforcements array

Custom Response Only

This parameter is only relevant when this instance has been configured to send a custom response (i.e., custom-response action) whenever malicious traffic is detected.

Indicates whether a default error page will be sent in response to malicious traffic.

Valid values are:

  • True: A default error page will be sent in response to malicious traffic.
  • False: The response body defined in the response_body_base64 parameter will be sent in response to malicious traffic.

The response_body_base64 parameter overrides this option.

response_body_base64

String

prod_profile_enforcements array

Custom Response Only

This parameter is only relevant when this instance is configured to send a custom response (i.e., custom-response action) whenever malicious traffic is detected.

Indicates the response body that will be sent in response to malicious traffic.

This value is Base64 encoded.

response_headers

Object

prod_profile_enforcements array

Custom Response Only

This parameter is only relevant when this instance is configured to send a custom response (i.e., custom-response action) whenever malicious traffic is detected.

Indicates the set of response headers that will be included in the response sent to malicious traffic.

Each response header is specified as a name/value pair.

status

Integer

prod_profile_enforcements array

Custom Response Only

This parameter is only relevant when this instance is configured to send a custom response (i.e., custom-response action) whenever malicious traffic is detected.

Indicates the HTTP status code (e.g., 404) for the custom response that will be sent to malicious traffic.

Errors

The response body for an unsuccessful request will contain an error response that provides additional information.

View common error messages.

Sample Request and Response

A sample JSON request is shown below.

GET https://api.transactcdn.com/v2/mcc/customers/0001/waf/config/instances/1234 HTTP/1.1

Authorization: TOK:12345678-1234-1234-1234-1234567890ab

Accept: application/json

Host:api.transactcdn.com

A sample JSON response is shown below.

HTTP/1.1 200 OK

Cache-Control: private

Content-Type: application/json; charset=utf-8

Date: Thu, 15 Apr 2021 12:00:00 GMT

Content-Length: 143

{
	"name" : "Site C",
	"id" : "1234",
	"prod_profile_id" : "23",
	"prod_profile_name" : "Basic Profile",
	"prod_profile_action" : "alert",
	"audit_profile_id" : "0",
	"audit_profile_name" : null,
	"enabled_date" : "3\/6\/2022 6:45:19 PM",
	"prod_profile_enforcements" : [{
			"display_default_error_page" : true,
			"name" : "Custom Response",			
			"response_headers" : {
				"Profile" : "Basic"
			},
			"status" : 403,
			"type" : "custom-response"
		}
	]
}