Giter Site home page Giter Site logo

piyushsonigra / aws_ipadd Goto Github PK

View Code? Open in Web Editor NEW
38.0 2.0 15.0 18 KB

Whitelist and manage your public IP address in the AWS security group

License: MIT License

Dockerfile 7.85% Makefile 5.43% Python 86.73%
aws security-group security-group-rules whitelist port ipadd ip-whitelisting

aws_ipadd's Introduction

Actions Status

aws_ipadd

Add or Whitelist inbound IP and Port in AWS security group and manage AWS security group rules with aws_ipadd command. It makes easy to add your public ip into security group to access AWS resource. Whenever your public ip change, You can easily update new public ip into security group and aws_ipadd command will manage security group rule for you. It's very helpful when you are accessing aws resources that needs public ip whitelisting in security group to access and your public ip is continously changed.

OS Support

Currently aws_ipadd supports the following Operating System

  • Mac OS X (64bit)
  • Linux (64bit)

๐Ÿš€ Installation

Download aws_ipadd for your operating system

Linux

wget -c https://github.com/piyushsonigra/aws_ipadd/releases/latest/download/aws_ipadd_linux_x64.tar.gz -O - | tar -xz -C /usr/local/bin/

OSX

wget -c https://github.com/piyushsonigra/aws_ipadd/releases/latest/download/aws_ipadd_osx_x64.tar.gz -O - | tar -xz -C /usr/local/bin/

Note: If you get errors related to permission or access, Please run command with sudo.

configuration

Run below commands to conifgure aws_ipadd command.

Create directory ~/.aws_ipadd at your home directory.

mkdir ~/.aws_ipadd

Create configuration file aws_ipadd inside ~/.aws_ipadd.

touch ~/.aws_ipadd/aws_ipadd

Edit the ~/.aws_ipadd/aws_ipadd file and add below Informations as shown in sample configuration file. You can also checkout the config-example.txt file in the project for multi profile configuration.

  • aws_ipadd profile name in []: my_project_mysql and my_project_ssh is aws_ipadd profiles to identify configuration which security group rule need to update with port, IP, rule_name and security group region for different AWS account profiles.

  • aws_profile: aws_profile is name of AWS profile configured for awscli.

  • region_name: AWS region name in which security group is present.

  • security_group_id: AWS security group id.

  • rule_name: AWS security group rule name to identify rule purpose.

  • protocol: Port protocol name i.e TCP, UDP or valid port protocol that security group accept.

  • port: Network port to whitelist with IP.

Below is the sample configuration of ~/.aws_ipadd/aws_ipadd file.

$ cat ~/.aws_ipadd/aws_ipadd
[my_project_ssh]
aws_profile = my_project
security_group_id = sg-d26fdre9d
protocol = TCP
port = 22
rule_name = my_office_ssh
region_name = us-east-1

[my_project_mysql]
aws_profile = my_project
security_group_id = sg-dfg9dwe
protocol = TCP
port = 3306
rule_name = my_office_mysql
region_name = us-east-1

Usage

Run the aws_ipadd command with aws_ipadd profile.

$ aws_ipadd my_project_ssh
  Your IP 12.10.1.14/32 and Port 22 is whitelisted successfully.

If your public IP is changed, aws_ipadd will update aws security group rule with your current public IP.

$ aws_ipadd my_project_ssh
  ---------------
  my_project_ssh
  ---------------
  Modifying existing rule...
  Removing old whitelisted IP '12.10.1.14/32'.
  Whitelisting new IP '131.4.10.16/32'.
  Rule successfully updated!

You can also configure cronjob to check and keep whitelisted your Public IP in one or more security groups.

# Run every hour
* */1 * * * /usr/local/bin/aws_ipadd project_ssh project_rdp

Feature Update

Now you can run multiple profiles/configurations at once. Don't forget to update the config file, with relative configurations. Check config-example.txt file for reference.

$ aws_ipadd prod test dev stage

Licence

Thanks

aws_ipadd's People

Contributors

amit10may avatar piyushsonigra avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

aws_ipadd's Issues

Checking how does it know existing IP and modifies with new IP

First time when we add it creates new rule with IP in the security group, for the second time it successfully modifies the existing IP with new IP. I am wondering how does it exactly knows the existing IP address and modifies are we storing this old IP data elsewhere?

It would be helpful if you can explain me this here....

All traffic rule

Do you plan to add this feature instead of basic protocol port rules?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.