Created
February 18, 2013 18:47
-
-
Save joesondow/4979621 to your computer and use it in GitHub Desktop.
Which security groups have a lot of IP permission rules?
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
// Which security groups have a lot of IP permission rules? | |
['nactest', 'nacprod'].each { | |
asgardLocator.getInstance(it).acrossRegions { | |
def allSecurityGroups = security.securityGroups | |
allSecurityGroups.sort { it.ipPermissions.size() } | |
html.output << "<h3>${it}</h3>" | |
Map counts = new HashMap() | |
allSecurityGroups.each { sg -> | |
if (sg.ipPermissions.size() > 10) { | |
html.with { output << "SG ${sg.groupId} ${sg.groupName} ${sg.ipPermissions.size()} </br>" } | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment