export const title = 'Posture Checks' ## List all Posture Checks {{ tag: 'GET' , label: '/api/posture-checks' }} Returns a list of all posture checks ```bash {{ title: 'cURL' }} curl -X GET https://api.netbird.io/api/posture-checks \ -H 'Accept: application/json' \ -H 'Authorization: Token ' ``` ```js const axios = require('axios'); let config = { method: 'get', maxBodyLength: Infinity, url: '/api/posture-checks', headers: { 'Accept': 'application/json', 'Authorization': 'Token ' } }; axios(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python import requests import json url = "https://api.netbird.io/api/posture-checks" headers = { 'Accept': 'application/json', 'Authorization': 'Token ' } response = requests.request("GET", url, headers=headers) print(response.text) ``` ```go package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://api.netbird.io/api/posture-checks" method := "GET" client := &http.Client { } req, err := http.NewRequest(method, url, nil) if err != nil { fmt.Println(err) return } req.Header.Add("Accept", "application/json") req.Header.Add("Authorization", "Token ") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := ioutil.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```ruby require "uri" require "json" require "net/http" url = URI("https://api.netbird.io/api/posture-checks") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Get.new(url) request["Accept"] = "application/json" request["Authorization"] = "Token " response = https.request(request) puts response.read_body ``` ```java OkHttpClient client = new OkHttpClient().newBuilder() .build(); Request request = new Request.Builder() .url("https://api.netbird.io/api/posture-checks") .method("GET") .addHeader("Accept", "application/json") .addHeader("Authorization: Token ") .build(); Response response = client.newCall(request).execute(); ``` ```php 'https://api.netbird.io/api/posture-checks', CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => '', CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => 'GET', CURLOPT_HTTPHEADER => array( 'Accept: application/json', 'Authorization: Token ' ), )); $response = curl_exec($curl); curl_close($curl); echo $response; ``` ```json {{ title: 'Example' }} [ { "id": "ch8i4ug6lnn4g9hqv7mg", "name": "Default", "description": "This checks if the peer is running required NetBird's version", "checks": { "nb_version_check": { "min_version": "14.3" }, "os_version_check": { "android": { "min_version": "13" }, "ios": { "min_version": "17.3.1" }, "darwin": { "min_version": "14.2.1" }, "linux": { "min_kernel_version": "5.3.3" }, "windows": { "min_kernel_version": "10.0.1234" } }, "geo_location_check": { "locations": [ { "country_code": "DE", "city_name": "Berlin" } ], "action": "allow" }, "peer_network_range_check": { "ranges": [ "192.168.1.0/24", "10.0.0.0/8", "1.0.0.0/24", "2.2.2.2/32", "2001:db8:1234:1a00::/56" ], "action": "allow" }, "process_check": { "processes": [ { "linux_path": "/usr/local/bin/netbird", "mac_path": "/Applications/NetBird.app/Contents/MacOS/netbird", "windows_path": "C:
rogramData…etBird\netbird.exe" } ] } } } ] ``` ```json {{ title: 'Schema' }} [ { "id": "string", "name": "string", "description": "string", "checks": { "nb_version_check": { "min_version": "string" }, "os_version_check": { "android": { "min_version": "13" }, "ios": { "min_version": "17.3.1" }, "darwin": { "min_version": "14.2.1" }, "linux": { "min_kernel_version": "5.3.3" }, "windows": { "min_kernel_version": "10.0.1234" } }, "geo_location_check": { "locations": [ { "country_code": "string", "city_name": "string" } ], "action": "string" }, "peer_network_range_check": { "ranges": [ "string" ], "action": "string" }, "process_check": { "processes": [ { "linux_path": "string", "mac_path": "string", "windows_path": "string" } ] } } } ] ``` --- ## Create a Posture Check {{ tag: 'POST' , label: '/api/posture-checks' }} Creates a posture check ### Request-Body Parameters Posture check name identifier Posture check friendly description
List of objects that perform the actual checks
Posture check for the version of operating system Minimum acceptable version
Posture check for the version of operating system
Posture check for the version of operating system Minimum acceptable version
Posture check for the version of operating system Minimum acceptable version
Posture check for the version of operating system Minimum acceptable version
Posture check with the kernel version Minimum acceptable version
Posture check with the kernel version Minimum acceptable version
Posture check for geo location
List of geo locations to which the policy applies 2-letter ISO 3166-1 alpha-2 code that represents the country Commonly used English name of the city
Action to take upon policy match
Posture check for allow or deny access based on the peer's IP addresses. A range matches when it contains any of the peer's local network interface IPs or its public connection (NAT egress) IP, so ranges may target private subnets, public CIDRs, or single hosts via a /32 or /128. List of network ranges in CIDR notation, matched against the peer's local interface IPs and its public connection IP Action to take upon policy match
Posture Check for binaries exist and are running in the peer’s system
More Information Path to the process executable file in a Linux operating system Path to the process executable file in a Mac operating system Path to the process executable file in a Windows operating system
```bash {{ title: 'cURL' }} curl -X POST https://api.netbird.io/api/posture-checks \ -H 'Accept: application/json' \ -H 'Content-Type: application/json' \ -H 'Authorization: Token ' \ --data-raw '{ "name": "Default", "description": "This checks if the peer is running required NetBird's version", "checks": { "nb_version_check": { "min_version": "14.3" }, "os_version_check": { "android": { "min_version": "13" }, "ios": { "min_version": "17.3.1" }, "darwin": { "min_version": "14.2.1" }, "linux": { "min_kernel_version": "5.3.3" }, "windows": { "min_kernel_version": "10.0.1234" } }, "geo_location_check": { "locations": [ { "country_code": "DE", "city_name": "Berlin" } ], "action": "allow" }, "peer_network_range_check": { "ranges": [ "192.168.1.0/24", "10.0.0.0/8", "1.0.0.0/24", "2.2.2.2/32", "2001:db8:1234:1a00::/56" ], "action": "allow" }, "process_check": { "processes": [ { "linux_path": "/usr/local/bin/netbird", "mac_path": "/Applications/NetBird.app/Contents/MacOS/netbird", "windows_path": "C:
rogramData…etBird\netbird.exe" } ] } } }' ``` ```js const axios = require('axios'); let data = JSON.stringify({ "name": "Default", "description": "This checks if the peer is running required NetBird's version", "checks": { "nb_version_check": { "min_version": "14.3" }, "os_version_check": { "android": { "min_version": "13" }, "ios": { "min_version": "17.3.1" }, "darwin": { "min_version": "14.2.1" }, "linux": { "min_kernel_version": "5.3.3" }, "windows": { "min_kernel_version": "10.0.1234" } }, "geo_location_check": { "locations": [ { "country_code": "DE", "city_name": "Berlin" } ], "action": "allow" }, "peer_network_range_check": { "ranges": [ "192.168.1.0/24", "10.0.0.0/8", "1.0.0.0/24", "2.2.2.2/32", "2001:db8:1234:1a00::/56" ], "action": "allow" }, "process_check": { "processes": [ { "linux_path": "/usr/local/bin/netbird", "mac_path": "/Applications/NetBird.app/Contents/MacOS/netbird", "windows_path": "C:
rogramData…etBird\netbird.exe" } ] } } }); let config = { method: 'post', maxBodyLength: Infinity, url: '/api/posture-checks', headers: { 'Accept': 'application/json', 'Content-Type': 'application/json', 'Authorization': 'Token ' }, data : data }; axios(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python import requests import json url = "https://api.netbird.io/api/posture-checks" payload = json.dumps({ "name": "Default", "description": "This checks if the peer is running required NetBird's version", "checks": { "nb_version_check": { "min_version": "14.3" }, "os_version_check": { "android": { "min_version": "13" }, "ios": { "min_version": "17.3.1" }, "darwin": { "min_version": "14.2.1" }, "linux": { "min_kernel_version": "5.3.3" }, "windows": { "min_kernel_version": "10.0.1234" } }, "geo_location_check": { "locations": [ { "country_code": "DE", "city_name": "Berlin" } ], "action": "allow" }, "peer_network_range_check": { "ranges": [ "192.168.1.0/24", "10.0.0.0/8", "1.0.0.0/24", "2.2.2.2/32", "2001:db8:1234:1a00::/56" ], "action": "allow" }, "process_check": { "processes": [ { "linux_path": "/usr/local/bin/netbird", "mac_path": "/Applications/NetBird.app/Contents/MacOS/netbird", "windows_path": "C:
rogramData…etBird\netbird.exe" } ] } } }) headers = { 'Content-Type': 'application/json', 'Accept': 'application/json', 'Authorization': 'Token ' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```go package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://api.netbird.io/api/posture-checks" method := "POST" payload := strings.NewReader(`{ "name": "Default", "description": "This checks if the peer is running required NetBird's version", "checks": { "nb_version_check": { "min_version": "14.3" }, "os_version_check": { "android": { "min_version": "13" }, "ios": { "min_version": "17.3.1" }, "darwin": { "min_version": "14.2.1" }, "linux": { "min_kernel_version": "5.3.3" }, "windows": { "min_kernel_version": "10.0.1234" } }, "geo_location_check": { "locations": [ { "country_code": "DE", "city_name": "Berlin" } ], "action": "allow" }, "peer_network_range_check": { "ranges": [ "192.168.1.0/24", "10.0.0.0/8", "1.0.0.0/24", "2.2.2.2/32", "2001:db8:1234:1a00::/56" ], "action": "allow" }, "process_check": { "processes": [ { "linux_path": "/usr/local/bin/netbird", "mac_path": "/Applications/NetBird.app/Contents/MacOS/netbird", "windows_path": "C:
rogramData…etBird\netbird.exe" } ] } } }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Content-Type", "application/json") req.Header.Add("Accept", "application/json") req.Header.Add("Authorization", "Token ") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := ioutil.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```ruby require "uri" require "json" require "net/http" url = URI("https://api.netbird.io/api/posture-checks") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Post.new(url) request["Content-Type"] = "application/json" request["Accept"] = "application/json" request["Authorization"] = "Token " request.body = JSON.dump({ "name": "Default", "description": "This checks if the peer is running required NetBird's version", "checks": { "nb_version_check": { "min_version": "14.3" }, "os_version_check": { "android": { "min_version": "13" }, "ios": { "min_version": "17.3.1" }, "darwin": { "min_version": "14.2.1" }, "linux": { "min_kernel_version": "5.3.3" }, "windows": { "min_kernel_version": "10.0.1234" } }, "geo_location_check": { "locations": [ { "country_code": "DE", "city_name": "Berlin" } ], "action": "allow" }, "peer_network_range_check": { "ranges": [ "192.168.1.0/24", "10.0.0.0/8", "1.0.0.0/24", "2.2.2.2/32", "2001:db8:1234:1a00::/56" ], "action": "allow" }, "process_check": { "processes": [ { "linux_path": "/usr/local/bin/netbird", "mac_path": "/Applications/NetBird.app/Contents/MacOS/netbird", "windows_path": "C:
rogramData…etBird\netbird.exe" } ] } } }) response = https.request(request) puts response.read_body ``` ```java OkHttpClient client = new OkHttpClient().newBuilder() .build(); MediaType mediaType = MediaType.parse("application/json"); RequestBody body = RequestBody.create(mediaType, '{ "name": "Default", "description": "This checks if the peer is running required NetBird's version", "checks": { "nb_version_check": { "min_version": "14.3" }, "os_version_check": { "android": { "min_version": "13" }, "ios": { "min_version": "17.3.1" }, "darwin": { "min_version": "14.2.1" }, "linux": { "min_kernel_version": "5.3.3" }, "windows": { "min_kernel_version": "10.0.1234" } }, "geo_location_check": { "locations": [ { "country_code": "DE", "city_name": "Berlin" } ], "action": "allow" }, "peer_network_range_check": { "ranges": [ "192.168.1.0/24", "10.0.0.0/8", "1.0.0.0/24", "2.2.2.2/32", "2001:db8:1234:1a00::/56" ], "action": "allow" }, "process_check": { "processes": [ { "linux_path": "/usr/local/bin/netbird", "mac_path": "/Applications/NetBird.app/Contents/MacOS/netbird", "windows_path": "C:
rogramData…etBird\netbird.exe" } ] } } }'); Request request = new Request.Builder() .url("https://api.netbird.io/api/posture-checks") .method("POST", body) .addHeader("Content-Type", "application/json") .addHeader("Accept", "application/json") .addHeader("Authorization: Token ") .build(); Response response = client.newCall(request).execute(); ``` ```php 'https://api.netbird.io/api/posture-checks', CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => '', CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_POSTFIELDS => '{ "name": "Default", "description": "This checks if the peer is running required NetBird's version", "checks": { "nb_version_check": { "min_version": "14.3" }, "os_version_check": { "android": { "min_version": "13" }, "ios": { "min_version": "17.3.1" }, "darwin": { "min_version": "14.2.1" }, "linux": { "min_kernel_version": "5.3.3" }, "windows": { "min_kernel_version": "10.0.1234" } }, "geo_location_check": { "locations": [ { "country_code": "DE", "city_name": "Berlin" } ], "action": "allow" }, "peer_network_range_check": { "ranges": [ "192.168.1.0/24", "10.0.0.0/8", "1.0.0.0/24", "2.2.2.2/32", "2001:db8:1234:1a00::/56" ], "action": "allow" }, "process_check": { "processes": [ { "linux_path": "/usr/local/bin/netbird", "mac_path": "/Applications/NetBird.app/Contents/MacOS/netbird", "windows_path": "C:
rogramData…etBird\netbird.exe" } ] } } }', CURLOPT_HTTPHEADER => array( 'Content-Type: application/json', 'Accept: application/json', 'Authorization: Token ' ), )); $response = curl_exec($curl); curl_close($curl); echo $response; ``` ```json {{ title: 'Example' }} { "id": "ch8i4ug6lnn4g9hqv7mg", "name": "Default", "description": "This checks if the peer is running required NetBird's version", "checks": { "nb_version_check": { "min_version": "14.3" }, "os_version_check": { "android": { "min_version": "13" }, "ios": { "min_version": "17.3.1" }, "darwin": { "min_version": "14.2.1" }, "linux": { "min_kernel_version": "5.3.3" }, "windows": { "min_kernel_version": "10.0.1234" } }, "geo_location_check": { "locations": [ { "country_code": "DE", "city_name": "Berlin" } ], "action": "allow" }, "peer_network_range_check": { "ranges": [ "192.168.1.0/24", "10.0.0.0/8", "1.0.0.0/24", "2.2.2.2/32", "2001:db8:1234:1a00::/56" ], "action": "allow" }, "process_check": { "processes": [ { "linux_path": "/usr/local/bin/netbird", "mac_path": "/Applications/NetBird.app/Contents/MacOS/netbird", "windows_path": "C:
rogramData…etBird\netbird.exe" } ] } } } ``` ```json {{ title: 'Schema' }} { "id": "string", "name": "string", "description": "string", "checks": { "nb_version_check": { "min_version": "string" }, "os_version_check": { "android": { "min_version": "13" }, "ios": { "min_version": "17.3.1" }, "darwin": { "min_version": "14.2.1" }, "linux": { "min_kernel_version": "5.3.3" }, "windows": { "min_kernel_version": "10.0.1234" } }, "geo_location_check": { "locations": [ { "country_code": "string", "city_name": "string" } ], "action": "string" }, "peer_network_range_check": { "ranges": [ "string" ], "action": "string" }, "process_check": { "processes": [ { "linux_path": "string", "mac_path": "string", "windows_path": "string" } ] } } } ```
--- ## Retrieve a Posture Check {{ tag: 'GET' , label: '/api/posture-checks/{postureCheckId}' }} Get information about a posture check ### Path Parameters The unique identifier of a posture check ```bash {{ title: 'cURL' }} curl -X GET https://api.netbird.io/api/posture-checks/{postureCheckId} \ -H 'Accept: application/json' \ -H 'Authorization: Token ' ``` ```js const axios = require('axios'); let config = { method: 'get', maxBodyLength: Infinity, url: '/api/posture-checks/{postureCheckId}', headers: { 'Accept': 'application/json', 'Authorization': 'Token ' } }; axios(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python import requests import json url = "https://api.netbird.io/api/posture-checks/{postureCheckId}" headers = { 'Accept': 'application/json', 'Authorization': 'Token ' } response = requests.request("GET", url, headers=headers) print(response.text) ``` ```go package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://api.netbird.io/api/posture-checks/{postureCheckId}" method := "GET" client := &http.Client { } req, err := http.NewRequest(method, url, nil) if err != nil { fmt.Println(err) return } req.Header.Add("Accept", "application/json") req.Header.Add("Authorization", "Token ") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := ioutil.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```ruby require "uri" require "json" require "net/http" url = URI("https://api.netbird.io/api/posture-checks/{postureCheckId}") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Get.new(url) request["Accept"] = "application/json" request["Authorization"] = "Token " response = https.request(request) puts response.read_body ``` ```java OkHttpClient client = new OkHttpClient().newBuilder() .build(); Request request = new Request.Builder() .url("https://api.netbird.io/api/posture-checks/{postureCheckId}") .method("GET") .addHeader("Accept", "application/json") .addHeader("Authorization: Token ") .build(); Response response = client.newCall(request).execute(); ``` ```php 'https://api.netbird.io/api/posture-checks/{postureCheckId}', CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => '', CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => 'GET', CURLOPT_HTTPHEADER => array( 'Accept: application/json', 'Authorization: Token ' ), )); $response = curl_exec($curl); curl_close($curl); echo $response; ``` ```json {{ title: 'Example' }} { "id": "ch8i4ug6lnn4g9hqv7mg", "name": "Default", "description": "This checks if the peer is running required NetBird's version", "checks": { "nb_version_check": { "min_version": "14.3" }, "os_version_check": { "android": { "min_version": "13" }, "ios": { "min_version": "17.3.1" }, "darwin": { "min_version": "14.2.1" }, "linux": { "min_kernel_version": "5.3.3" }, "windows": { "min_kernel_version": "10.0.1234" } }, "geo_location_check": { "locations": [ { "country_code": "DE", "city_name": "Berlin" } ], "action": "allow" }, "peer_network_range_check": { "ranges": [ "192.168.1.0/24", "10.0.0.0/8", "1.0.0.0/24", "2.2.2.2/32", "2001:db8:1234:1a00::/56" ], "action": "allow" }, "process_check": { "processes": [ { "linux_path": "/usr/local/bin/netbird", "mac_path": "/Applications/NetBird.app/Contents/MacOS/netbird", "windows_path": "C:
rogramData…etBird\netbird.exe" } ] } } } ``` ```json {{ title: 'Schema' }} { "id": "string", "name": "string", "description": "string", "checks": { "nb_version_check": { "min_version": "string" }, "os_version_check": { "android": { "min_version": "13" }, "ios": { "min_version": "17.3.1" }, "darwin": { "min_version": "14.2.1" }, "linux": { "min_kernel_version": "5.3.3" }, "windows": { "min_kernel_version": "10.0.1234" } }, "geo_location_check": { "locations": [ { "country_code": "string", "city_name": "string" } ], "action": "string" }, "peer_network_range_check": { "ranges": [ "string" ], "action": "string" }, "process_check": { "processes": [ { "linux_path": "string", "mac_path": "string", "windows_path": "string" } ] } } } ``` --- ## Update a Posture Check {{ tag: 'PUT' , label: '/api/posture-checks/{postureCheckId}' }} Update/Replace a posture check ### Path Parameters The unique identifier of a posture check ### Request-Body Parameters Posture check name identifier Posture check friendly description
List of objects that perform the actual checks
Posture check for the version of operating system Minimum acceptable version
Posture check for the version of operating system
Posture check for the version of operating system Minimum acceptable version
Posture check for the version of operating system Minimum acceptable version
Posture check for the version of operating system Minimum acceptable version
Posture check with the kernel version Minimum acceptable version
Posture check with the kernel version Minimum acceptable version
Posture check for geo location
List of geo locations to which the policy applies 2-letter ISO 3166-1 alpha-2 code that represents the country Commonly used English name of the city
Action to take upon policy match
Posture check for allow or deny access based on the peer's IP addresses. A range matches when it contains any of the peer's local network interface IPs or its public connection (NAT egress) IP, so ranges may target private subnets, public CIDRs, or single hosts via a /32 or /128. List of network ranges in CIDR notation, matched against the peer's local interface IPs and its public connection IP Action to take upon policy match
Posture Check for binaries exist and are running in the peer’s system
More Information Path to the process executable file in a Linux operating system Path to the process executable file in a Mac operating system Path to the process executable file in a Windows operating system
```bash {{ title: 'cURL' }} curl -X PUT https://api.netbird.io/api/posture-checks/{postureCheckId} \ -H 'Accept: application/json' \ -H 'Content-Type: application/json' \ -H 'Authorization: Token ' \ --data-raw '{ "name": "Default", "description": "This checks if the peer is running required NetBird's version", "checks": { "nb_version_check": { "min_version": "14.3" }, "os_version_check": { "android": { "min_version": "13" }, "ios": { "min_version": "17.3.1" }, "darwin": { "min_version": "14.2.1" }, "linux": { "min_kernel_version": "5.3.3" }, "windows": { "min_kernel_version": "10.0.1234" } }, "geo_location_check": { "locations": [ { "country_code": "DE", "city_name": "Berlin" } ], "action": "allow" }, "peer_network_range_check": { "ranges": [ "192.168.1.0/24", "10.0.0.0/8", "1.0.0.0/24", "2.2.2.2/32", "2001:db8:1234:1a00::/56" ], "action": "allow" }, "process_check": { "processes": [ { "linux_path": "/usr/local/bin/netbird", "mac_path": "/Applications/NetBird.app/Contents/MacOS/netbird", "windows_path": "C:
rogramData…etBird\netbird.exe" } ] } } }' ``` ```js const axios = require('axios'); let data = JSON.stringify({ "name": "Default", "description": "This checks if the peer is running required NetBird's version", "checks": { "nb_version_check": { "min_version": "14.3" }, "os_version_check": { "android": { "min_version": "13" }, "ios": { "min_version": "17.3.1" }, "darwin": { "min_version": "14.2.1" }, "linux": { "min_kernel_version": "5.3.3" }, "windows": { "min_kernel_version": "10.0.1234" } }, "geo_location_check": { "locations": [ { "country_code": "DE", "city_name": "Berlin" } ], "action": "allow" }, "peer_network_range_check": { "ranges": [ "192.168.1.0/24", "10.0.0.0/8", "1.0.0.0/24", "2.2.2.2/32", "2001:db8:1234:1a00::/56" ], "action": "allow" }, "process_check": { "processes": [ { "linux_path": "/usr/local/bin/netbird", "mac_path": "/Applications/NetBird.app/Contents/MacOS/netbird", "windows_path": "C:
rogramData…etBird\netbird.exe" } ] } } }); let config = { method: 'put', maxBodyLength: Infinity, url: '/api/posture-checks/{postureCheckId}', headers: { 'Accept': 'application/json', 'Content-Type': 'application/json', 'Authorization': 'Token ' }, data : data }; axios(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python import requests import json url = "https://api.netbird.io/api/posture-checks/{postureCheckId}" payload = json.dumps({ "name": "Default", "description": "This checks if the peer is running required NetBird's version", "checks": { "nb_version_check": { "min_version": "14.3" }, "os_version_check": { "android": { "min_version": "13" }, "ios": { "min_version": "17.3.1" }, "darwin": { "min_version": "14.2.1" }, "linux": { "min_kernel_version": "5.3.3" }, "windows": { "min_kernel_version": "10.0.1234" } }, "geo_location_check": { "locations": [ { "country_code": "DE", "city_name": "Berlin" } ], "action": "allow" }, "peer_network_range_check": { "ranges": [ "192.168.1.0/24", "10.0.0.0/8", "1.0.0.0/24", "2.2.2.2/32", "2001:db8:1234:1a00::/56" ], "action": "allow" }, "process_check": { "processes": [ { "linux_path": "/usr/local/bin/netbird", "mac_path": "/Applications/NetBird.app/Contents/MacOS/netbird", "windows_path": "C:
rogramData…etBird\netbird.exe" } ] } } }) headers = { 'Content-Type': 'application/json', 'Accept': 'application/json', 'Authorization': 'Token ' } response = requests.request("PUT", url, headers=headers, data=payload) print(response.text) ``` ```go package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://api.netbird.io/api/posture-checks/{postureCheckId}" method := "PUT" payload := strings.NewReader(`{ "name": "Default", "description": "This checks if the peer is running required NetBird's version", "checks": { "nb_version_check": { "min_version": "14.3" }, "os_version_check": { "android": { "min_version": "13" }, "ios": { "min_version": "17.3.1" }, "darwin": { "min_version": "14.2.1" }, "linux": { "min_kernel_version": "5.3.3" }, "windows": { "min_kernel_version": "10.0.1234" } }, "geo_location_check": { "locations": [ { "country_code": "DE", "city_name": "Berlin" } ], "action": "allow" }, "peer_network_range_check": { "ranges": [ "192.168.1.0/24", "10.0.0.0/8", "1.0.0.0/24", "2.2.2.2/32", "2001:db8:1234:1a00::/56" ], "action": "allow" }, "process_check": { "processes": [ { "linux_path": "/usr/local/bin/netbird", "mac_path": "/Applications/NetBird.app/Contents/MacOS/netbird", "windows_path": "C:
rogramData…etBird\netbird.exe" } ] } } }`) client := &http.Client { } req, err := http.NewRequest(method, url, payload) if err != nil { fmt.Println(err) return } req.Header.Add("Content-Type", "application/json") req.Header.Add("Accept", "application/json") req.Header.Add("Authorization", "Token ") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := ioutil.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```ruby require "uri" require "json" require "net/http" url = URI("https://api.netbird.io/api/posture-checks/{postureCheckId}") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Put.new(url) request["Content-Type"] = "application/json" request["Accept"] = "application/json" request["Authorization"] = "Token " request.body = JSON.dump({ "name": "Default", "description": "This checks if the peer is running required NetBird's version", "checks": { "nb_version_check": { "min_version": "14.3" }, "os_version_check": { "android": { "min_version": "13" }, "ios": { "min_version": "17.3.1" }, "darwin": { "min_version": "14.2.1" }, "linux": { "min_kernel_version": "5.3.3" }, "windows": { "min_kernel_version": "10.0.1234" } }, "geo_location_check": { "locations": [ { "country_code": "DE", "city_name": "Berlin" } ], "action": "allow" }, "peer_network_range_check": { "ranges": [ "192.168.1.0/24", "10.0.0.0/8", "1.0.0.0/24", "2.2.2.2/32", "2001:db8:1234:1a00::/56" ], "action": "allow" }, "process_check": { "processes": [ { "linux_path": "/usr/local/bin/netbird", "mac_path": "/Applications/NetBird.app/Contents/MacOS/netbird", "windows_path": "C:
rogramData…etBird\netbird.exe" } ] } } }) response = https.request(request) puts response.read_body ``` ```java OkHttpClient client = new OkHttpClient().newBuilder() .build(); MediaType mediaType = MediaType.parse("application/json"); RequestBody body = RequestBody.create(mediaType, '{ "name": "Default", "description": "This checks if the peer is running required NetBird's version", "checks": { "nb_version_check": { "min_version": "14.3" }, "os_version_check": { "android": { "min_version": "13" }, "ios": { "min_version": "17.3.1" }, "darwin": { "min_version": "14.2.1" }, "linux": { "min_kernel_version": "5.3.3" }, "windows": { "min_kernel_version": "10.0.1234" } }, "geo_location_check": { "locations": [ { "country_code": "DE", "city_name": "Berlin" } ], "action": "allow" }, "peer_network_range_check": { "ranges": [ "192.168.1.0/24", "10.0.0.0/8", "1.0.0.0/24", "2.2.2.2/32", "2001:db8:1234:1a00::/56" ], "action": "allow" }, "process_check": { "processes": [ { "linux_path": "/usr/local/bin/netbird", "mac_path": "/Applications/NetBird.app/Contents/MacOS/netbird", "windows_path": "C:
rogramData…etBird\netbird.exe" } ] } } }'); Request request = new Request.Builder() .url("https://api.netbird.io/api/posture-checks/{postureCheckId}") .method("PUT", body) .addHeader("Content-Type", "application/json") .addHeader("Accept", "application/json") .addHeader("Authorization: Token ") .build(); Response response = client.newCall(request).execute(); ``` ```php 'https://api.netbird.io/api/posture-checks/{postureCheckId}', CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => '', CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => 'PUT', CURLOPT_POSTFIELDS => '{ "name": "Default", "description": "This checks if the peer is running required NetBird's version", "checks": { "nb_version_check": { "min_version": "14.3" }, "os_version_check": { "android": { "min_version": "13" }, "ios": { "min_version": "17.3.1" }, "darwin": { "min_version": "14.2.1" }, "linux": { "min_kernel_version": "5.3.3" }, "windows": { "min_kernel_version": "10.0.1234" } }, "geo_location_check": { "locations": [ { "country_code": "DE", "city_name": "Berlin" } ], "action": "allow" }, "peer_network_range_check": { "ranges": [ "192.168.1.0/24", "10.0.0.0/8", "1.0.0.0/24", "2.2.2.2/32", "2001:db8:1234:1a00::/56" ], "action": "allow" }, "process_check": { "processes": [ { "linux_path": "/usr/local/bin/netbird", "mac_path": "/Applications/NetBird.app/Contents/MacOS/netbird", "windows_path": "C:
rogramData…etBird\netbird.exe" } ] } } }', CURLOPT_HTTPHEADER => array( 'Content-Type: application/json', 'Accept: application/json', 'Authorization: Token ' ), )); $response = curl_exec($curl); curl_close($curl); echo $response; ``` ```json {{ title: 'Example' }} { "id": "ch8i4ug6lnn4g9hqv7mg", "name": "Default", "description": "This checks if the peer is running required NetBird's version", "checks": { "nb_version_check": { "min_version": "14.3" }, "os_version_check": { "android": { "min_version": "13" }, "ios": { "min_version": "17.3.1" }, "darwin": { "min_version": "14.2.1" }, "linux": { "min_kernel_version": "5.3.3" }, "windows": { "min_kernel_version": "10.0.1234" } }, "geo_location_check": { "locations": [ { "country_code": "DE", "city_name": "Berlin" } ], "action": "allow" }, "peer_network_range_check": { "ranges": [ "192.168.1.0/24", "10.0.0.0/8", "1.0.0.0/24", "2.2.2.2/32", "2001:db8:1234:1a00::/56" ], "action": "allow" }, "process_check": { "processes": [ { "linux_path": "/usr/local/bin/netbird", "mac_path": "/Applications/NetBird.app/Contents/MacOS/netbird", "windows_path": "C:
rogramData…etBird\netbird.exe" } ] } } } ``` ```json {{ title: 'Schema' }} { "id": "string", "name": "string", "description": "string", "checks": { "nb_version_check": { "min_version": "string" }, "os_version_check": { "android": { "min_version": "13" }, "ios": { "min_version": "17.3.1" }, "darwin": { "min_version": "14.2.1" }, "linux": { "min_kernel_version": "5.3.3" }, "windows": { "min_kernel_version": "10.0.1234" } }, "geo_location_check": { "locations": [ { "country_code": "string", "city_name": "string" } ], "action": "string" }, "peer_network_range_check": { "ranges": [ "string" ], "action": "string" }, "process_check": { "processes": [ { "linux_path": "string", "mac_path": "string", "windows_path": "string" } ] } } } ```
--- ## Delete a Posture Check {{ tag: 'DELETE' , label: '/api/posture-checks/{postureCheckId}' }} Delete a posture check ### Path Parameters The unique identifier of a posture check ```bash {{ title: 'cURL' }} curl -X DELETE https://api.netbird.io/api/posture-checks/{postureCheckId} \ -H 'Authorization: Token ' ``` ```js const axios = require('axios'); let config = { method: 'delete', maxBodyLength: Infinity, url: '/api/posture-checks/{postureCheckId}', headers: { 'Authorization': 'Token ' } }; axios(config) .then((response) => { console.log(JSON.stringify(response.data)); }) .catch((error) => { console.log(error); }); ``` ```python import requests import json url = "https://api.netbird.io/api/posture-checks/{postureCheckId}" headers = { 'Authorization': 'Token ' } response = requests.request("DELETE", url, headers=headers) print(response.text) ``` ```go package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://api.netbird.io/api/posture-checks/{postureCheckId}" method := "DELETE" client := &http.Client { } req, err := http.NewRequest(method, url, nil) if err != nil { fmt.Println(err) return } req.Header.Add("Authorization", "Token ") res, err := client.Do(req) if err != nil { fmt.Println(err) return } defer res.Body.Close() body, err := ioutil.ReadAll(res.Body) if err != nil { fmt.Println(err) return } fmt.Println(string(body)) } ``` ```ruby require "uri" require "json" require "net/http" url = URI("https://api.netbird.io/api/posture-checks/{postureCheckId}") https = Net::HTTP.new(url.host, url.port) https.use_ssl = true request = Net::HTTP::Delete.new(url) request["Authorization"] = "Token " response = https.request(request) puts response.read_body ``` ```java OkHttpClient client = new OkHttpClient().newBuilder() .build(); Request request = new Request.Builder() .url("https://api.netbird.io/api/posture-checks/{postureCheckId}") .method("DELETE") .addHeader("Authorization: Token ") .build(); Response response = client.newCall(request).execute(); ``` ```php 'https://api.netbird.io/api/posture-checks/{postureCheckId}', CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => '', CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => 'DELETE', CURLOPT_HTTPHEADER => array( 'Authorization: Token ' ), )); $response = curl_exec($curl); curl_close($curl); echo $response; ``` ---