Skip to content

Commit 66390be

Browse files
committed
ENHANCEMENT:
- New service / plugin "Firewall" CHANGES: - Moved DDoS detection from Monitoring to Firewall service
1 parent f824683 commit 66390be

23 files changed

Lines changed: 3374 additions & 2908 deletions

README.md

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,19 @@ A service is a component that runs on each node.
3838
Services can be combined with plugins if they provide additional Discord commands, like the Music service.
3939
Some services only run on the master node, like the Bot-service, for instance.
4040

41-
| Service | Scope | Plugin | Documentation |
42-
|:------------|:-----------------------------------------------------------|:------------|:------------------------------------------|
43-
| Backup | Backups for bot- & DCS-config, missions, databases, etc. | Backup | [README](./services/backup/README.md) |
44-
| Bot | Discord bot, with optional Discord-free variant available. | | [README](./services/bot/README.md) |
45-
| Cleanup | Clears files from disk, channels in Discord. | | [README](./services/cleanup/README.md) |
46-
| Cron | Task scheduling based on a cron-like config. | | [README](./services/cron/README.md) |
47-
| Dashboard | Console graphics to display bot/server status. | | [README](./services/dashboard/README.md) |
48-
| ModManager | Manages mod installations/updates for DCS servers. | ModManager | [README](./services/modmanager/README.md) |
49-
| Monitoring | Availability and performance monitoring of DCS servers. | ServerStats | [README](./services/monitoring/README.md) |
50-
| Music | Plays music over SRS radios. | Music | [README](./services/music/README.md) |
51-
| ServiceBus | Communication between bot cluster nodes and DCS servers. | | [README](./services/servicebus/README.md) |
52-
| WebService | Simple webserver for REST-endpoints & embedded websites. | | [README](./services/webservice/README.md) |
41+
| Service | Scope | Plugin | Documentation |
42+
|:-----------|:-----------------------------------------------------------|:------------|:------------------------------------------|
43+
| Backup | Backups for bot- & DCS-config, missions, databases, etc. | Backup | [README](./services/backup/README.md) |
44+
| Bot | Discord bot, with optional Discord-free variant available. | | [README](./services/bot/README.md) |
45+
| Cleanup | Clears files from disk, channels in Discord. | | [README](./services/cleanup/README.md) |
46+
| Cron | Task scheduling based on a cron-like config. | | [README](./services/cron/README.md) |
47+
| Dashboard | Console graphics to display bot/server status. | | [README](./services/dashboard/README.md) |
48+
| Firewall | Firewall rule handling and DDoS detection / prevention. | Firewall | [README](./services/firewall/README.md) |
49+
| ModManager | Manages mod installations/updates for DCS servers. | ModManager | [README](./services/modmanager/README.md) |
50+
| Monitoring | Availability and performance monitoring of DCS servers. | ServerStats | [README](./services/monitoring/README.md) |
51+
| Music | Plays music over SRS radios. | Music | [README](./services/music/README.md) |
52+
| ServiceBus | Communication between bot cluster nodes and DCS servers. | | [README](./services/servicebus/README.md) |
53+
| WebService | Simple webserver for REST-endpoints & embedded websites. | | [README](./services/webservice/README.md) |
5354

