Create a BGP Threat Intelligence Policy
curl --request POST \
--url https://v1.api.altostrat.io/content/bgp/policy \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "High-Risk Geo-IP Block",
"enabled": true,
"lists": [
"9b1e3e6a-5c3a-4f1e-9a0a-2b2a1e1d8e8c"
]
}
'import requests
url = "https://v1.api.altostrat.io/content/bgp/policy"
payload = {
"name": "High-Risk Geo-IP Block",
"enabled": True,
"lists": ["9b1e3e6a-5c3a-4f1e-9a0a-2b2a1e1d8e8c"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'High-Risk Geo-IP Block',
enabled: true,
lists: ['9b1e3e6a-5c3a-4f1e-9a0a-2b2a1e1d8e8c']
})
};
fetch('https://v1.api.altostrat.io/content/bgp/policy', 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://v1.api.altostrat.io/content/bgp/policy",
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([
'name' => 'High-Risk Geo-IP Block',
'enabled' => true,
'lists' => [
'9b1e3e6a-5c3a-4f1e-9a0a-2b2a1e1d8e8c'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://v1.api.altostrat.io/content/bgp/policy"
payload := strings.NewReader("{\n \"name\": \"High-Risk Geo-IP Block\",\n \"enabled\": true,\n \"lists\": [\n \"9b1e3e6a-5c3a-4f1e-9a0a-2b2a1e1d8e8c\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://v1.api.altostrat.io/content/bgp/policy")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"High-Risk Geo-IP Block\",\n \"enabled\": true,\n \"lists\": [\n \"9b1e3e6a-5c3a-4f1e-9a0a-2b2a1e1d8e8c\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://v1.api.altostrat.io/content/bgp/policy")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"High-Risk Geo-IP Block\",\n \"enabled\": true,\n \"lists\": [\n \"9b1e3e6a-5c3a-4f1e-9a0a-2b2a1e1d8e8c\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "9b1d3e6a-5c3a-4f1e-9a0a-2b2a1e1d8e8b",
"name": "Block Known Threats",
"enabled": true,
"default": false,
"lists": [
"9b1e3e6a-5c3a-4f1e-9a0a-2b2a1e1d8e8c"
],
"site_count": 3,
"updated_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z"
}{
"type": "invalid_request_error",
"code": "parameter_invalid",
"message": "The 'name' parameter cannot be empty.",
"doc_url": "https://docs.altostrat.io/errors/parameter_invalid"
}{
"type": "invalid_request_error",
"code": "parameter_invalid",
"message": "The 'name' parameter cannot be empty.",
"doc_url": "https://docs.altostrat.io/errors/parameter_invalid"
}{
"type": "invalid_request_error",
"code": "parameter_invalid",
"message": "The 'name' parameter cannot be empty.",
"doc_url": "https://docs.altostrat.io/errors/parameter_invalid"
}BGP Threat Intelligence
Create a BGP Threat Intelligence Policy
Creates a new BGP policy, specifying which IP reputation lists to use for blocking traffic.
POST
/
content
/
bgp
/
policy
Create a BGP Threat Intelligence Policy
curl --request POST \
--url https://v1.api.altostrat.io/content/bgp/policy \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "High-Risk Geo-IP Block",
"enabled": true,
"lists": [
"9b1e3e6a-5c3a-4f1e-9a0a-2b2a1e1d8e8c"
]
}
'import requests
url = "https://v1.api.altostrat.io/content/bgp/policy"
payload = {
"name": "High-Risk Geo-IP Block",
"enabled": True,
"lists": ["9b1e3e6a-5c3a-4f1e-9a0a-2b2a1e1d8e8c"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'High-Risk Geo-IP Block',
enabled: true,
lists: ['9b1e3e6a-5c3a-4f1e-9a0a-2b2a1e1d8e8c']
})
};
fetch('https://v1.api.altostrat.io/content/bgp/policy', 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://v1.api.altostrat.io/content/bgp/policy",
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([
'name' => 'High-Risk Geo-IP Block',
'enabled' => true,
'lists' => [
'9b1e3e6a-5c3a-4f1e-9a0a-2b2a1e1d8e8c'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://v1.api.altostrat.io/content/bgp/policy"
payload := strings.NewReader("{\n \"name\": \"High-Risk Geo-IP Block\",\n \"enabled\": true,\n \"lists\": [\n \"9b1e3e6a-5c3a-4f1e-9a0a-2b2a1e1d8e8c\"\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://v1.api.altostrat.io/content/bgp/policy")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"High-Risk Geo-IP Block\",\n \"enabled\": true,\n \"lists\": [\n \"9b1e3e6a-5c3a-4f1e-9a0a-2b2a1e1d8e8c\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://v1.api.altostrat.io/content/bgp/policy")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"High-Risk Geo-IP Block\",\n \"enabled\": true,\n \"lists\": [\n \"9b1e3e6a-5c3a-4f1e-9a0a-2b2a1e1d8e8c\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "9b1d3e6a-5c3a-4f1e-9a0a-2b2a1e1d8e8b",
"name": "Block Known Threats",
"enabled": true,
"default": false,
"lists": [
"9b1e3e6a-5c3a-4f1e-9a0a-2b2a1e1d8e8c"
],
"site_count": 3,
"updated_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z"
}{
"type": "invalid_request_error",
"code": "parameter_invalid",
"message": "The 'name' parameter cannot be empty.",
"doc_url": "https://docs.altostrat.io/errors/parameter_invalid"
}{
"type": "invalid_request_error",
"code": "parameter_invalid",
"message": "The 'name' parameter cannot be empty.",
"doc_url": "https://docs.altostrat.io/errors/parameter_invalid"
}{
"type": "invalid_request_error",
"code": "parameter_invalid",
"message": "The 'name' parameter cannot be empty.",
"doc_url": "https://docs.altostrat.io/errors/parameter_invalid"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Response
The BGP policy was created successfully.
Example:
"9b1d3e6a-5c3a-4f1e-9a0a-2b2a1e1d8e8b"
Example:
"Block Known Threats"
Example:
true
True if this is the default policy for the account.
Example:
false
A list of BGP IP reputation list IDs included in this policy.
Example:
["9b1e3e6a-5c3a-4f1e-9a0a-2b2a1e1d8e8c"]
The number of sites currently using this policy.
Example:
3
Was this page helpful?
⌘I