Network filter management of the current ws instance (bannedaddrs)

Overview

Provides access to runtime data of the border network filter of all instances of the ws role.

Automatic IP address blocking occurs when repeated HTTP-, HTTPS-, WS-, WSS- requests with invalid authorization data are received from it within a limited time interval. Automatic blocking is performed on a specific instance of the ws role. Addresses added to the list via the API are placed in the banned address lists on all available instances of the ws role.

Displays all automatically blocked IP addresses and blocking time. It also allows deleting banned IP addresses: one by one or all at once.

Addresses from which more than 5 unauthorized requests with different credentials arrived in the last 3 minutes are blocked. When activity stops, unblocking is performed after 3-5 minutes.

Data is provided from the current WS microservice instance handling the API request. For operations on all instances use the endpoint 'master/logicalroles/ws/bannedaddrs/site'

Requests

HTTP verb Endpoint Description

POST

/rest/v1/master/logicalroles/ws/bannedaddrs

Adding an IP address to the banned IP address list of the current web server instance

GET

/rest/v1/master/logicalroles/ws/bannedaddrs

Getting the list of banned IP addresses from the current web server instance

DELETE

/rest/v1/master/logicalroles/ws/bannedaddrs

Clearing banned address lists on the current web server instance

DELETE

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

Removing an address from the banned address list on the current web server instance

Common request scope parameters

The parameters below are used in the URL (?param=value) to limit the request application scope (the set of role instances to which the request applies). All are optional and may be absent. It makes sense to specify no more than one of them, or none at all.

Table 1. Possible parameters
Name Type Description

site

str

Site name from the configuration.

For example SITE8.

sites

array<str>

Comma-separated list of site names.

For example SITE1,SITE3.

server

str

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

For example 192.168.0.12 or 372.

servers

array<str>

Comma-separated list of server aliases.

For example 192.168.0.12,372,server05.


Adding an IP address to the banned IP address list of the current web server instance

Adds an arbitrary IP address to the banned IP address lists of the ws role.

The request is parallelized for execution on all instances of the ws role within the scope specified by URL parameters.

Request

The URL may contain additional scope parameters.

Table 2. Object fields
Name Type Description

ip

str

IPv4 address to block.

expires

int

Time interval in seconds after which the address should be automatically removed.

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

Example request
POST /rest/v1/master/logicalroles/ws/bannedaddrs HTTP/1.1
Content-Type: application/json; charset=utf-8

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

Response

Contains a list of representation objects of all instances of the ws role within the request scope. Each object contains the status and result of the request execution.

Table 3. Object fields
Name Description

site

Name of the site hosting the current instance of the ws role.

node

Name of the node running the current instance of the ws role.

srvidx

Server number from the configuration running the node with the current instance of the ws role

addr

Server address from the configuration running the node with the current instance of the ws role

online

Activity/availability flag of the role instance from the web server serving the request.

  • true – the role instance is available and active.

  • false – the role instance is unavailable.

result

For active and available instances, indicates the operation result.

  • true – the IP address was successfully saved to the banned IP address list of the current role instance.

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

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

[
  {
    "site": "SITE1",
    "node": "ws111@192.168.0.112",
    "srvidx": 11231,
    "addr": "212.54.68.68",
    "online": true,
    "result": true
  }
]

Getting the list of banned IP addresses from the current web server instance

Returns a list of representation objects of all instances of the ws role within the request scope specified by URL scope parameters.

Each object contains the role instance status and the list of banned 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 output.

limit

int

Maximum number of resources in the list.

order

array<object|str>

Sorting order of resources in the list.

flat

bool

Transformation of composite fields to flat form.

The URL may contain additional scope parameters.

Example request
GET /rest/v1/master/master/logicalroles/ws/bannedaddrs?site=SITE1&mask=banned,node,online&offset=2&limit=2 HTTP/1.1

Response

Contains a list of objects, each representing a specific instance of the ws role within the request scope.

Table 5. Object fields
Name Description

site

Name of the site hosting the current instance of the ws role.

node

Name of the node running the current instance of the ws role.

srvidx

Server number from the configuration running the node with the current instance of the ws role

addr

Server address from the configuration running the node with the current instance of the ws role

online

Activity/availability flag of the role instance from the web server serving the request.

  • true – the role instance is available and active.

  • false – the role instance is unavailable.

banned

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

  • ip – IPv4 address.

  • expires – remaining blocking interval time in seconds.

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

[
  {
    "site": "SITE1",
    "node": "ws111@192.168.0.111",
    "srvidx": 11231,
    "addr": "212.54.68.68",
    "online": true,
    "banned": [
      {
        "ip": "212.54.68.68",
        "expires": 526
      },
      {
        "ip": "187.13.93.27",
        "expires": 277
      }
    ]
  }
]

Clearing banned address lists on the current web server instance

Clears the banned IP address lists of the ws role.

The request is parallelized and applied to all instances of the ws roles within the scope specified by URL scope parameters.

Request

The URL may contain additional scope parameters.

Example request
DELETE /rest/v1/master/logicalroles/ws/bannedaddrs HTTP/1.1

Response

Example response
HTTP/1.1 204 No Content

Removing an address from the banned address list on the current web server instance

Removes the banned IP address from the banned IP address list of the ws role.

The request is parallelized and applied to all instances of the ws roles within the scope specified by URL scope parameters.

Request

The URL may contain additional scope parameters.

Example request
DELETE /rest/v1/master/logicalroles/ws/bannedaddrs/212.54.68.68 HTTP/1.1

Response

Example response
HTTP/1.1 204 No Content