Endurance

Firewall

NFTables

GET /nftables

Get the SSH brute-force protection configuration

curl
curl -X GET "https://appliance.example.com/api/v1/nftables" \
  -H "Authorization: Bearer $TOKEN"
PHP
<?php

$url = 'https://appliance.example.com/api/v1/nftables';
$headers = [
    'Authorization: Bearer ' . $token,
];

$ch = curl_init($url);
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_HTTPHEADER => $headers,
    CURLOPT_RETURNTRANSFER => true,
]);

$response = json_decode(curl_exec($ch), true);
curl_close($ch);
Python
import requests

headers = {"Authorization": f"Bearer {token}"}

response = requests.get("https://appliance.example.com/api/v1/nftables", headers=headers)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/nftables', {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${token}`,
  },
});

const data = await response.json();
Response
{
  "status": "success",
  "message": "NFTables Configuration",
  "data": {
    "sshBruteForceEnabled": true,
    "sshConnectionPerMin": 10,
    "sshConnectionTimeout": 5
  }
}

PUT /nftables

Update the SSH brute-force protection configuration

This change is staged. Send PUT /services/apply to apply it.

Body parameters
sshBruteForceEnabled boolean

Enable or disable SSH brute-force protection

sshConnectionPerMin integer

New SSH connections per minute before an address is denylisted (min 1)

sshConnectionTimeout integer

Denylist duration in minutes (min 1)

curl
curl -X PUT "https://appliance.example.com/api/v1/nftables" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "sshBruteForceEnabled": true,
  "sshConnectionPerMin": 0,
  "sshConnectionTimeout": 0
}'
PHP
<?php

$url = 'https://appliance.example.com/api/v1/nftables';
$headers = [
    'Authorization: Bearer ' . $token,
    'Content-Type: application/json',
];

$payload = [
    'sshBruteForceEnabled' => true,
    'sshConnectionPerMin' => 0,
    'sshConnectionTimeout' => 0,
];

$ch = curl_init($url);
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'PUT',
    CURLOPT_HTTPHEADER => $headers,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POSTFIELDS => json_encode($payload),
]);

$response = json_decode(curl_exec($ch), true);
curl_close($ch);
Python
import requests

headers = {"Authorization": f"Bearer {token}"}
payload = {
    "sshBruteForceEnabled": true,
    "sshConnectionPerMin": 0,
    "sshConnectionTimeout": 0
}

response = requests.put("https://appliance.example.com/api/v1/nftables", headers=headers, json=payload)
response.raise_for_status()
print(response.json())
JavaScript
const response = await fetch('https://appliance.example.com/api/v1/nftables', {
  method: 'PUT',
  headers: {
    Authorization: `Bearer ${token}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
  "sshBruteForceEnabled": true,
  "sshConnectionPerMin": 0,
  "sshConnectionTimeout": 0
}),
});

const data = await response.json();
Response
{
  "status": "success",
  "message": "NFTables has been updated Successfully"
}