Skip to content

​IPSetter is a simple tool that allows you to change a specific Security Group rule on AWS via description.

License

Notifications You must be signed in to change notification settings

Havivw/AWS_SG_Update_rules

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IPSetter

IPSetter is a simple tool that allow you to change a specific rule in Security Group on AWS via description.

Prerequisites

Create Api key on AWS with at least that policy.

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "VisualEditor0",
            "Effect": "Allow",
            "Action": [
                "ec2:RevokeSecurityGroupIngress",
                "ec2:AuthorizeSecurityGroupEgress",
                "ec2:AuthorizeSecurityGroupIngress",
                "ec2:UpdateSecurityGroupRuleDescriptionsEgress",
                "ec2:RevokeSecurityGroupEgress",
                "ec2:UpdateSecurityGroupRuleDescriptionsIngress",
                "ec2:DescribeSecurityGroup"
            ],
            "Resource": "arn:aws:ec2:eu-central-1:xxxxxx"
        }
    ]

IPSetter Installation

Download the IPSetter folder and install with pip. ​

$ sudo pip3 install .

Supported ​

  • Windows
  • Linux

config file

change ipsetter/consts.py

```
SG_ID = 'sg-xxx'
AWS_ACCESS_KEY_ID = 'xxx'
AWS_SECRET_ACCESS_KEY = 'xxxxx'
AWS_USER_IN_DESCRIPTION = 'description'
REGION_NAME = 'eu-central-1'

```

Run

With default value

Linux

 $ ipsetter
 INFO - Run Change IP Address on PT-GroupPolicy (Default) Security Group on AWS.
 INFO - changed {'CidrIp': 'x.x.x.x/32', 'Description': 'Haviv'} to {'CidrIp': 'y.y.y.y/32', 'Description': 'Haviv'} Success!.

Windows

 c:\> ipsetter
 INFO - Run Change IP Address on PT-GroupPolicy (Default) Security Group on AWS.
 ERROR - Your IP x.x.x.x/32 is already exists on the Security Group!

Help

ipsetter -h
usage: ipsetter [-h] [--name NAME] [--ip IP]

Amazon Security Group Updater

optional arguments:
  -h, --help            show this help message and exit
  --name NAME, -n NAME  The user's name (The description in the security group)
  --ip IP, -i IP        The specific IP adress to set for your security group. default: current external ip

Contributions..

​ ..are always welcome.

About

​IPSetter is a simple tool that allows you to change a specific Security Group rule on AWS via description.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages