1. Overview & Architecture
Centralized Threat Intelligence & Automated Defense Mesh
IP Space (KT-BIP) is a distributed threat intelligence and defensive telemetry platform designed to aggregate, correlate, and automatically counter malicious IP activities in real time.
Servers (nodes) continuously report security incidents (e.g., SSH brute force, Port scans, Web exploits) via Fail2ban or custom daemons.
Cross-checks incoming telemetry against multi-account AbuseIPDB pools, 10+ public blocklists, Tor exit nodes, and ASN datacenter registries.
Calculates composite risk scores and returns actionable decisions (ban, tarpit, challenge, throttle) with tailored TTL values.
https://ip.space.ua/api.
2. Authentication
API Tokens and Supported Authorization Mechanisms
Every request to the API must provide a valid 32-character API token. Tokens are linked to your registered user account and can be labeled per server node (e.g., web-node-01, mail-relay).
Standard and most secure way to pass authentication headers.
curl -s "https://ip.space.ua/api/ip=198.51.100.42/r=SSH/s=h01/a=ban" \
-H "Authorization: Bearer YOUR_API_TOKEN"
Ideal for scripts, proxies, or monitoring webhooks where custom HTTP headers cannot be supplied.
curl -s "https://ip.space.ua/api/t=YOUR_API_TOKEN/ip=198.51.100.42/r=SSH/s=h01/a=ban"
Pass token in query parameter ?t=... or ?token=....
curl -s "https://ip.space.ua/api/ip=198.51.100.42/r=SSH/s=h01/a=ban?t=YOUR_API_TOKEN"
3. REST API Reference
Endpoints, Request Formats, and Parameters
/api/ip={ip}/r={reason}/s={server}/a={action}
Reports an incident telemetry event from an edge server while simultaneously returning a comprehensive threat assessment and defense recommendation for the target IP.
| Segment | Type | Required | Description / Examples |
|---|---|---|---|
| ip | string | Yes | IPv4 or IPv6 address (e.g., 198.51.100.42) |
| r | string | No | Reason / Service targeted (e.g., SSH, NGINX, PORT_SCAN, DDoS, SYN_FLOOD) |
| s | string | No | Reporting server hostname or node identifier (e.g., h01, prod-web-1) |
| a | string | No |
Event action / inquiry mode. Default: ban:
ban
Final Ban: Node has banned the host. Records the ban in
ips, inserts incident in log, and submits reputation telemetry to AbuseIPDB.
found
Preliminary Detection: Fail2ban or security agent found an attack attempt/first strike but has not banned yet. Performs full intelligence check, logs into
found table for collaborative multi-node tracking, and returns threat verdict. If multi-node threshold is crossed, automatically elevates to ban.
check
Read-Only Inspection: Dry-run lookup. Evaluates threat score, blacklists, GeoIP, and recommendations, but never writes to the database and never submits reports to AbuseIPDB. Guest access available without a token (up to 10 checks/hour per IP). Exceeding 10 checks/hour prompts CAPTCHA in Web interface, or returns HTTP 429 rejection in API.
|
curl -s "https://ip.space.ua/api/ip=198.51.100.42/r=SSH/s=h01/a=ban" \
-H "Authorization: Bearer YOUR_API_TOKEN"
/api/{ip}
Performs a read-only intelligence check for an IP without registering a ban or incident report. Ideal for pre-connection filtering, firewall validation, or WAF inspections.
curl -s "https://ip.space.ua/api/198.51.100.42" \
-H "Authorization: Bearer YOUR_API_TOKEN"
/api?ip={ip}&r={reason}&s={server}&a={action}
Traditional query string endpoint. Fully interchangeable with path-based formats.
curl -s "https://ip.space.ua/api?ip=198.51.100.42&r=SSH&s=h01&a=ban" \
-H "Authorization: Bearer YOUR_API_TOKEN"
/api
Content-Type: application/json
Inspect up to 100 IPs in a single request. Returns an array of enriched threat assessment objects.
curl -s -X POST "https://ip.space.ua/api" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"ips": [
"198.51.100.42",
"203.0.113.19",
"192.0.2.1"
],
"format": "json"
}'
/api/v2/blacklist
(or /api/blacklist)
Потужний ендпоінт для генерації та вивантаження чорних списків шкідливих IP-адрес на основі рівня загрози (Confidence of Abuse Score). Повністю сумісний за параметрами та структурою з AbuseIPDB Blacklist API v2. Підтримує вивантаження у форматах JSON, CSV та Plain Text (чистий список адрес для автоматичного блокування фаєрволами).
| Параметр | Тип | За замовчуванням | Опис |
|---|---|---|---|
| confidenceMinimum | Integer (25–100) | 100 | Мінімальний поріг агресивності IP (аліаси: score, min_score). |
| limit | Integer (1–500000) | 10000 | Максимальна кількість IP-адрес для вибірки. |
| plaintext | Boolean | false | Якщо true або 1, повертає список IP по одному на рядок. |
| format | String | json | Формат відповіді: json, csv або txt (plain). |
| ipVersion | String | 4 | Версія IP: 4, 6 або both. |
| onlyCountries | String | — | Фільтр країн через кому (ISO-код), наприклад: CN,RU,IR. |
| exceptCountries | String | — | Виключити IP країн, наприклад: UA,US. |
| columns | String | standard | Список колонок: ipAddress,countryCode,abuseConfidenceScore,lastReportedAt. |
# Завантаження сирого списку IP для фаєрволів (fail2ban, ipset, nftables)
curl -s -G "https://ip.space.ua/api/v2/blacklist" \
-d confidenceMinimum=90 \
-d limit=50000 \
-d plaintext=true \
-H "Key: YOUR_API_KEY" > /etc/firewall/blacklist.txt
4. JSON Response Schema & Threat Verdict Engine
Field Specification, Classification Rules, and Mitigation Actions
Every request returns a detailed JSON object providing both backward-compatible baseline fields and advanced threat intelligence metrics.
{
"ipAddress": "198.51.100.42",
"action": "ban",
"reason": "SSH",
"AIDBisWhitelisted": 0,
"AIDBConfidenceScore": 100,
"countryCode": "NL",
"numListsFound": 9,
"recommendedAction": "ban",
"recommendedTtl": 604800,
"riskScore": 100,
"riskLevel": "critical",
"threatCategory": "BruteForce",
"blacklists": [
"blocklist_de",
"ipsum",
"list.rtbh.com.tr"
],
"matchedCidr": null,
"countryName": "The Netherlands",
"asn": 216014,
"asName": "BestDC Limited",
"isDataCenter": true,
"isTor": false,
"attackCount": 629,
"firstSeen": "2026-08-18T18:29:56+03:00",
"lastSeen": "2026-09-25T07:43:26+03:00"
}
Field Dictionary
| Field | Type | Description |
|---|---|---|
| ipAddress | string | The evaluated IPv4 or IPv6 address. |
| action | string | The evaluated action status (ban, found, check). For found, automatically elevates to ban if multi-node coordinated attack threshold is exceeded. |
| reason | string | Reported attack vector or targeted service (e.g. SSH, PORT_SCAN, DDoS, SYN_FLOOD). |
| AIDBisWhitelisted | int (0|1) | AbuseIPDB verified whitelist flag (1 = whitelisted benign infrastructure). |
| AIDBConfidenceScore | int (0–100) | AbuseIPDB abuse confidence score percentage. |
| countryCode / countryName | string | Two-letter ISO country code and full country name. |
| numListsFound | int | Number of community blocklists listing this IP. |
| recommendedAction | string | Dynamic verdict: ban, tarpit, challenge, throttle, monitor, allow. |
| recommendedTtl | int (seconds) | Suggested ban duration in seconds (e.g. 604800 = 7 days, 86400 = 24h, 3600 = 1h). |
| riskScore | int (0–100) | Weighted composite risk score calculated from attacks, reputation lists, and ASN. |
| riskLevel | string | Risk tier: clean, low, medium, high, critical. |
| threatCategory | string | Identified threat pattern: DDoS, SYN_FLOOD, BruteForce, PortScan, WebExploit, MailSpam, GeneralAbuse. |
| blacklists | array | Matched blocklists (e.g. blocklist_de, ipsum, list.rtbh.com.tr). |
| asn / asName | int / string | Autonomous System Number and registered ISP / Organization name. |
| isDataCenter | boolean | True if IP originates from a hosting provider or VPS cloud infrastructure. |
| isTor | boolean | True if IP is an active Tor exit node. |
| attackCount | int | Historical attacks recorded across the entire server mesh. |
| firstSeen / lastSeen | string | ISO-8601 timestamps of the first and most recent incident observed. |
Threat Mitigation Actions (recommendedAction)
Immediately drop packets at the firewall (iptables / nftables). Applied when risk score ≥ 75, verified Tor node, or heavy repeated attacks.
Hold connection open with minimum transmission window to consume attacker resources and slow down reconnaissance bots.
Serve a cryptographic proof-of-work, CAPTCHA, or JS challenge via WAF before granting access.
Apply strict rate limits (e.g. 5 req/min via Nginx limit_req) without completely dropping traffic.
Allow traffic but record access logs and request headers for anomaly detection.
Legitimate residential ISP, search engine crawler, or explicitly whitelisted IP.
5. Integrations & Code Examples
Ready-To-Use Integration Templates for Systems and Scripts
Automating Server Bans via Fail2ban Action
Create a custom Fail2ban action file at /etc/fail2ban/action.d/ip-space.conf:
[Definition]
# 1. Triggered when Fail2ban reaches maxretry and issues a ban:
# Records the ban in 'ips', logs incident in 'log', submits telemetry to AbuseIPDB.
actionban = curl -s -m 5 "https://ip.space.ua/api/ip=<ip>/r=<name>/s=<server_name>/a=ban" \
-H "Authorization: Bearer YOUR_API_TOKEN" > /dev/null 2>&1
# 2. Triggered on preliminary detection / first failure strike (pre-ban hook):
# Performs intelligence lookup, logs incident to 'found' table for multi-node aggregation.
# If coordinated attacks exceed threshold across servers, automatically elevates to 'ban'.
actionfound = curl -s -m 5 "https://ip.space.ua/api/ip=<ip>/r=<name>/s=<server_name>/a=found" \
-H "Authorization: Bearer YOUR_API_TOKEN" > /dev/null 2>&1
# 3. Optional: notify IP Space when local ban is lifted
actionunban = curl -s -m 5 "https://ip.space.ua/api/ip=<ip>/r=<name>/s=<server_name>/a=unban" \
-H "Authorization: Bearer YOUR_API_TOKEN" > /dev/null 2>&1
[Init]
server_name = my-production-node-01
Then simply activate it in your /etc/fail2ban/jail.local:
action = %(action_)s
ip-space[name=%(__name__)s]
Automated Threat Reporting via FortiOS Automation Stitches
FortiGate Next-Generation Firewalls (FortiOS 6.4+) can report IPS attack signatures, SSL-VPN brute-force attempts, and DoS anomalies to IP Space in real time using Automation Stitches and Webhooks.
1. FortiOS Webhook Action Definition (CLI)
config system automation-action
edit "IP-Space-Report-Ban"
set action-type webhook
set protocol https
set uri "ip.space.ua/api/ip=%%log.srcip%%/r=%%log.attack%%/s=%%log.devname%%/a=ban"
set http-header "Authorization: Bearer YOUR_API_TOKEN"
set method get
next
edit "IP-Space-Report-Found"
set action-type webhook
set protocol https
set uri "ip.space.ua/api/ip=%%log.srcip%%/r=%%log.subtype%%/s=%%log.devname%%/a=found"
set http-header "Authorization: Bearer YOUR_API_TOKEN"
set method get
next
end
2. FortiOS Automation Triggers & Stitch Binding
# Define Event Triggers: IPS attack (logid 43583) and SSL-VPN failed login (logid 22922)
config system automation-trigger
edit "Trigger-IPS-Attack"
set event-type event-log
set logid 43583
next
edit "Trigger-SSL-VPN-Failed-Auth"
set event-type event-log
set logid 22922
next
end
# Link Triggers to Actions via Automation Stitches
config system automation-stitch
edit "Stitch-IPS-to-IP-Space"
set trigger "Trigger-IPS-Attack"
config actions
edit 1
set action "IP-Space-Report-Ban"
set required enable
next
end
next
edit "Stitch-VPN-to-IP-Space"
set trigger "Trigger-SSL-VPN-Failed-Auth"
config actions
edit 1
set action "IP-Space-Report-Found"
set required enable
next
end
next
end
| FortiOS Macro Token | Maps To | Description |
|---|---|---|
| %%log.srcip%% | ip | Offending source IP address detected in traffic/session log. |
| %%log.attack%% | r (reason) | Name of the IPS signature, exploit pattern, or protocol event. |
| %%log.devname%% | s (server) | FortiGate appliance hostname / VDOM identifier. |
| a=ban / a=found | a (action) | Use a=ban for dropped IPS exploits, and a=found for pre-ban failed auth strikes. |
Automated Shell Check & Conditional Firewall Drop
#!/usr/bin/env bash
TARGET_IP="198.51.100.42"
API_TOKEN="YOUR_API_TOKEN"
# Query IP Space API
RESPONSE=$(curl -s -m 4 "https://ip.space.ua/api/ip=${TARGET_IP}/r=SSH/s=$(hostname)/a=check" \
-H "Authorization: Bearer ${API_TOKEN}")
# Extract recommended action and risk score using jq
ACTION=$(echo "$RESPONSE" | jq -r '.recommendedAction // "allow"')
RISK=$(echo "$RESPONSE" | jq -r '.riskScore // 0')
echo "Evaluated ${TARGET_IP}: Action=${ACTION}, RiskScore=${RISK}"
if [ "$ACTION" = "ban" ]; then
echo "Dropping ${TARGET_IP} via iptables..."
iptables -I INPUT -s "${TARGET_IP}" -j DROP
fi
High-Performance IPset Firewall Sync (Atomic Swap)
Periodically fetches the raw plain-text malicious IP blacklist from IP Space and updates an in-kernel ipset hash table with zero packet loss using atomic set swap. Ideal for high-throughput edge routers and firewalls.
#!/usr/bin/env bash
# /usr/local/bin/sync_ipspace_ipset.sh
set -euo pipefail
API_KEY="YOUR_API_KEY"
CONFIDENCE_MIN=90
IPSET_NAME="ipspace_blacklist"
TEMP_SET="ipspace_temp"
URL="https://ip.space.ua/api/v2/blacklist?confidenceMinimum=${CONFIDENCE_MIN}&plaintext=true"
# Ensure main set and iptables rule exist
ipset create -exist "$IPSET_NAME" hash:ip hashsize 65536 maxelem 1000000
iptables -C INPUT -m set --match-set "$IPSET_NAME" src -j DROP 2>/dev/null || \
iptables -I INPUT -m set --match-set "$IPSET_NAME" src -j DROP
# Create temporary working set
ipset create -exist "$TEMP_SET" hash:ip hashsize 65536 maxelem 1000000
ipset flush "$TEMP_SET"
# Download blacklist and populate temporary set
TMP_LIST=$(mktemp)
curl -sS -m 30 -H "Key: ${API_KEY}" "$URL" -o "$TMP_LIST"
while read -r ip; do
[[ -n "$ip" && ! "$ip" =~ ^# ]] && ipset add "$TEMP_SET" "$ip" -exist
done < "$TMP_LIST"
rm -f "$TMP_LIST"
# Atomically swap active set with new set (zero downtime)
ipset swap "$TEMP_SET" "$IPSET_NAME"
ipset destroy "$TEMP_SET"
echo "Successfully synchronized $(ipset list $IPSET_NAME | grep -c '^[0-9]') IPs into $IPSET_NAME"
MikroTik Address-List Auto-Import Script
Automated RouterOS script that downloads the plain-text blacklist using /tool fetch and populates an ip firewall address-list. Can be scheduled via /system scheduler to run every 1–6 hours.
# 1. Firewall Drop Filter Rule (execute once):
/ip firewall filter add chain=input src-address-list=ipspace_blacklist action=drop comment="Drop IP Space Blacklist"
/ip firewall filter add chain=forward src-address-list=ipspace_blacklist action=drop comment="Drop IP Space Blacklist"
# 2. Automated Sync Script:
/system script add name="sync_ipspace" source={
:local apiKey "YOUR_API_KEY"
:local listName "ipspace_blacklist"
:local url "https://ip.space.ua/api/v2/blacklist?confidenceMinimum=100&plaintext=true&limit=5000"
/tool fetch url=$url http-header-field="Key: $apiKey" dst-path="ipspace_block.txt" mode=https
# Flush existing dynamic entries
/ip firewall address-list remove [find list=$listName dynamic=yes]
:local content [/file get ipspace_block.txt contents]
:local lineEnd 0
:local lineStart 0
:while ($lineEnd < [:len $content]) do={
:set lineEnd [:find $content "\n" $lineStart]
:if ([:typeof $lineEnd] = "nil") do={ :set lineEnd [:len $content] }
:local ip [:pick $content $lineStart $lineEnd]
:if ([:len $ip] > 6) do={
/ip firewall address-list add list=$listName address=$ip timeout=6h comment="IPSpace Auto-Block"
}
:set lineStart ($lineEnd + 1)
}
/file remove "ipspace_block.txt"
:log info "IP Space Blacklist synchronized successfully."
}
# 3. Schedule execution every 4 hours:
/system scheduler add name="sched_ipspace" interval=4h on-event="sync_ipspace"
Dynamic NGINX Blocklist Generator (Cron)
Formats exported malicious IPs into native Nginx deny <ip>; directives and gracefully reloads the web server without dropping active client connections.
#!/usr/bin/env bash
# /etc/cron.hourly/update_nginx_blocklist.sh
set -euo pipefail
API_KEY="YOUR_API_KEY"
CONF_PATH="/etc/nginx/conf.d/ipspace_blocklist.conf"
TMP_PATH="/tmp/ipspace_blocklist.conf.tmp"
# 1. Fetch plain-text IPs and wrap each with 'deny IP;'
curl -sS -m 20 -H "Key: ${API_KEY}" \
"https://ip.space.ua/api/v2/blacklist?confidenceMinimum=100&plaintext=true&limit=10000" \
| awk '{print "deny " $1 ";"}' > "${TMP_PATH}"
# 2. Check if output is non-empty and valid
if [ -s "${TMP_PATH}" ]; then
mv "${TMP_PATH}" "${CONF_PATH}"
# 3. Test nginx configuration and reload gracefully
if nginx -t >/dev/null 2>&1; then
systemctl reload nginx
echo "NGINX blocklist refreshed: $(wc -l < ${CONF_PATH}) IPs denied."
else
echo "NGINX config test failed! Reverting."
rm -f "${CONF_PATH}"
fi
fi
Python Client with Error Handling
import requests
API_TOKEN = "YOUR_API_TOKEN"
API_URL = "https://ip.space.ua/api"
def check_ip_reputation(ip_address: str, reason: str = "SSH", server_id: str = "app-01") -> dict:
url = f"{API_URL}/ip={ip_address}/r={reason}/s={server_id}/a=check"
headers = {"Authorization": f"Bearer {API_TOKEN}"}
try:
response = requests.get(url, headers=headers, timeout=5)
response.raise_for_status()
return response.json()
except requests.RequestException as e:
print(f"Error querying IP Space: {e}")
return {"recommendedAction": "monitor", "riskScore": 0}
# Example usage
verdict = check_ip_reputation("198.51.100.42")
print(f"Verdict for {verdict.get('ipAddress')}: {verdict.get('recommendedAction')} (Risk: {verdict.get('riskScore')})")
if verdict.get("recommendedAction") == "ban":
print(f"Blocking for {verdict.get('recommendedTtl')} seconds.")
PHP cURL Integration
<?php
$apiToken = 'YOUR_API_TOKEN';
$targetIp = $_SERVER['REMOTE_ADDR'] ?? '198.51.100.42';
$ch = curl_init("https://ip.space.ua/api/ip={$targetIp}/r=WEB_APP/s=web01/a=check");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 3,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer {$apiToken}",
"Accept: application/json"
]
]);
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);
if (!empty($data['recommendedAction']) && $data['recommendedAction'] === 'ban') {
http_response_code(403);
die(json_encode(['error' => 'Access denied due to malicious reputation']));
}
6. Telegram Bot & Webhook Alerts
Real-time push notifications for node downtime, DDoS spikes, and platform security alerts
IP Space supports instant push notifications directly to your Telegram account, group chat, channel, or Discord channel. You can receive automated alerts whenever one of your edge nodes ceases sending telemetry or when an anomalous spike in cyberattacks is detected.
Official Telegram Bot: @IP_space_bot
Direct Telegram URL: https://t.me/IP_space_bot
Quick 3-Step Telegram Integration
Open @IP_space_bot in your Telegram app and click Start (or send /start).
To find your numeric Chat ID, send a message to @userinfobot or @myidbot. For group chats, add the bot to the group and use the negative group ID (e.g. -100...).
Navigate to Notifications & Webhooks, enter your Chat ID, and click Save. Use the "Send Test Alert" button to verify connectivity.
Supported Alert Triggers & Options
● Node Offline (Telemetry Silence)
Triggers when an edge server (reporting source) has not transmitted any log batches for longer than the configured threshold. Essential for discovering network outages, disabled Fail2ban services, or crashed daemons.
● Attack Surge / Brute-Force Spike
Triggers when the volume of newly banned IPs across your servers exceeds statistical anomaly thresholds (e.g. active SSH brute-force waves, port scans, or distributed DDoS attempts).
Custom Bot Token & Discord Support
- Custom Telegram Bot: If your organization requires white-label notifications from your own bot name/avatar, you can provide a custom
telegram_bot_tokenin the settings panel. If left empty, the default platform bot @IP_space_bot is used automatically. - Discord Webhooks: You can also paste an incoming Discord Webhook URL. Alerts will be formatted with rich embeds, color-coded severity indicators, and direct links to incident details.
7. System Modules & Features
Navigation, Management Features, and Administrative Capabilities
Live Threat Dashboard (/dashboard)
Real-Time AnalyticsProvides real-time visibility into incoming attacks across the mesh. Visualizes 24-hour attack timelines, top targeted ports/services (SSH, NGINX, EXIM), most aggressive origin countries, and top malicious Autonomous Systems (ASNs).
API Key Management (/cp/api)
Credentials & TokensCreate and manage access keys for your edge servers. Each key can be assigned a human-readable name, tracks its last-used timestamp, and can be instantly revoked if compromised.
Blacklist Exporter (/cp/blacklist)
Firewall FeedInteractive feed exporter modeled after industry standards (AbuseIPDB). Features a real-time Threat Confidence Score curve (linear & logarithmic scales), minimum confidence slider (25%–100%), column selection, and multi-format exports (CSV, Plain Text IP list, and JSON). Generates ready-to-use cURL commands for automated cron synchronization.
My Incident Reports (/reports)
Audit & Log HistoryReview historical ban reports submitted by your nodes. Filter by IP address, targeted service, or reporting server. Allows authorized users to delete stale or false-positive reports.
AbuseIPDB Rate Limits & Quota Balancer (/cp/abuseipdb)
AdminMonitors real-time API quota consumption across all configured AbuseIPDB accounts in the pool. Automatically balances check queries, tracks remaining daily limits, and switches to active keys before daily limits are exhausted.
Мої AS, Nets (/cp/networks)
Threat AlertsМоніторинг власних автономних систем (AS) та підмереж/CIDR. Дозволяє налаштувати автоматичні сповіщення (внутрішні сповіщення, Telegram-бот, Discord Webhooks), якщо будь-яка IP-адреса з вашого пулу чи автономної системи здійснює атаку та потрапляє до бази блокувань або Fail2ban на підключених вузлах.
Role & Invite Management
AdminManage team access and invitation tokens. Administrators can review incoming registration requests, approve new node operators, and delegate administrator privileges.