ftagent 1.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
ftagent-1.1.0/LICENSE ADDED
@@ -0,0 +1,10 @@
1
+ Copyright (c) 2026 Flowtriq (https://flowtriq.com)
2
+
3
+ All rights reserved.
4
+
5
+ This software and its source code are proprietary to Flowtriq.
6
+ Redistribution, modification, or use outside of a valid Flowtriq
7
+ subscription is not permitted without explicit written authorization
8
+ from Flowtriq.
9
+
10
+ For licensing inquiries: hello@flowtriq.com
ftagent-1.1.0/PKG-INFO ADDED
@@ -0,0 +1,186 @@
1
+ Metadata-Version: 2.1
2
+ Name: ftagent
3
+ Version: 1.1.0
4
+ Summary: Flowtriq DDoS Detection Agent — real-time traffic monitoring, incident detection, PCAP capture, and auto-mitigation
5
+ Author-email: Flowtriq <hello@flowtriq.com>
6
+ License: Other/Proprietary License
7
+ Project-URL: Homepage, https://flowtriq.com
8
+ Project-URL: Repository, https://github.com/flowtriq/ftagent
9
+ Project-URL: Documentation, https://flowtriq.com/docs
10
+ Project-URL: Bug Tracker, https://github.com/flowtriq/ftagent/issues
11
+ Keywords: ddos,network,monitoring,security,ids,traffic,detection
12
+ Classifier: Development Status :: 5 - Production/Stable
13
+ Classifier: Environment :: Console
14
+ Classifier: Intended Audience :: System Administrators
15
+ Classifier: License :: Other/Proprietary License
16
+ Classifier: Operating System :: POSIX :: Linux
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Programming Language :: Python :: 3.8
19
+ Classifier: Programming Language :: Python :: 3.9
20
+ Classifier: Programming Language :: Python :: 3.10
21
+ Classifier: Programming Language :: Python :: 3.11
22
+ Classifier: Programming Language :: Python :: 3.12
23
+ Classifier: Topic :: System :: Monitoring
24
+ Classifier: Topic :: System :: Networking :: Monitoring
25
+ Classifier: Topic :: Security
26
+ Requires-Python: >=3.8
27
+ Description-Content-Type: text/markdown
28
+ License-File: LICENSE
29
+ Requires-Dist: requests>=2.28.0
30
+ Provides-Extra: full
31
+ Requires-Dist: requests>=2.28.0; extra == "full"
32
+ Requires-Dist: scapy>=2.4.5; extra == "full"
33
+ Requires-Dist: psutil>=5.9.0; extra == "full"
34
+ Requires-Dist: colorama>=0.4.6; extra == "full"
35
+ Provides-Extra: capture
36
+ Requires-Dist: scapy>=2.4.5; extra == "capture"
37
+ Provides-Extra: metrics
38
+ Requires-Dist: psutil>=5.9.0; extra == "metrics"
39
+ Provides-Extra: color
40
+ Requires-Dist: colorama>=0.4.6; extra == "color"
41
+
42
+ # ftagent
43
+
44
+ **Flowtriq DDoS Detection Agent** — real-time traffic monitoring, attack detection, PCAP capture, and auto-mitigation for Linux servers.
45
+
46
+ A valid [Flowtriq](https://flowtriq.com) account and API key are required. Start a free 7-day trial at **[flowtriq.com](https://flowtriq.com)**.
47
+
48
+ ---
49
+
50
+ ## Requirements
51
+
52
+ - Linux (Ubuntu 20.04+, Debian 11+, CentOS 8+, or equivalent)
53
+ - Python 3.8+
54
+ - Root / sudo (required for raw packet capture)
55
+ - A Flowtriq account — [sign up free](https://flowtriq.com/signup)
56
+
57
+ ---
58
+
59
+ ## Install
60
+
61
+ ### pip (recommended)
62
+
63
+ ```bash
64
+ pip install ftagent[full]
65
+ ```
66
+
67
+ The `[full]` extra installs all dependencies including `scapy` for packet capture and `psutil` for system metrics.
68
+
69
+ ### From source
70
+
71
+ ```bash
72
+ git clone https://github.com/flowtriq/ftagent.git
73
+ cd ftagent
74
+ pip install -e .[full]
75
+ ```
76
+
77
+ ---
78
+
79
+ ## Quick start
80
+
81
+ ### 1. Get your API key
82
+
83
+ Log in to your [Flowtriq dashboard](https://flowtriq.com/dashboard) → **Nodes** → **Add Node** → copy the API key shown.
84
+
85
+ ### 2. Create the config
86
+
87
+ ```bash
88
+ sudo mkdir -p /etc/ftagent
89
+ sudo cp packaging/config.example.json /etc/ftagent/config.json
90
+ sudo nano /etc/ftagent/config.json
91
+ ```
92
+
93
+ Set `api_key` to your key. Leave `node_uuid` empty — the agent will register the node automatically on first run.
94
+
95
+ ### 3. Run
96
+
97
+ ```bash
98
+ sudo ftagent
99
+ ```
100
+
101
+ Or with the Python module:
102
+
103
+ ```bash
104
+ sudo python3 -m ftagent
105
+ ```
106
+
107
+ The agent will register your node, establish a baseline, and begin monitoring. Your node will appear in the Flowtriq dashboard within 30 seconds.
108
+
109
+ ---
110
+
111
+ ## Install as a systemd service
112
+
113
+ ```bash
114
+ sudo cp packaging/ftagent.service /etc/systemd/system/ftagent.service
115
+ sudo systemctl daemon-reload
116
+ sudo systemctl enable ftagent
117
+ sudo systemctl start ftagent
118
+
119
+ # Check status
120
+ sudo systemctl status ftagent
121
+ sudo journalctl -u ftagent -f
122
+ ```
123
+
124
+ ---
125
+
126
+ ## Configuration reference
127
+
128
+ Config file: `/etc/ftagent/config.json`
129
+
130
+ | Key | Default | Description |
131
+ |---|---|---|
132
+ | `api_key` | — | **Required.** Your Flowtriq node API key |
133
+ | `node_uuid` | `""` | Auto-populated on first run. Do not change. |
134
+ | `api_base` | `https://flowtriq.com/api/v1` | API endpoint |
135
+ | `interface` | `"auto"` | Network interface to monitor (`eth0`, `ens3`, etc.) or `"auto"` |
136
+ | `pcap_enabled` | `true` | Enable PCAP capture during incidents |
137
+ | `pcap_dir` | `/var/lib/ftagent/pcaps` | Directory for PCAP files |
138
+ | `pcap_max_packets` | `10000` | Max packets per PCAP file |
139
+ | `pcap_max_seconds` | `60` | Max seconds per PCAP file |
140
+ | `pcap_retention_days` | `7` | Delete PCAPs older than N days |
141
+ | `log_file` | `/var/log/ftagent.log` | Log file path |
142
+ | `log_level` | `"INFO"` | Log level: `DEBUG`, `INFO`, `WARNING`, `ERROR` |
143
+ | `dynamic_threshold` | `true` | Auto-adjust detection threshold from traffic baseline |
144
+ | `baseline_window_minutes` | `60` | Rolling window for baseline calculation |
145
+ | `threshold_multiplier` | `3.0` | Alert when PPS exceeds `baseline × multiplier` |
146
+ | `heartbeat_interval` | `30` | Seconds between heartbeat pings |
147
+ | `metrics_interval` | `10` | Seconds between metrics reports |
148
+
149
+ ---
150
+
151
+ ## CLI flags
152
+
153
+ ```
154
+ sudo ftagent [options]
155
+
156
+ --config PATH Config file path (default: /etc/ftagent/config.json)
157
+ --interface IFACE Override interface from config
158
+ --test Trigger a synthetic detection event and exit
159
+ --version Show version
160
+ ```
161
+
162
+ ---
163
+
164
+ ## How it works
165
+
166
+ 1. **Baseline** — The agent collects traffic metrics for the configured baseline window and establishes a normal PPS/BPS range for the node.
167
+ 2. **Detection** — Each 10-second metrics window is compared against the baseline. If PPS exceeds `baseline × multiplier`, an incident is opened.
168
+ 3. **Classification** — Attack traffic is classified by protocol distribution, port patterns, packet size, and IP entropy to identify the attack family.
169
+ 4. **PCAP** — A packet capture starts immediately when an incident opens, giving you forensic data for analysis.
170
+ 5. **Reporting** — The incident is reported to Flowtriq which dispatches alerts to your configured channels (Discord, Slack, Teams, PagerDuty, etc.).
171
+ 6. **Mitigation** — If you have mitigation rules configured, the agent executes approved firewall commands (iptables, Cloudflare WAF, etc.) immediately.
172
+ 7. **Resolution** — When PPS drops back to baseline, the incident is closed, undo commands run, and the PCAP is uploaded.
173
+
174
+ ---
175
+
176
+ ## Docs
177
+
178
+ Full documentation: [flowtriq.com/docs](https://flowtriq.com/docs)
179
+
180
+ ---
181
+
182
+ ## Support
183
+
184
+ - Docs: [flowtriq.com/docs](https://flowtriq.com/docs)
185
+ - Issues: [github.com/flowtriq/ftagent/issues](https://github.com/flowtriq/ftagent/issues)
186
+ - Email: [hello@flowtriq.com](mailto:hello@flowtriq.com)
@@ -0,0 +1,145 @@
1
+ # ftagent
2
+
3
+ **Flowtriq DDoS Detection Agent** — real-time traffic monitoring, attack detection, PCAP capture, and auto-mitigation for Linux servers.
4
+
5
+ A valid [Flowtriq](https://flowtriq.com) account and API key are required. Start a free 7-day trial at **[flowtriq.com](https://flowtriq.com)**.
6
+
7
+ ---
8
+
9
+ ## Requirements
10
+
11
+ - Linux (Ubuntu 20.04+, Debian 11+, CentOS 8+, or equivalent)
12
+ - Python 3.8+
13
+ - Root / sudo (required for raw packet capture)
14
+ - A Flowtriq account — [sign up free](https://flowtriq.com/signup)
15
+
16
+ ---
17
+
18
+ ## Install
19
+
20
+ ### pip (recommended)
21
+
22
+ ```bash
23
+ pip install ftagent[full]
24
+ ```
25
+
26
+ The `[full]` extra installs all dependencies including `scapy` for packet capture and `psutil` for system metrics.
27
+
28
+ ### From source
29
+
30
+ ```bash
31
+ git clone https://github.com/flowtriq/ftagent.git
32
+ cd ftagent
33
+ pip install -e .[full]
34
+ ```
35
+
36
+ ---
37
+
38
+ ## Quick start
39
+
40
+ ### 1. Get your API key
41
+
42
+ Log in to your [Flowtriq dashboard](https://flowtriq.com/dashboard) → **Nodes** → **Add Node** → copy the API key shown.
43
+
44
+ ### 2. Create the config
45
+
46
+ ```bash
47
+ sudo mkdir -p /etc/ftagent
48
+ sudo cp packaging/config.example.json /etc/ftagent/config.json
49
+ sudo nano /etc/ftagent/config.json
50
+ ```
51
+
52
+ Set `api_key` to your key. Leave `node_uuid` empty — the agent will register the node automatically on first run.
53
+
54
+ ### 3. Run
55
+
56
+ ```bash
57
+ sudo ftagent
58
+ ```
59
+
60
+ Or with the Python module:
61
+
62
+ ```bash
63
+ sudo python3 -m ftagent
64
+ ```
65
+
66
+ The agent will register your node, establish a baseline, and begin monitoring. Your node will appear in the Flowtriq dashboard within 30 seconds.
67
+
68
+ ---
69
+
70
+ ## Install as a systemd service
71
+
72
+ ```bash
73
+ sudo cp packaging/ftagent.service /etc/systemd/system/ftagent.service
74
+ sudo systemctl daemon-reload
75
+ sudo systemctl enable ftagent
76
+ sudo systemctl start ftagent
77
+
78
+ # Check status
79
+ sudo systemctl status ftagent
80
+ sudo journalctl -u ftagent -f
81
+ ```
82
+
83
+ ---
84
+
85
+ ## Configuration reference
86
+
87
+ Config file: `/etc/ftagent/config.json`
88
+
89
+ | Key | Default | Description |
90
+ |---|---|---|
91
+ | `api_key` | — | **Required.** Your Flowtriq node API key |
92
+ | `node_uuid` | `""` | Auto-populated on first run. Do not change. |
93
+ | `api_base` | `https://flowtriq.com/api/v1` | API endpoint |
94
+ | `interface` | `"auto"` | Network interface to monitor (`eth0`, `ens3`, etc.) or `"auto"` |
95
+ | `pcap_enabled` | `true` | Enable PCAP capture during incidents |
96
+ | `pcap_dir` | `/var/lib/ftagent/pcaps` | Directory for PCAP files |
97
+ | `pcap_max_packets` | `10000` | Max packets per PCAP file |
98
+ | `pcap_max_seconds` | `60` | Max seconds per PCAP file |
99
+ | `pcap_retention_days` | `7` | Delete PCAPs older than N days |
100
+ | `log_file` | `/var/log/ftagent.log` | Log file path |
101
+ | `log_level` | `"INFO"` | Log level: `DEBUG`, `INFO`, `WARNING`, `ERROR` |
102
+ | `dynamic_threshold` | `true` | Auto-adjust detection threshold from traffic baseline |
103
+ | `baseline_window_minutes` | `60` | Rolling window for baseline calculation |
104
+ | `threshold_multiplier` | `3.0` | Alert when PPS exceeds `baseline × multiplier` |
105
+ | `heartbeat_interval` | `30` | Seconds between heartbeat pings |
106
+ | `metrics_interval` | `10` | Seconds between metrics reports |
107
+
108
+ ---
109
+
110
+ ## CLI flags
111
+
112
+ ```
113
+ sudo ftagent [options]
114
+
115
+ --config PATH Config file path (default: /etc/ftagent/config.json)
116
+ --interface IFACE Override interface from config
117
+ --test Trigger a synthetic detection event and exit
118
+ --version Show version
119
+ ```
120
+
121
+ ---
122
+
123
+ ## How it works
124
+
125
+ 1. **Baseline** — The agent collects traffic metrics for the configured baseline window and establishes a normal PPS/BPS range for the node.
126
+ 2. **Detection** — Each 10-second metrics window is compared against the baseline. If PPS exceeds `baseline × multiplier`, an incident is opened.
127
+ 3. **Classification** — Attack traffic is classified by protocol distribution, port patterns, packet size, and IP entropy to identify the attack family.
128
+ 4. **PCAP** — A packet capture starts immediately when an incident opens, giving you forensic data for analysis.
129
+ 5. **Reporting** — The incident is reported to Flowtriq which dispatches alerts to your configured channels (Discord, Slack, Teams, PagerDuty, etc.).
130
+ 6. **Mitigation** — If you have mitigation rules configured, the agent executes approved firewall commands (iptables, Cloudflare WAF, etc.) immediately.
131
+ 7. **Resolution** — When PPS drops back to baseline, the incident is closed, undo commands run, and the PCAP is uploaded.
132
+
133
+ ---
134
+
135
+ ## Docs
136
+
137
+ Full documentation: [flowtriq.com/docs](https://flowtriq.com/docs)
138
+
139
+ ---
140
+
141
+ ## Support
142
+
143
+ - Docs: [flowtriq.com/docs](https://flowtriq.com/docs)
144
+ - Issues: [github.com/flowtriq/ftagent/issues](https://github.com/flowtriq/ftagent/issues)
145
+ - Email: [hello@flowtriq.com](mailto:hello@flowtriq.com)
@@ -0,0 +1,9 @@
1
+ """
2
+ ftagent — Flowtriq DDoS Detection Agent
3
+ https://flowtriq.com
4
+ """
5
+
6
+ from ftagent.agent import VERSION, main
7
+
8
+ __version__ = VERSION
9
+ __all__ = ["VERSION", "main"]