curl --request POST \
--url https://api.ck-itsolutions.nl/v1/firewall/rule \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"dst": "<string>",
"protocol": "<string>",
"action": "<string>",
"priority": 123,
"descr": "<string>",
"src": {
"start": "<string>",
"end": "<string>"
},
"port": {
"src": {
"start": 123,
"end": 123
},
"dst": {
"start": 123,
"end": 123
}
},
"disabled": true,
"tcpflags": "<array>",
"ratelimit": 123,
"packetlength": 123,
"packettype": 123,
"statetype": "<string>"
}
'import requests
url = "https://api.ck-itsolutions.nl/v1/firewall/rule"
payload = {
"dst": "<string>",
"protocol": "<string>",
"action": "<string>",
"priority": 123,
"descr": "<string>",
"src": {
"start": "<string>",
"end": "<string>"
},
"port": {
"src": {
"start": 123,
"end": 123
},
"dst": {
"start": 123,
"end": 123
}
},
"disabled": True,
"tcpflags": "<array>",
"ratelimit": 123,
"packetlength": 123,
"packettype": 123,
"statetype": "<string>"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
dst: '<string>',
protocol: '<string>',
action: '<string>',
priority: 123,
descr: '<string>',
src: {start: '<string>', end: '<string>'},
port: {src: {start: 123, end: 123}, dst: {start: 123, end: 123}},
disabled: true,
tcpflags: '<array>',
ratelimit: 123,
packetlength: 123,
packettype: 123,
statetype: '<string>'
})
};
fetch('https://api.ck-itsolutions.nl/v1/firewall/rule', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ck-itsolutions.nl/v1/firewall/rule",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'dst' => '<string>',
'protocol' => '<string>',
'action' => '<string>',
'priority' => 123,
'descr' => '<string>',
'src' => [
'start' => '<string>',
'end' => '<string>'
],
'port' => [
'src' => [
'start' => 123,
'end' => 123
],
'dst' => [
'start' => 123,
'end' => 123
]
],
'disabled' => true,
'tcpflags' => '<array>',
'ratelimit' => 123,
'packetlength' => 123,
'packettype' => 123,
'statetype' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.ck-itsolutions.nl/v1/firewall/rule"
payload := strings.NewReader("{\n \"dst\": \"<string>\",\n \"protocol\": \"<string>\",\n \"action\": \"<string>\",\n \"priority\": 123,\n \"descr\": \"<string>\",\n \"src\": {\n \"start\": \"<string>\",\n \"end\": \"<string>\"\n },\n \"port\": {\n \"src\": {\n \"start\": 123,\n \"end\": 123\n },\n \"dst\": {\n \"start\": 123,\n \"end\": 123\n }\n },\n \"disabled\": true,\n \"tcpflags\": \"<array>\",\n \"ratelimit\": 123,\n \"packetlength\": 123,\n \"packettype\": 123,\n \"statetype\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.ck-itsolutions.nl/v1/firewall/rule")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"dst\": \"<string>\",\n \"protocol\": \"<string>\",\n \"action\": \"<string>\",\n \"priority\": 123,\n \"descr\": \"<string>\",\n \"src\": {\n \"start\": \"<string>\",\n \"end\": \"<string>\"\n },\n \"port\": {\n \"src\": {\n \"start\": 123,\n \"end\": 123\n },\n \"dst\": {\n \"start\": 123,\n \"end\": 123\n }\n },\n \"disabled\": true,\n \"tcpflags\": \"<array>\",\n \"ratelimit\": 123,\n \"packetlength\": 123,\n \"packettype\": 123,\n \"statetype\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ck-itsolutions.nl/v1/firewall/rule")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"dst\": \"<string>\",\n \"protocol\": \"<string>\",\n \"action\": \"<string>\",\n \"priority\": 123,\n \"descr\": \"<string>\",\n \"src\": {\n \"start\": \"<string>\",\n \"end\": \"<string>\"\n },\n \"port\": {\n \"src\": {\n \"start\": 123,\n \"end\": 123\n },\n \"dst\": {\n \"start\": 123,\n \"end\": 123\n }\n },\n \"disabled\": true,\n \"tcpflags\": \"<array>\",\n \"ratelimit\": 123,\n \"packetlength\": 123,\n \"packettype\": 123,\n \"statetype\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{}{
"message": "<string>"
}Create Firewall Rule
Creates a new firewall rule
curl --request POST \
--url https://api.ck-itsolutions.nl/v1/firewall/rule \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"dst": "<string>",
"protocol": "<string>",
"action": "<string>",
"priority": 123,
"descr": "<string>",
"src": {
"start": "<string>",
"end": "<string>"
},
"port": {
"src": {
"start": 123,
"end": 123
},
"dst": {
"start": 123,
"end": 123
}
},
"disabled": true,
"tcpflags": "<array>",
"ratelimit": 123,
"packetlength": 123,
"packettype": 123,
"statetype": "<string>"
}
'import requests
url = "https://api.ck-itsolutions.nl/v1/firewall/rule"
payload = {
"dst": "<string>",
"protocol": "<string>",
"action": "<string>",
"priority": 123,
"descr": "<string>",
"src": {
"start": "<string>",
"end": "<string>"
},
"port": {
"src": {
"start": 123,
"end": 123
},
"dst": {
"start": 123,
"end": 123
}
},
"disabled": True,
"tcpflags": "<array>",
"ratelimit": 123,
"packetlength": 123,
"packettype": 123,
"statetype": "<string>"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
dst: '<string>',
protocol: '<string>',
action: '<string>',
priority: 123,
descr: '<string>',
src: {start: '<string>', end: '<string>'},
port: {src: {start: 123, end: 123}, dst: {start: 123, end: 123}},
disabled: true,
tcpflags: '<array>',
ratelimit: 123,
packetlength: 123,
packettype: 123,
statetype: '<string>'
})
};
fetch('https://api.ck-itsolutions.nl/v1/firewall/rule', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ck-itsolutions.nl/v1/firewall/rule",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'dst' => '<string>',
'protocol' => '<string>',
'action' => '<string>',
'priority' => 123,
'descr' => '<string>',
'src' => [
'start' => '<string>',
'end' => '<string>'
],
'port' => [
'src' => [
'start' => 123,
'end' => 123
],
'dst' => [
'start' => 123,
'end' => 123
]
],
'disabled' => true,
'tcpflags' => '<array>',
'ratelimit' => 123,
'packetlength' => 123,
'packettype' => 123,
'statetype' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.ck-itsolutions.nl/v1/firewall/rule"
payload := strings.NewReader("{\n \"dst\": \"<string>\",\n \"protocol\": \"<string>\",\n \"action\": \"<string>\",\n \"priority\": 123,\n \"descr\": \"<string>\",\n \"src\": {\n \"start\": \"<string>\",\n \"end\": \"<string>\"\n },\n \"port\": {\n \"src\": {\n \"start\": 123,\n \"end\": 123\n },\n \"dst\": {\n \"start\": 123,\n \"end\": 123\n }\n },\n \"disabled\": true,\n \"tcpflags\": \"<array>\",\n \"ratelimit\": 123,\n \"packetlength\": 123,\n \"packettype\": 123,\n \"statetype\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.ck-itsolutions.nl/v1/firewall/rule")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"dst\": \"<string>\",\n \"protocol\": \"<string>\",\n \"action\": \"<string>\",\n \"priority\": 123,\n \"descr\": \"<string>\",\n \"src\": {\n \"start\": \"<string>\",\n \"end\": \"<string>\"\n },\n \"port\": {\n \"src\": {\n \"start\": 123,\n \"end\": 123\n },\n \"dst\": {\n \"start\": 123,\n \"end\": 123\n }\n },\n \"disabled\": true,\n \"tcpflags\": \"<array>\",\n \"ratelimit\": 123,\n \"packetlength\": 123,\n \"packettype\": 123,\n \"statetype\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ck-itsolutions.nl/v1/firewall/rule")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"dst\": \"<string>\",\n \"protocol\": \"<string>\",\n \"action\": \"<string>\",\n \"priority\": 123,\n \"descr\": \"<string>\",\n \"src\": {\n \"start\": \"<string>\",\n \"end\": \"<string>\"\n },\n \"port\": {\n \"src\": {\n \"start\": 123,\n \"end\": 123\n },\n \"dst\": {\n \"start\": 123,\n \"end\": 123\n }\n },\n \"disabled\": true,\n \"tcpflags\": \"<array>\",\n \"ratelimit\": 123,\n \"packetlength\": 123,\n \"packettype\": 123,\n \"statetype\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{}{
"message": "<string>"
}Authorizations
Body
Plant to add to the store
Destination IP the firewall rule needs to be created for (subnets supported).
Internet Protocol version this rule applies to. Allowed options: any, ip, hopopt, icmp, igmp, ggp, ipencap, st, tcp, egp, igp, pup, udp, hmp, xns-idp, rdp, iso-tp4, dccp, xtp, ddp, idpr-cmtp, ipv6, ipv6-route, ipv6-frag, idrp, rsvp, gre, esp, ah, skip, ipv6-icmp, ipv6-nonxt, ipv6-opts, rspf, vmtp, eigrp, ospf, ax.25, ipip, etherip, encap, pim, ipcomp, vrrp, l2tp, isis, sctp, fc, mobility-header, udplite, mpls-in-ip, manet, hip, shim6, wesp, rohc, ethernet, mptcp
Allowed options: accept, continue, drop and reject
Rule priority with 1 being highest priority.
Description of the firewall rule.
Source IP the firewall rule needs to match.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Enable or disable the firewall rule.
TCP flags the rule must match to. Allowed options: fin, syn, rst, psh, ack, urg, ece, cwr
Ratelimit 0 - 4294967295.
Packet length 1 - 65535.
Allowed options: broadcast, host, multicast, other
Allowed options: established, invalid, new, related.
Response
Returns newly created firewall rule with uuid as json.
The response is of type object.