5455
### Plugins
5556
A plugin is an expansion of the bot that can be controlled via Discord commands and sometimes in-game chat commands.
@@ -76,6 +77,7 @@ I enhance the bot from time to time, but you as a community member can also crea
7677
| Competitive | PvP support, TrueSkill™️ ranking system | yes | Mission | [README](./plugins/competitive/README.md) |
7778
| Debug | Debug logging for DCS Hook- and MSE-events | yes | | [README](./plugins/debug/README.md) |
7879
| Discord | Discord helper commands | yes | | [README](./plugins/discord/README.md) |
80+
| Firewall | Frontend to the Firewall service | yes | Userstats | [README](./plugins/firewall/README.md) |
7981
| FlightPlan | IFR-style flight planning, F10 map visualization | yes | | [README](./plugins/flightplan/README.md) |
8082
| FunkMan | [FunkMan](https://github.com/funkyfranky/FunkMan) support | yes | | [README](./plugins/funkman/README.md) |
8183
| GreenieBoard | Greenieboard & LSO quality mark analysis | yes | Missionstats | [README](./plugins/greenieboard/README.md) |

plugins/firewall/README.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Plugin Firewall
2+
This plugin provides DDoS protection for your DCS servers.
3+
It is the frontend to the [Firewall Service](../../services/firewall/README.md).
4+
5+
## Configuration
6+
There is no specific plugin configuration.
7+
Please see the [service documentation](../../services/firewall/README.md) for configuration.
8+
9+
## Discord Commands
10+
| Command | Parameter | Role | Description |
11+
|------------------------|-------------------------------------|-----------|---------------------------------------------------------------------------------------------------------------------------------------------------------------|
12+
| /ddos status | [server] [period] | DCS Admin | Displays DDoS detection statistics and graphs for a server or all servers. |
13+
| /ddos test start | server [protocol] [port] [duration] | Admin | Simulate a DDoS attack for testing. Triggers the full detection+blocking flow without real attack traffic. Auto-stops after `duration` seconds (default 30). |
14+
| /ddos test stop | server | Admin | Stop a running DDoS simulation on a server. |
15+
| /ddos block | node, [server] | Admin | Manually trigger DDoS blocking for a server or the whole node (omit server for node-wide). Requires action=block. |
16+
| /ddos unblock | node, [server] | Admin | Deactivate DDoS blocking for a server or the whole node (omit server for node-wide). |
17+
| /ddos whitelist add | ip | DCS Admin | Add an IP to the DDoS whitelist on all nodes (allowed during blocks). |
18+
| /ddos whitelist remove | ip | DCS Admin | Remove an IP from the DDoS whitelist on all nodes. |
19+
| /ddos blacklist add | ip | DCS Admin | Permanently block an IP address via Windows Firewall on all nodes. |
20+
| /ddos blacklist remove | ip | DCS Admin | Remove an IP from the permanent block list on all nodes. |
21+
22+
## Tables
23+
### port_traffic
24+
| Column | Type | Description |
25+
|--------------------|----------------------------------|------------------------------------------------------|
26+
| #id | SERIAL | Auto-incrementing unique ID. |
27+
| node | TEXT NOT NULL | Node name. |
28+
| server_name | TEXT NOT NULL | DCS server name. |
29+
| port | INTEGER NOT NULL | Local port number. |
30+
| protocol | TEXT NOT NULL | Protocol: 'tcp' or 'udp'. |
31+
| bytes_in | BIGINT NOT NULL DEFAULT 0 | Total bytes received (TCP only, requires admin). |
32+
| bytes_out | BIGINT NOT NULL DEFAULT 0 | Total bytes sent (TCP only, requires admin). |
33+
| packets_in | BIGINT NOT NULL DEFAULT 0 | Total packets received (TCP only, requires admin). |
34+
| packets_out | BIGINT NOT NULL DEFAULT 0 | Total packets sent (TCP only, requires admin). |
35+
| unique_ips | INTEGER NOT NULL DEFAULT 0 | Unique remote IP addresses. |
36+
| connections | INTEGER NOT NULL DEFAULT 0 | Active TCP/UDP connections. |
37+
| players | INTEGER NOT NULL DEFAULT 0 | Number of active players at collection time. |
38+
| non_player_udp_ips | INTEGER NOT NULL DEFAULT 0 | Unique non-player UDP source IPs (scapy sniff). |
39+
| under_attack | BOOLEAN NOT NULL DEFAULT FALSE | True if collected during an active DDoS attack. |
40+
| time | TIMESTAMP NOT NULL DEFAULT NOW() | Time of measurement. |

plugins/firewall/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from .version import __version__

0 commit comments

Comments
 (0)