Skip to content

Commit

Permalink
improved iptables example
Browse files Browse the repository at this point in the history
  • Loading branch information
R. S. Doiel committed Jan 24, 2025
1 parent f0569c3 commit 0b671fd
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,15 @@ Here's an example configuration YAML file.
~~~yaml
- tag: BadBot
action: |
sudo iptables
-I logagent_badbot
-p tcp -m multiport
--dports http,https
-J REJECT
--reject-with imcp-port-unreachable
-s {ipaddress}
sudo iptables -A INPUT -p tcp -m multiport
--dports 80,443 -s {ipaddress} -j DROP
~~~

If the text "BadBot" is found in the log line. and the IP address "156.59.198.136" was found in the log line then the following command would be executed.

~~~shell
sudo iptables -I logagent_badbot \
-p tcp -m multiport \
--dports http,https \
-j REJECT --reject-with icmp-port-unreachable \
-s 156.59.198.136
sudo iptables -A INPUT -p tcp -m multiport
--dports 80,443 -s 156.59.198.136 -j DROP
~~~

# USAGE:
Expand Down

0 comments on commit 0b671fd

Please sign in to comment.