IPSetter is a simple tool that allow you to change a specific rule in Security Group on AWS via description.
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"
}
]
Download the IPSetter folder and install with pip.
$ sudo pip3 install .
- Windows
- Linux
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'
```
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
..are always welcome.