Network filter management esg (bannedaddrs)
Overview
Provides access to runtime data of the border network filter of all instances of the sg role.
Automatic IP address blocking occurs when repeated SIP requests with invalid authorization data are received from it within a limited time interval. Automatic blocking is performed on a specific instance of the sg role. Addresses added to the list via the API are placed in the banned address lists on all available instances of the sg role.
Displays all banned IP addresses and blocking time - both automatically blocked and added by the master domain administrator. It also allows working with the banned IP address list: add, delete, clear.
Requests
| HTTP verb | Endpoint | Description |
|---|---|---|
|
|
|
|
|
Getting the list of sg role instances and banned IP addresses |
|
|
|
|
|
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.
| Name | Type | Description |
|---|---|---|
|
|
Site name from the configuration. For example |
|
|
Comma-separated list of site names. For example |
|
|
Server alias. Can be an IP address, a number, or a full server name from the configuration. For example |
|
|
Comma-separated list of server aliases. For example |
Adding an IP address to the banned lists
Adds an arbitrary IP address to the banned IP address lists of the sg role.
The request is parallelized for execution on all instances of the sg role within the scope specified by URL parameters.
Request
The URL may contain additional scope parameters.
| Name | Type | Description |
|---|---|---|
|
|
IPv4 address to block. |
|
|
Time interval in seconds after which the address should be automatically removed. Each subsequent request for the specified address extends the auto-removal timer. |
POST /rest/v1/master/logicalroles/sg/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 sg role within the request scope. Each object contains the status and result of the request execution.
| Name | Description |
|---|---|
|
Name of the site hosting the current instance of the sg role. |
|
Name of the node running the current instance of the sg role. |
|
Server number from the configuration running the node with the current instance of the sg role |
|
Server address from the configuration running the node with the current instance of the sg role |
|
Activity/availability flag of the role instance from the web server serving the request.
|
|
For active and available instances, indicates the operation result.
|
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
[
{
"site": "SITE1",
"node": "sg111@192.168.0.111",
"srvidx": 11281,
"addr": "192.168.0.111",
"online": true,
"result": true
},
{
"site": "SITE1",
"node": "sg181@192.168.0.118",
"srvidx": 18281,
"addr": "192.168.0.110",
"online": true,
"result": true
}
]
Getting the list of sg role instances and banned IP addresses
Returns a list of representation objects of all instances of the sg 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
| Name | Type | Description |
|---|---|---|
|
|
Filter by field values. |
|
|
List of fields to output. Available fields for output: |
|
|
Offset in the list of resources to output. |
|
|
Maximum number of resources in the list. |
|
|
Sorting order of resources in the list. |
|
|
Transformation of composite fields to flat form. |
The URL may contain additional scope parameters.
GET /rest/v1/master/master/logicalroles/sg/bannedaddrs?mask=banned,node,online&offset=2&limit=2 HTTP/1.1
Response
Contains a list of objects, each representing a specific instance of the sg role within the request scope.
| Name | Description |
|---|---|
|
Name of the site hosting the current instance of the sg role. |
|
Name of the node running the current instance of the sg role. |
|
Server number from the configuration running the node with the current instance of the sg role |
|
Server address from the configuration running the node with the current instance of the sg role |
|
Activity/availability flag of the role instance from the web server serving the request.
|
|
List of banned IP addresses. Each address in the list is represented by an object with fields:
|
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
[
{
"site": "SITE1",
"node": "sg111@192.168.0.111",
"srvidx": 11281,
"addr": "192.168.0.111",
"online": true,
"banned": [
{
"ip": "212.54.68.68",
"expires": 526
},
{
"ip": "187.13.93.27",
"expires": 277
}
]
},
{
"site": "SITE1",
"node": "sg181@192.168.0.118",
"srvidx": 18281,
"addr": "192.168.0.118",
"online": true,
"banned": [
{
"ip": "212.54.68.68",
"expires": 526
}
]
}
]
Clearing banned address lists
Clears the banned IP address lists of the sg role.
The request is parallelized and applied to all instances of the sg roles within the scope specified by URL scope parameters.
Request
The URL may contain additional scope parameters.
DELETE /rest/v1/master/logicalroles/sg/bannedaddrs HTTP/1.1
Removing an address from the banned address list
Removes the banned IP address from the banned IP address list of the sg role.
The request is parallelized and applied to all instances of the sg roles within the scope specified by URL scope parameters.
Request
The URL may contain additional scope parameters.
DELETE /rest/v1/master/logicalroles/sg/bannedaddrs/212.54.68.68 HTTP/1.1