Commit graph

56 commits

Author SHA1 Message Date
22bc52d665 Merge pull request 'feature/handle-python-exceptions' (#5) from feature/handle-python-exceptions into master
Reviewed-on: #5
2020-11-24 23:10:37 +01:00
31f0901134 Fix bugs and improve command line argument parsing and error handling. 2020-11-24 23:07:38 +01:00
70d41673f7 Try and handle python exceptions more gracefully. 2020-11-24 22:10:28 +01:00
a1d5821cc7 Merge pull request 'Fix silly, SILLY syntax error.' (#4) from bugfix/syntax-error into master
Reviewed-on: #4
2020-11-24 22:09:58 +01:00
b3afda4932 Fix silly, SILLY syntax error. 2020-11-24 22:08:37 +01:00
142db098be Merge pull request 'feature/config-file' (#3) from feature/config-file into master
Reviewed-on: #3
2020-11-24 21:35:12 +01:00
5078363348 Harmonize parameter processing order. 2020-11-24 21:28:30 +01:00
f5180a5e57 Improve parameter validation. 2020-11-24 21:28:30 +01:00
11ad1b471a Change the way default parameters are set. 2020-11-24 21:28:28 +01:00
8e0f22da8f Make it actually work.
To do: validate input from config file.
2020-11-24 21:28:24 +01:00
0871a25bf7 Add the possibility of using a config file instead of CLI parameters. 2020-11-24 21:28:15 +01:00
b65bd6ea55 Merge pull request 'feature/ss-instead-of-netstat' (#2) from feature/ss-instead-of-netstat into master
Reviewed-on: #2
2020-09-18 14:24:41 +02:00
36a5fbc2e5 Remove leftover comment. 2020-09-18 14:16:42 +02:00
2f58a65f7b Cosmetics. 2020-09-18 14:14:56 +02:00
877a2723e5 Minor bugfix: Don't trip if there is NOTHING to block. 2020-09-18 14:14:56 +02:00
7f3432672b Complete the frame :) 2020-09-18 14:14:56 +02:00
265507452c Omit empty lines. 2020-09-18 14:14:56 +02:00
11c246b02c Use ss instead of netstat. 2020-09-18 14:14:56 +02:00
3a15ac1ba3 Fiddling around with ss and grep. 2020-09-18 14:14:53 +02:00
c4600f34b6 Add the magic command as a comment. Now we can build upon that. 2020-09-18 14:12:04 +02:00
0c2f8efe6d Merge pull request 'Update description.' (#1) from feature/fix-description into master
Reviewed-on: #1
2020-09-18 14:11:38 +02:00
8fa1414f18 Update description. 2020-09-18 14:10:21 +02:00
f2c8ad8b9d Fix typo. 2020-09-18 14:08:21 +02:00
e8280e5916 Reword help message. 2020-09-17 11:47:43 +02:00
bfbbe0c976 Reformatting. 2020-09-17 11:47:43 +02:00
a396d1cf4e Add .editorconfig file and implement dependency check that can be
invoked from the command line.
2020-09-17 11:47:43 +02:00
7328bbac8f Support a list of countries to ban. 2020-09-17 11:47:43 +02:00
131f847d6a Make the port configurable, defaulting to 443. 2020-09-17 11:47:43 +02:00
6ca00b6bc6 Show the duration of the run in seconds when the scripts exits sucessfully. 2020-09-17 11:47:43 +02:00
70e98dd26d Correctly invoke geoip-lookup.py with respect to the CWD. 2020-09-17 11:47:43 +02:00
fa489db45f Output country when not banning. 2020-09-17 11:47:43 +02:00
b081efa877 Typo. 2020-09-17 11:47:43 +02:00
fd3b719cb2 Bugfix. 2020-09-17 11:47:43 +02:00
758e53a270 Implement local DB queries instead of whois. 2020-09-17 11:47:43 +02:00
df9f54dcab Check for python to be installed. 2020-09-17 11:47:43 +02:00
30e53268f5 Prepare reading the database path from the command line. 2020-09-17 11:47:43 +02:00
d735372872 Add python script for GeoIP2 database lookup. 2020-09-17 11:47:43 +02:00
e46a378460 "Cherry-pick" (manually) some of the refactoring. 2020-09-17 11:47:43 +02:00
c5dc76f8eb Rename some functions, list prerequisites. 2020-09-17 11:47:43 +02:00
ea0fae026a FIx it, use sponge. 2020-09-17 11:47:43 +02:00
8d193c0122 Filter already banned addresses in order to avoid unnecessary work. 2020-09-17 11:47:42 +02:00
e12361472b Implement command line option to specify the fail2ban jail to use. 2020-09-17 11:47:42 +02:00
d33c43030d Omit the use of sudo when running as root. 2020-09-17 11:47:42 +02:00
771531167c Nicer output formatting and early abort when the autopilot limit is reached. 2020-09-17 11:47:42 +02:00
4ef0b60ed1 Rename/move superscript.sh to ddos-mitigator.sh. 2020-09-17 11:47:42 +02:00
9b82a8944d Suppress output of popd and implement the help text. 2020-09-17 11:47:42 +02:00
9a929d440c Suppress output of dirs when calling pushd. 2020-09-17 11:47:42 +02:00
a92e7a90b5 Add autopilot mode and CLI parameter selection of to-be-banned subnet class.
Help needs to be implemented.
2020-09-17 11:47:42 +02:00
c97d3172aa If country = CN and source = APNIC, show a red alert message. 2020-09-17 11:47:42 +02:00
d27842fa4e cleanup 2020-09-17 11:47:42 +02:00