SHARE
TWEET

Untitled

a guest Jul 21st, 2015 202 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import boto.ec2
  2.  
  3. sgs = boto.ec2.connect_to_region('us-east-1').get_all_security_groups()
  4.  
  5. for sg in sgs:
  6.     for rule in sg.rules:
  7.         print sg, sg.id, "inbound:", rule, " source:", rule.grants
  8.  
  9. SecurityGroup:default sg-e1304484 inbound: IPPermissions:tcp(80-80)  source: [67.184.225.222/32]
  10. SecurityGroup:default sg-e1304484 inbound: IPPermissions:tcp(5500-5500)  source: [67.184.225.222/32]
  11. SecurityGroup:Pub_HDP_SG sg-e632d982 inbound: IPPermissions:tcp(80-80)  source: [0.0.0.0/0]
  12. SecurityGroup:sg3-MySecurityGroup-LB0QF9UQAOEF sg-4fe73728 inbound: IPPermissions:tcp(22-22)  source: [0.0.0.0/0]
  13. SecurityGroup:sg3-MySecurityGroup-LB0QF9UQAOEF sg-4fe73728 inbound: IPPermissions:tcp(80-80)  source: [0.0.0.0/0]
  14. SecurityGroup:RDP Rule - open everyone  sg-42d58d27 inbound: IPPermissions:-1(None-None)  source: [0.0.0.0/0]
  15. SecurityGroup:us-east-open-all sg-97ffa7f2 inbound: IPPermissions:tcp(22-22)  source: [10.0.20.100/32]
  16. SecurityGroup:us-east-open-all sg-97ffa7f2 inbound: IPPermissions:tcp(53-53)  source: [10.0.20.100/32]
  17. SecurityGroup:wordpress-app-SG sg-99c4befc inbound: IPPermissions:-1(None-None)  source: [sg-e632d982-995635159130]
  18. SecurityGroup:wordpress-app-SG sg-99c4befc inbound: IPPermissions:tcp(22-22)  source: [67.184.225.222/32]
  19. SecurityGroup:wordpress-app-SG sg-99c4befc inbound: IPPermissions:tcp(1024-65535)  source: [10.0.20.100/32]
  20. SecurityGroup:wordpress-app-SG sg-99c4befc inbound: IPPermissions:tcp(80-80)  source: [24.12.30.198/32]
  21. SecurityGroup:wordpress-app-SG sg-99c4befc inbound: IPPermissions:udp(138-138)  source: [10.0.20.100/32]
  22. SecurityGroup:wordpress-app-SG sg-99c4befc inbound: IPPermissions:udp(53-53)  source: [24.12.30.198/32]
  23. SecurityGroup:wordpress-app-SG sg-99c4befc inbound: IPPermissions:tcp(30015-30015)  source: [0.0.0.0/0]
  24. SecurityGroup:wordpress-app-SG sg-99c4befc inbound: IPPermissions:icmp(-1--1)  source: [10.0.20.100/32]
  25. SecurityGroup:default sg-c65a20a3 inbound: IPPermissions:-1(None-None)  source: [sg-c65a20a3-995635159130]
  26. SecurityGroup:default sg-c65a20a3 inbound: IPPermissions:-1(None-None)  source: [sg-99c4befc-995635159130]
  27. SecurityGroup:sg3-MySecurityGroup2-1HGPN4UF57XN6 sg-4ee73729 inbound: IPPermissions:tcp(22-22)  source: [192.168.1.12/32]
  28. SecurityGroup:AWS-AMI-SG sg-35568d51 inbound: IPPermissions:tcp(22-22)  source: [0.0.0.0/0]
  29. SecurityGroup:launch-wizard-2 sg-932255f6 inbound: IPPermissions:tcp(22-22)  source: [10.0.20.100/32]
  30. SecurityGroup:launch-wizard-2 sg-932255f6 inbound: IPPermissions:tcp(443-443)  source: [0.0.0.0/0]
  31. >>>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top