A Python application that updates your security group based off of your current IP address. Currently being expanded to more than just AWS provider.
|
|
||
|---|---|---|
| .gitignore | ||
| cloud-fw-ip-updater.py | ||
| LICENSE | ||
| Pipfile | ||
| Pipfile.lock | ||
| README.md | ||
Cloud Firewall IP Updater
A Python application that updates a cloud provider firewall/security group based off of your current IP address.
Prerequisites
- Python 3.13
- pipenv is used for environment management.
- AWS - Profile configured with a default profile specified has necessary permissions to update an EC2 Security Group (you can have this setup without having AWSCLI installed see HERE
- Digital Ocean - An API Token with proper access to Firewall API. Instructions HERE for how to create
How do I get set up?
- Run
pipenv installto install the python requirements listed in Pipefile/Pipfile.lock in a new virtual environment. Make sure to install pipenv from above link before this.
Running the script
Before you can run the program you will need to activate/enter your python virtual environment using pipenv shell then run the following commands.
For AWS
python cloud-fw-ip-updater.py --cloud aws --fw_id sg-abc123456
For Digital Ocean
python cloud-fw-ip-updater.py --cloud do --fw_id AAAAAAAA-BBBB-CCCC-DDDD-EEEEEEEEEEEE --do_token XXXXXXXXXXXXXXXXXXXXX
To display your current ip.
python cloud-fw-ip-updater.py --ip_check
ToDo
- Add in functionality to be able to pass in which AWSCLI profile you want to use
Details
I frequently use a VPN, especially when on public or unknown Wi-Fi. For this reason I was always having to login to various Cloud providers console to update the cloud firewall updating my IP. I decided to write this python script to solve this problem.