A Python application that updates your security group based off of your current IP address. Currently being expanded to more than just AWS provider.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
prasket beebdd0e6a Merge pull request 'updated the url for IP due to connectivity with old one.' (#6) from issue-003 into main 3 months ago
.gitignore reworked script to work with AWS and Digital Ocean now using --cloud arg. Updated README as well with updated instructions. 3 months ago
LICENSE Initial commit 4 years ago
Pipfile updated to use Pipfile for pipenv, also to Python3. Will test it still works tomorrow. 4 months ago
Pipfile.lock reworked script to work with AWS and Digital Ocean now using --cloud arg. Updated README as well with updated instructions. 3 months ago
README.md reworked script to work with AWS and Digital Ocean now using --cloud arg. Updated README as well with updated instructions. 3 months ago
cloud-fw-ip-updater.py updated the url for IP due to connectivity with old one. 3 months ago

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.8
  • 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 install to 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

ToDo

  • add in more error handling especially around checking jsonip.com
  • Change response to be a friendly message vs. json output
  • 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.