percolate / ec2-security-groups-dumper

Dump your EC2 Security Groups as a CSV or JSON file

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Assertion error on Protocols

zapman449 opened this issue · comments

Removing https://github.com/percolate/ec2-security-groups-dumper/blob/master/ec2_security_groups_dumper/main.py#L62-L63 from the code allows non tcp/udp protocols to come through as their IP protocol number, which is useful

is it documented somewhere?

Hi,
Im following up on this issue, as i think ive found the root cause.
i encountered the same error that is described here,

Traceback (most recent call last): File "C:\Program Files (x86)\Python37-32\Scripts\ec2-security-groups-dumper-script.py", line 11, in <module> load_entry_point('ec2-security-groups-dumper==1.9.1', 'console_scripts', 'ec2-security-groups-dumper')() File "c:\program files (x86)\python37-32\lib\site-packages\ec2_security_groups_dumper\main.py", line 389, in main print(firewall.csv) File "c:\program files (x86)\python37-32\lib\site-packages\ec2_security_groups_dumper\main.py", line 281, in csv for fr in self.rules: File "c:\program files (x86)\python37-32\lib\site-packages\ec2_security_groups_dumper\main.py", line 204, in rules rules_description=grant_row['description']) File "c:\program files (x86)\python37-32\lib\site-packages\ec2_security_groups_dumper\main.py", line 69, in __init__ u'tcp', u'udp', u'icmp', u'icmpv6', "-1", None) AssertionError

i have a aws account with a SG to Cisco appliance which uses GRE protocol,
which is considered a custom protocol, and shows up like this in console
Screen Shot 2019-04-17 at 5 41 18 PM

The assert in the code, only considers:
tcp, udp, icmp, icmpv6 and -1 , as valid.
And this custom protocol shows up as 47, thus failing.
When commenting out the Assert, i was able to dump a CSV file correctly

Thanks, should be fixed in 1.9.2