Firewall
List all firewalls
Request
Definition
GET /api/v1/settings/firewalls
Headers
-
Authorization
requiredAuthentication token with privileges to view the resource.
Bearer {token}
Query string parameters
Parameter | Type | Required | Descrizione |
---|---|---|---|
name | string | No | It retrieves firewalls whose name matches the entered string. |
Response
Status codes
Status code | Message |
---|---|
200 | "List of firewalls" |
403 | "Forbidden" |
Body
- Attributes
- Example
-
data.settings.firewalls.name
stringFirewall name.
-
data.settings.firewalls.description
stringFirewall description.
-
data.settings.firewalls.settings.enabled_as_waf
booleanIndicates whether the firewall is enabled as a WAF (varies by type).
-
data.settings.firewalls.settings.enabled_as_fw
booleanIndicates whether the firewall is enabled as a network firewall (varies by type).
-
data.settings.firewalls.type
stringFirewall type.
{
"data": {
"firewalls": [
{
"description": "",
"name": "waf_test",
"settings": {
"enabled_as_waf": true
},
"type": "modsecurity_feed"
},
{
"description": "",
"name": "fw_test",
"settings": {
"enabled_as_fw": true
},
"type": "generic_blacklist_feed"
}
]
},
"message": "List of firewalls",
"status": "ok"
}
List a specific firewall
Request
Definition
GET /api/v1/settings/firewalls/{nome_firewall}
Headers
-
Authorization
requiredAuthentication token with privileges to view the resource.
Bearer {token}
Response
Status codes
Status code | Message |
---|---|
200 | "Firewall retrieved" |
400 | "Error retrieving firewall" |
403 | "Forbidden" |
Body
{
"data": {
"firewall": {
"description": "new description",
"name": "fw_test",
"settings": {
"enabled_as_fw": true
},
"type": "generic_blacklist_feed"
}
},
"message": "Firewall retrieved",
"status": "ok"
}
Create a Oplon firewall
Request
Definition
POST /api/v1/settings/firewalls
Headers
-
Authorization
requiredAuthentication token with privileges to view the resource.
Bearer {token}
-
Content-Type
requiredapplication/json
Request body
{
"firewall": {
"description": "test description oplon",
"name": "new_name",
"settings": {
"address": "10.2.3.4",
"bl_api_path": "example/of/path",
"enabled_as_fw": false,
"enabled_as_waf": false,
"password": "password",
"port": 80,
"username": "user",
"waf_api_path": "example/of/path",
"wl_api_path": "example/of/path"
},
"type": "oplon_firewall"
}
}
Response
Status codes
Status code | Message |
---|---|
200 | "Firewall created" |
400 | "Error creating firewall" |
403 | "Forbidden" |
Body
{
"data": {
"firewall": {
"description": "test description oplon",
"name": "new_name",
"settings": {
"address": "10.2.3.4",
"bl_api_path": "example/of/path",
"enabled_as_fw": false,
"enabled_as_waf": false,
"password": "password",
"port": 80,
"username": "user",
"waf_api_path": "example/of/path",
"wl_api_path": "example/of/path"
},
"type": "oplon_firewall"
}
},
"message": "Firewall created",
"status": "ok"
}
Update a firewall
Request
Definition
PUT /api/v1/settings/firewalls/{nome_firewall}
Headers
-
Authorization
requiredAuthentication token with privileges to view the resource.
Bearer {token}
-
Content-Type
requiredapplication/json
Request body
{
"attrs": {
"description": "new description"
}
}
Response
Status codes
Status code | Message |
---|---|
200 | "Firewall updated" |
400 | "Error updating firewall" |
403 | "Forbidden" |
Body
{
"data": {
"firewall": {
"description": "new description",
"name": "fw_test",
"settings": {
"enabled_as_fw": true
},
"type": "generic_blacklist_feed"
}
},
"message": "Firewall updated",
"status": "ok"
}
Delete a firewall
Request
Definition
DELETE /api/v1/settings/firewalls/{nome_firewall}
Headers
-
Authorization
requiredAuthentication token with privileges to view the resource.
Bearer {token}
-
Content-Type
requiredapplication/json
Request body
{
"attrs": {
"description": "new description"
}
}
Response
Status codes
Status code | Message |
---|---|
200 | "Firewall deleted" |
400 | "Error deleting firewall" |
403 | "Forbidden" |
Corpo
{
"data": {
"firewall": {
"description": "test description oplon",
"name": "new_name",
"settings": {
"address": "10.2.3.4",
"bl_api_path": "example/of/path",
"enabled_as_fw": false,
"enabled_as_waf": false,
"password": "password",
"port": 80,
"username": "user",
"waf_api_path": "example/of/path",
"wl_api_path": "example/of/path"
},
"type": "oplon_firewall"
}
},
"message": "Firewall deleted",
"status": "ok"
}