This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# The script requires the following permissions: | |
# ec2:RevokeSecurityGroupIngress | |
# ec2:AuthorizeSecurityGroupIngress | |
# ec2:DescribeSecurityGroups | |
# Of coure the user must have access to the security group that wants to add/remove rules | |
#Get The current public ip to be added | |
current_pub_ip="$(curl -s https://ipinfo.io/ip)/32" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#The script requires the following permissions: | |
# ec2:RevokeSecurityGroupIngress | |
# ec2:DescribeSecurityGroups | |
# Of coure the user must have access to the security group that wants to add/remove rules | |
group_id="The Group you need to edit (sg-xxxx)" | |
# The following description will be searched and return the ip rule that is associated with it. |