Skip to main content

Flowtriq DDoS Detection Agent — real-time L3/L4/L7 traffic monitoring, incident detection, PCAP capture, and auto-mitigation

Project description

ftagent

Flowtriq DDoS Detection Agent Real-time traffic monitoring, attack detection, PCAP capture, and auto-mitigation for Linux servers.

A valid Flowtriq account and API key are required. Start a free 7-day trial at flowtriq.com.


Requirements

  • Linux (Ubuntu 20.04+, Debian 11+, CentOS 8+, or equivalent)
  • Python 3.8+
  • Root / sudo (required for raw packet capture)
  • A Flowtriq account — sign up free

Install

pip (recommended)

pip install ftagent[full]

The [full] extra installs all dependencies including scapy for packet capture and psutil for system metrics.

From source

git clone https://github.com/flowtriq/ftagent.git
cd ftagent
pip install -e .[full]

Quick start

The fastest way to get running is the built-in setup wizard and service installer. No manual config editing needed.

1. Get your API key

Log in to your Flowtriq dashboardNodesAdd Node → copy the API key and Node UUID shown.

2. Run the setup wizard

sudo ftagent --setup

This creates /etc/ftagent/config.json with your API key, Node UUID, and sane defaults. It will prompt you for each value.

3. Install as a service

sudo ftagent --install-service
sudo systemctl enable --now ftagent

That's it. The agent will register your node, establish a baseline, and begin monitoring. Your node will appear in the Flowtriq dashboard within 30 seconds.

Manual config (alternative)

If you prefer to create the config manually:

sudo mkdir -p /etc/ftagent
sudo cp packaging/config.example.json /etc/ftagent/config.json
sudo nano /etc/ftagent/config.json

Set api_key and node_uuid to the values from your Flowtriq dashboard.

Verify connectivity

sudo ftagent --test

This sends a test heartbeat to confirm the agent can reach the Flowtriq API.

Check service status

sudo systemctl status ftagent
sudo journalctl -u ftagent -f

Configuration reference

Config file: /etc/ftagent/config.json

Key Default Description
api_key Required. Your Flowtriq node API key
node_uuid Required. Node UUID from your Flowtriq dashboard → Nodes
api_base https://flowtriq.com/api/v1 API endpoint
interface "auto" Network interface to monitor (eth0, ens3, etc.) or "auto"
pcap_enabled true Enable PCAP capture during incidents
pcap_dir /var/lib/ftagent/pcaps Directory for PCAP files
pcap_max_packets 10000 Max packets per PCAP file
pcap_max_seconds 60 Max seconds per PCAP file
pcap_retention_days 7 Delete PCAPs older than N days
log_file /var/log/ftagent.log Log file path
log_level "INFO" Log level: DEBUG, INFO, WARNING, ERROR
dynamic_threshold true Auto-adjust detection threshold from traffic baseline
baseline_window_minutes 60 Rolling window for baseline calculation
threshold_multiplier 3.0 Alert when PPS exceeds baseline × multiplier
heartbeat_interval 30 Seconds between heartbeat pings
metrics_interval 10 Seconds between metrics reports

CLI flags

sudo ftagent [options]

  --setup            Interactive setup wizard (creates config)
  --install-service  Install systemd service unit
  --config PATH      Config file path (default: /etc/ftagent/config.json)
  --test             Test API connectivity and exit
  --version          Show version

How it works

  1. Baseline: The agent collects traffic metrics and establishes a normal PPS/BPS range for the node.
  2. L3/L4 Detection: Each metrics window is compared against the baseline. If PPS exceeds baseline x multiplier, an incident is opened.
  3. L7 Detection: When enabled, the agent tails your web server access log (nginx, Apache, Caddy, LiteSpeed, HAProxy) and detects HTTP floods via request rate spikes, IP concentration, endpoint targeting, and error rate analysis.
  4. Classification: Attack traffic is classified by protocol distribution, TCP flags, port patterns, packet size, and IP entropy.
  5. PCAP: A packet capture starts immediately when an incident opens, giving you forensic data for analysis.
  6. Reporting: The incident is reported to Flowtriq which dispatches alerts to your configured channels (Discord, Slack, Teams, PagerDuty, etc.).
  7. Mitigation: If you have mitigation rules configured, the agent executes approved firewall commands (iptables, Cloudflare WAF, etc.) immediately.
  8. Resolution: When traffic returns to baseline, the incident is closed, undo commands run, and the PCAP is uploaded.

Docs

Full documentation: flowtriq.com/docs


Support

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ftagent-1.6.4.tar.gz (30.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ftagent-1.6.4-py3-none-any.whl (28.6 kB view details)

Uploaded Python 3

File details

Details for the file ftagent-1.6.4.tar.gz.

File metadata

  • Download URL: ftagent-1.6.4.tar.gz
  • Upload date:
  • Size: 30.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.10

File hashes

Hashes for ftagent-1.6.4.tar.gz
Algorithm Hash digest
SHA256 b77c3d6d92abffe68d188b3c17324ae7a9f89121b4711307f2e2c9aff83b1d02
MD5 f4c5aedf80950112baabd0457b42305c
BLAKE2b-256 e8aaee7533784c8b9c2560b01dd46441d6b4cad7e48c11e869dc4c533395cf51

See more details on using hashes here.

File details

Details for the file ftagent-1.6.4-py3-none-any.whl.

File metadata

  • Download URL: ftagent-1.6.4-py3-none-any.whl
  • Upload date:
  • Size: 28.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.10

File hashes

Hashes for ftagent-1.6.4-py3-none-any.whl
Algorithm Hash digest
SHA256 bdb58c069d84e298ba34e6ae796d1d9c47a8e0bc0d679cabc32a8e7da4cfe234
MD5 4b1dd72797f0818e60625a17285ccf7a
BLAKE2b-256 9b368096fd2c90ef26b1eff0e8efc1c122dd7d37d7ddea23b2fcc60c5a165233

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page