https://github.com/emnsen/basic-nginx-fw
Block crawl(bad bot) bot requests
https://github.com/emnsen/basic-nginx-fw
basic-nginx-fw crawl-block firewall ipblock nginx nginx-firewall nginx-ip-filter ubuntu
Last synced: 2 months ago
JSON representation
Block crawl(bad bot) bot requests
- Host: GitHub
- URL: https://github.com/emnsen/basic-nginx-fw
- Owner: emnsen
- Created: 2019-01-03T12:06:22.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-01-03T12:13:33.000Z (over 7 years ago)
- Last Synced: 2025-01-20T06:47:19.298Z (over 1 year ago)
- Topics: basic-nginx-fw, crawl-block, firewall, ipblock, nginx, nginx-firewall, nginx-ip-filter, ubuntu
- Language: Python
- Homepage:
- Size: 2.93 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
#### Usage
```bash
sudo apt install ipset iptables
ipset create blacklist hash:ip
iptables -A FORWARD -m set --match-set blacklist src -j DROP
chmod +x parser.py logfilter.sh run.sh
chmod -R 777 ips/ logs/ results/
./parser.py
```
#### Cron
```bash
*/5 * * * * /usr/bin/python3.5 /PATH/parser.py >> /PATH/cron.log 2>&1
```
**Notes:**
1. If you are going to use the root user crontab IN, do not forget to manually assign the **BASE_PATH** variable.
2. Nginx log path variable: **ACCESS_LOG_FILE** in parser.py
3. The last 5 minutes are scanned. Check out the logfilter.sh file if you want to change it