Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 

README.md

AWS Blocker

This simple bash script will retrieve the official list of AWS IPv4 and IPv6 ranges, then block them all using iptables.

The script is safe to run multiple times. The AWS IP range list is updated periodically, so you may want to run this script as a cron.

Requirements

You'll need jq to parse the JSON. This package is readily available in most Linux package managers.

Usage

Usage: aws-blocker [POSITION] [REGIONS]...

Position is a nummeric value specifying the line number the INPUT chain target line will be inserted at. Defaults to 1. Without any region arguments all IP ranges will by used.

Example:

aws-blocker 3 ap-southeast sa-east

Instead of downloading a file on each run you can also redirect a file input:

aws-blocker < ranges.json

About

A simple bash script to block all AWS IP ranges using iptables.

Resources

License

Releases

No releases published

Packages

No packages published

Languages

You can’t perform that action at this time.