Controlling the surge protector esg (bannedaddrs)

Overview

Provides access to the Edge Network Filter operational data of all role instances esg.

Automatic blocking of an IP address occurs when SIP-requests with incorrect authorization data are repeatedly received from it within a limited time interval. Automatic locking is done on a specific instance of the role esg. Those added to the list via the API are placed on the banned address lists on all available instances of the role esg.

Displays all blocked IP addresses and blocking times - both those automatically blocked and those added by the master domain administrator. It also allows you to work with the list of blocked IP addresses: add, delete, clear.

Requests

HTTP verb Endpoint Description

POST

/rest/v1/master/logicalroles/esg/bannedaddrs

Adding an IP address to blocked lists

GET

/rest/v1/master/logicalroles/esg/bannedaddrs

Getting the list of esg role instances and blocked IP addresses

DELETE

/rest/v1/master/logicalroles/esg/bannedaddrs

Clearing lists of blocked addresses

DELETE

/rest/v1/master/logicalroles/esg/bannedaddrs/<ipaddr>

Remove an address from the list of blocked addresses

General scoping parameters of requests

The given parameters are used in the URL (?param=value) to restrict the scoping of the request (the composition of role instances to which the request applies). All are optional and may not be available. It makes sense to specify no more than one of these, or to specify none.

Table 1. Possible parameters
Name Type Description

site

str

The site name from the configuration.

For example SITE8.

sites

array<str>

A comma-separated list of site names.

For example SITE1,SITE3.

server

str

Server alias. Can be the IP address, number or full name of the server from configuration.

For example 192.168.0.12 or 372.

servers

array<str>

A comma-separated list of server aliases.

For example 192.168.0.12,372,server05.


Adding an IP address to blocked lists

Adds an arbitrary IP address to the role’s banned IP address lists esg.

The query is parallelized for execution on all instances of the esg role included in the skope specified by parameters in the URL.

Request

URL may contain additional scope-parameters.

Table 2. Object fields
Name Type Description

ip

str

IPV4-address to be blocked.

expires

int

The time interval in seconds after which the address should be automatically deleted.

Each subsequent request for the specified address extends the auto-delete timer.

Request example
POST /rest/v1/master/logicalroles/esg/bannedaddrs?site=SITE1 HTTP/1.1
Content-Type: application/json; charset=utf-8

{
  "ip": "212.54.68.68",
  "expires": "600"
}

Response

Contains a list of object representations of all instances of the esg role included in the query scope. Each object contains the status and result of the query execution.

Table 3. Object fields
Name Description

site

The name of the site where the current role instance is located esg.

node

The name of the node on which the current role instance is executed esg.

srvidx

The server number from the configuration on which the node with the current role instance is running esg

addr

The address of the server from the configuration on which the node with the current role instance is running esg

online

An indication of the activity/availability of the role instance from the web server serving the request.

  • true – role instance is available and active.

  • false – role instance is unavailable.

result

For active and available instances, specifies the result of the operation.

  • true – IP-address is successfully saved to the list of forbidden IP addresses of the current role instance.

  • false – operation has not been performed on the current role instance.

Response example
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

[
  {
    "site": "SITE1",
    "node": "site1_h11@192.168.0.12",
    "srvidx": 120,
    "addr": "192.168.0.12",
    "online": true,
    "result": true
  },
  {
    "site": "SITE1",
    "node": "site1_h1@192.168.0.15",
    "srvidx": 150,
    "addr": "192.168.0.15",
    "online": true,
    "result": true
  }
]

Getting the list of esg role instances and blocked IP addresses

Returns a list of object-representations of all instances of role esg included in the query scope specified by scope-parameters in the URL.

Each object contains the status of a role instance and a list of blocked IP addresses on that role instance if it is active and available.

Request

Table 4. Request parameters
Name Type Description

filter

object

Filter by field values.

mask

str

List of fields to output. Available fields for output: banned, addr, node, online, site, srvidx.

offset

int

Offset in the list of resources to be issued.

limit

int

The maximum number of resources in the list.

order

array<object|str>

The sort order of the resources in the list.

flat

bool

Conversion to flat form of composite fields.

URL may contain additional scope-parameters.

Request example
GET /rest/v1/master/master/logicalroles/esg/bannedaddrs?site=SITE1,mask=banned,node,online&limit=2 HTTP/1.1

Response

Contains a list of objects, each representing a specific instance of the esg role included in the request skope.

Table 5. Object fields
Name Description

site

The name of the site where the current role instance is located esg.

node

The name of the node on which the current role instance is executed esg.

srvidx

The server number from the configuration on which the node with the current role instance is running esg

addr

The address of the server from the configuration on which the node with the current role instance is running esg

online

An indication of the activity/availability of the role instance from the web server serving the request.

  • true – role instance is available and active.

  • false – role instance is unavailable.

banned

List of blocked IP addresses. Each address in the list is represented by an object with fields:

  • ip – IPV4-address.

  • expires – is the remaining time of the blocking interval in seconds.

Response example
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

[
  {
    "node": "site1_h11@192.168.0.12",
    "online": true,
    "banned": [
      {
        "ip": "212.54.68.68",
        "expires": 526
      },
      {
        "ip": "187.13.93.27",
        "expires": 277
      }
    ]
  },
  {
    "node": "site1_h1@192.168.0.15",
    "online": true,
    "banned": [
      {
        "ip": "212.54.68.68",
        "expires": 526
      }
    ]
  }
]

Clearing lists of blocked addresses

Clears lists of blocked IP addresses of a role esg.

The query is parallelized and applied to all role instances of esg included in the scope specified by scope-parameters in the URL.

Request

URL may contain additional scope-parameters.

Request example
DELETE /rest/v1/master/logicalroles/esg/bannedaddrs HTTP/1.1

Response

Response example
HTTP/1.1 204 No Content

Remove an address from the list of blocked addresses

Removes the blocked IP address from the list of blocked IP addresses of the role esg.

The query is parallelized and applied to all role instances of esg included in the scope specified by scope-parameters in the URL.

Request

URL may contain additional scope-parameters.

Request example
DELETE /rest/v1/master/logicalroles/esg/bannedaddrs/212.54.68.68 HTTP/1.1

Response

Response example
HTTP/1.1 204 No Content