curl --request POST \
--url https://app.trustivan.com/api/v1/certificates/ranges \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"cidr": "203.0.113.0/24",
"ports": [
32768
],
"protocols": {
"2525": "smtp"
}
}
'import requests
url = "https://app.trustivan.com/api/v1/certificates/ranges"
payload = {
"cidr": "203.0.113.0/24",
"ports": [32768],
"protocols": { "2525": "smtp" }
}
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({cidr: '203.0.113.0/24', ports: [32768], protocols: {'2525': 'smtp'}})
};
fetch('https://app.trustivan.com/api/v1/certificates/ranges', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.trustivan.com/api/v1/certificates/ranges"
payload := strings.NewReader("{\n \"cidr\": \"203.0.113.0/24\",\n \"ports\": [\n 32768\n ],\n \"protocols\": {\n \"2525\": \"smtp\"\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))
}{
"range": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cidr": "203.0.113.0/24",
"ports": [
123
],
"protocols": {},
"last_swept_at": "2023-11-07T05:31:56Z",
"last_found": 123,
"last_error": "<string>",
"created_at": "2023-11-07T05:31:56Z"
}
}{
"error": "<string>",
"code": "validation_failed",
"required_scope": "<string>",
"principal": "user"
}{
"error": "<string>",
"code": "validation_failed",
"required_scope": "<string>",
"principal": "user"
}{
"error": "<string>",
"code": "validation_failed",
"required_scope": "<string>",
"principal": "user"
}Add a network range to sweep
Adds a range in CIDR notation of at most 1024 addresses (IPv4 /22 or
smaller, IPv6 /118 or smaller), written from its first address, with
up to 10 ports (ports left out: 443, 8443, 636, 993, 995, 465). On
25 and 587 (SMTP), 143 (IMAP), 110 (POP3), 389 (LDAP), 21 (FTP) and
5222 (XMPP) the sweep asks for STARTTLS first; on 22 it reads the SSH
algorithm offer. protocols names the protocol of other ports in the
list ({"2525": "smtp", "2222": "ssh"}), and the endpoints found there
keep it.
Two rules, checked now and again before every sweep: the range must hold an address of one of the organization’s DAST targets whose ownership is verified, and every address must be one the deployment may reach. Sweeps run from TRUSTIVAN’s own workers, so a private, loopback, link-local or reserved range is refused unless the deployment allows private DAST targets; there is no in-network scanner.
The range is swept on the next hourly pass (one range per organization
per pass, at most 100 new connections a second). Requires assets:write.
curl --request POST \
--url https://app.trustivan.com/api/v1/certificates/ranges \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"cidr": "203.0.113.0/24",
"ports": [
32768
],
"protocols": {
"2525": "smtp"
}
}
'import requests
url = "https://app.trustivan.com/api/v1/certificates/ranges"
payload = {
"cidr": "203.0.113.0/24",
"ports": [32768],
"protocols": { "2525": "smtp" }
}
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({cidr: '203.0.113.0/24', ports: [32768], protocols: {'2525': 'smtp'}})
};
fetch('https://app.trustivan.com/api/v1/certificates/ranges', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.trustivan.com/api/v1/certificates/ranges"
payload := strings.NewReader("{\n \"cidr\": \"203.0.113.0/24\",\n \"ports\": [\n 32768\n ],\n \"protocols\": {\n \"2525\": \"smtp\"\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))
}{
"range": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"cidr": "203.0.113.0/24",
"ports": [
123
],
"protocols": {},
"last_swept_at": "2023-11-07T05:31:56Z",
"last_found": 123,
"last_error": "<string>",
"created_at": "2023-11-07T05:31:56Z"
}
}{
"error": "<string>",
"code": "validation_failed",
"required_scope": "<string>",
"principal": "user"
}{
"error": "<string>",
"code": "validation_failed",
"required_scope": "<string>",
"principal": "user"
}{
"error": "<string>",
"code": "validation_failed",
"required_scope": "<string>",
"principal": "user"
}