WAF Insights does not support automation via our REST API web service. If you are currently using WAF Insights, upgrade your WAF solution to take advantage of our REST API.
Creates an access rule that identifies valid or malicious requests via whitelists, accesslists, and blacklists.
A request to create an access rule is described below.
HTTP Method | Request URI |
---|---|
POST |
https://api.edgecast.com/v2/mcc/customers/AccountNumber/waf/v1.0/acl |
Define the following variable 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 |
---|---|
Required |
|
This endpointIdentifies a request's connection point to our REST API service. only takes advantage of common request headers.
Pass the following request body parameters:
Name | Data Type | Description |
---|---|---|
allowed_http_methods |
Array String values |
Identifies each allowed HTTP method (e.g., GET). |
allowed_request_content_types |
Array String values |
Identifies each allowed media type (e.g., application\/json). |
Object |
Contains access controls for autonomous system numbers (ASNs). |
|
Object |
Contains access controls for cookies. |
|
Object |
Contains access controls for countries. Specify each desired country using its country code. |
|
customer_id |
String |
Identifies your account by its customer account number. |
disallowed_extensions |
Array String values |
Indicates each file extension for which WAF will send an alert or block the request. |
disallowed_headers |
Array String values |
Indicates each request header for which WAF will send an alert or block the request. |
Object |
Contains access controls for IPv4 and/or IPv6 addresses. Specify each desired IP address using standard IPv4/IPv6 and CIDR notation. |
|
max_file_size |
Integer |
Indicates the maximum file size, in bytes, for a POST request body. |
name |
String |
Assigns a name to this access rule. |
Object |
Contains access controls for referrers. All referrers defined within a whitelist, accesslist, or blacklist are regular expressions. |
|
response_header_name |
String |
Determines the name of the response header that will be included with blocked requests. |
Object |
Contains access controls for country subdivisons (e.g., states or provinces). Specify each desired country subdivision using an ISO-3166-2 code. |
|
Object |
Contains access controls for URL paths. Specify a URL path pattern that starts directly after the hostname. Exclude a protocol or a hostname when defining value | values.
All URL paths defined within a whitelist, accesslist, or blacklist are regular expressions. |
|
Object |
Contains access controls for user agents. All user agents defined within a whitelist, accesslist, or blacklist are regular expressions. |
The asn, cookie, country, ip, referer, url, and user_agent objects contain the following properties:
Name | Data Type | Description |
---|---|---|
accesslist |
Array String / integer values |
Contains entries that identify traffic that may access your content upon passing a threat assessment. ASN access controls are integer values. All other access controls are string values. |
blacklist |
Array String / integer values |
Contains entries that identify traffic that will be blocked or for which an alert will be generated. ASN access controls are integer values. All other access controls are string values. |
whitelist |
Array String / integer values |
Contains entries that identify traffic that may access your content without undergoing threat assessment. ASN access controls are integer values. All other access controls are string values. |
All entries within a cookie, referrer, URL, or user agent whitelist, accesslist, or blacklist are regular expressions.
The response to the above request includes an HTTP status code, response headers, and a response body.
A status code indicates whether the request was successfully performed.
The response for this endpoint only includes standard HTTP response headers.
The response body for a successful request contains the following parameters:
Name | Data Type | Description |
---|---|---|
id |
String |
Indicates the system-defined ID for the resource. |
status |
String |
Returns success. |
success |
Boolean |
Returns true. |
The response body for an unsuccessful request contains the following parameters:
Name | Data Type | Description |
---|---|---|
success |
Boolean |
Returns false. |
Array Objects |
Contains one or more error(s). |
The errors array describes each error that occurred using the following properties:
Name | Data Type | Description |
---|---|---|
code |
Integer |
Indicates the HTTP status code for the error. |
message |
String |
Indicates the description for the error that occurred. |
A sample JSON request is shown below.
POST https://api.edgecast.com/v2/mcc/customers/0001/waf/v1.0/acl HTTP/1.1
Authorization: TOK:12345678-1234-1234-1234-1234567890ab
Accept: application/json
Content-Type: application/json
Host: api.edgecast.com
{ "asn": { "accesslist": [], "blacklist": [], "whitelist": [] }, "cookie": { "blacklist": [ "bot" ], "whitelist": [ "trusted" ] }, "country": { "accesslist": [], "blacklist": [], "whitelist": [] }, "disallowed_extensions": [ ".asa", ".asax", ".ascx", ".axd", ".backup", ".bak", ".bat", ".cdx", ".cer", ".cfg", ".cmd", ".com", ".config", ".conf", ".cs", ".csproj", ".csr", ".dat", ".db", ".dbf", ".dll", ".dos", ".htr", ".htw", ".ida", ".idc", ".idq", ".inc", ".ini", ".key", ".licx", ".lnk", ".log", ".mdb", ".old", ".pass", ".pdb", ".pol", ".printer", ".pwd", ".resources", ".resx", ".sql", ".sys", ".vb", ".vbs", ".vbproj", ".vsdisco", ".webinfo", ".xsd", ".xsx/" ], "ip": { "accesslist": [], "blacklist": [], "whitelist": [] }, "referer": { "accesslist": [], "blacklist": [], "whitelist": [] }, "url": { "accesslist": [], "blacklist": [], "whitelist": [] }, "user_agent": { "accesslist": [], "blacklist": [], "whitelist": [] } }
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: 65
{ "id": "dQndQsnv", "status": "success", "success": true }