Skip to content

Installation

This guide covers all installation methods for CloakProbe.

The recommended way to install CloakProbe on a Linux server:

Terminal window
curl -fsSL https://raw.githubusercontent.com/drmckay/cloakprobe/main/install.sh | sudo bash

The script automatically:

  • Detects your architecture (x86_64 or aarch64)
  • Downloads the latest release
  • Creates /opt/cloakprobe directory structure
  • Creates /etc/cloakprobe configuration directory
  • Installs cloakprobe.toml configuration file
  • Creates a cloakprobe system user
  • Installs systemd services (single and multi-instance)
  • Sets correct permissions

After installation, download the databases:

Terminal window
# IP-to-ASN database (required)
sudo /opt/cloakprobe/scripts/update_asn_db.sh
# Multi-RIR organization database (optional, for company names)
sudo /opt/cloakprobe/scripts/update_org_db.sh
  1. Install Rust

    Terminal window
    curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
    source $HOME/.cargo/env
  2. Clone the repository

    Terminal window
    git clone https://github.com/drmckay/cloakprobe.git
    cd cloakprobe
  3. Build the release binary

    Terminal window
    cargo build --release

    The binary will be at target/release/cloakprobe.

  4. Build database tools

    Terminal window
    cargo build --release --bin asn_builder
    cargo build --release --bin org_builder
    cargo build --release --bin org_builder_rpsl
    cargo build --release --bin org_builder_arin

If you prefer to install manually without the script:

  1. Create directory structure

    Terminal window
    sudo mkdir -p /opt/cloakprobe/{data,scripts,systemd,templates,docs}
    sudo mkdir -p /etc/cloakprobe
  2. Copy binaries

    Terminal window
    sudo cp target/release/cloakprobe /opt/cloakprobe/
    sudo cp target/release/asn_builder /opt/cloakprobe/
    sudo cp target/release/org_builder /opt/cloakprobe/
    sudo cp target/release/org_builder_rpsl /opt/cloakprobe/
    sudo cp target/release/org_builder_arin /opt/cloakprobe/
    sudo chmod +x /opt/cloakprobe/*
  3. Copy configuration

    Terminal window
    sudo cp cloakprobe.example.toml /etc/cloakprobe/cloakprobe.toml

    Edit the configuration:

    Terminal window
    sudo nano /etc/cloakprobe/cloakprobe.toml

    Update database paths:

    [database]
    asn_db_path = "/opt/cloakprobe/data/asn_db.bin"
    org_db_path = "/opt/cloakprobe/data/orgs_db.bin"
  4. Create system user

    Terminal window
    sudo useradd -r -s /bin/false -d /opt/cloakprobe cloakprobe
  5. Copy scripts and templates

    Terminal window
    sudo cp scripts/update_asn_db.sh /opt/cloakprobe/scripts/
    sudo cp scripts/update_org_db.sh /opt/cloakprobe/scripts/
    sudo cp scripts/download_rir_orgs.sh /opt/cloakprobe/scripts/
    sudo cp -r templates/* /opt/cloakprobe/templates/
    sudo chmod +x /opt/cloakprobe/scripts/*.sh
  6. Set ownership

    Terminal window
    sudo chown -R cloakprobe:cloakprobe /opt/cloakprobe
    sudo chown -R cloakprobe:cloakprobe /etc/cloakprobe
  7. Install systemd services

    Terminal window
    # Single instance service
    sudo cp systemd/cloakprobe.service /etc/systemd/system/
    # Multi-instance template (optional)
    sudo cp systemd/cloakprobe@.service /etc/systemd/system/
    sudo systemctl daemon-reload
    sudo systemctl enable cloakprobe

After installation, the directory structure looks like:

/opt/cloakprobe/
├── cloakprobe # Main binary
├── asn_builder # ASN database builder
├── org_builder # Multi-RIR org database builder
├── org_builder_rpsl # RPSL format parser (RIPE, APNIC, LACNIC, AFRINIC)
├── org_builder_arin # ARIN XML parser
├── cloakprobe.example.toml # Example configuration
├── data/
│ ├── asn_db.bin # IP-to-ASN database
│ └── orgs_db.bin # Multi-RIR organization database
├── templates/
│ ├── index.html.tera
│ └── privacy.html.tera
├── scripts/
│ ├── update_asn_db.sh
│ ├── update_org_db.sh # Multi-RIR update orchestrator
│ └── download_rir_orgs.sh # RIR data downloader
├── systemd/
│ ├── cloakprobe.service
│ └── cloakprobe@.service
└── docs/
└── nginx-deployment.md
/etc/cloakprobe/
└── cloakprobe.toml # Active configuration

CloakProbe uses two local databases:

  • Source: iptoasn.com (Public Domain)
  • Contains: IP ranges → ASN mappings for IPv4 and IPv6
  • Update script: update_asn_db.sh
  • Output: data/asn_db.bin
  • Sources: All 5 Regional Internet Registries
  • Contains: ASN → Organization details (name, ID, country, type, abuse contact)
  • Update script: update_org_db.sh
  • Output: data/orgs_db.bin

To update to a newer version:

Terminal window
# Stop the service
sudo systemctl stop cloakprobe
# Run the installer again
curl -fsSL https://raw.githubusercontent.com/drmckay/cloakprobe/main/install.sh | sudo bash
# Start the service
sudo systemctl start cloakprobe

Your configuration in /etc/cloakprobe/cloakprobe.toml will be preserved.

Terminal window
# Stop and disable service
sudo systemctl stop cloakprobe
sudo systemctl disable cloakprobe
# Remove service files
sudo rm /etc/systemd/system/cloakprobe.service
sudo rm /etc/systemd/system/cloakprobe@.service
sudo systemctl daemon-reload
# Remove installation
sudo rm -rf /opt/cloakprobe
# Remove configuration
sudo rm -rf /etc/cloakprobe
# Remove user (optional)
sudo userdel cloakprobe

Check the logs:

Terminal window
sudo journalctl -u cloakprobe -n 50

Common issues:

  • ASN database missing: Run update_asn_db.sh
  • Config file missing: Check /etc/cloakprobe/cloakprobe.toml exists
  • Permission issues: Check ownership is cloakprobe:cloakprobe
  • Port in use: Change port in config file
Terminal window
ls -la /opt/cloakprobe/cloakprobe
sudo chmod +x /opt/cloakprobe/cloakprobe

Check connectivity:

Terminal window
curl -I https://iptoasn.com/data/ip2asn-combined.tsv.gz
curl -I https://ftp.ripe.net/ripe/dbase/split/ripe.db.aut-num.gz
curl -I https://ftp.apnic.net/apnic/whois/apnic.db.aut-num.gz