Skip to content
This repository has been archived by the owner on Feb 22, 2022. It is now read-only.

Update DigitalOcean firewall with current public IP address

License

Notifications You must be signed in to change notification settings

timcappalli/digitalocean-firewall-update

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DigitalOcean Firewall Update

version 2018.01 License

Overview

This Python script will add an inbound rule to DigitalOcean firewall. An IP address (v4 or v6) can be passed to the script or the local machine's public IPv4 and/or IPv6 address can be detected and passed to the script.

Current Version

2018.01 (2018-11-12)

Dependencies

  • DigitalOcean tenant with existing firewall
  • DigitalOcean API key
  • Python 3
  • Modules: requests, json, os, configparser, argparse

Configuration

The configuration file is config.cfg

Required

Usage

python3 update_firewall.py <tcp|udp|icmp> <port|range|all> <me|ipaddr>

Passing 'me' instead of an IP address as the third parameter will auto detect the IPv4 and/or IPv6 address(es) of the local machine and use it as the source address the firewall rule.

License and Other Information

This repo is licensed under the MIT License - see the LICENSE file for details

Author: @timcappalli