Skip to content

Instantly share code, notes, and snippets.

@joesondow
Created February 18, 2013 18:47
Show Gist options
  • Save joesondow/4979621 to your computer and use it in GitHub Desktop.
Save joesondow/4979621 to your computer and use it in GitHub Desktop.
Which security groups have a lot of IP permission rules?
// 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