Created
January 9, 2023 10:25
-
-
Save marios88/2a7d5c211e8f09b89abfad1e5bce7b6c to your computer and use it in GitHub Desktop.
Scan docker logs and ban ip v4 based on resolved RDNS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker logs --tail 1000 docker-ahttpd-1 | grep 'sitemap-pt' | awk '{print $1}' | uniq | xargs -i sh -c 'echo -n "{} _ " && dig -x {} +short' | grep -i 'banRDNSHERE\|server\|seznam' | awk '{print $1}' | xargs -i iptables -I INPUT -s {} -j DROP |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment